Reorganising build.gradle for CUDA 12
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m10s Details

Signed-off-by: brian <brian@brutex.de>
CUDA12
Brian Rosenberger 2023-09-01 10:31:56 +02:00
parent 7b48bf1afb
commit 17c2306701
6 changed files with 67 additions and 8 deletions

View File

@ -0,0 +1,26 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build -PCAVIS_CHIP=cpu -Pskip-native=false
- run: echo "This job's status is ${{ job.status }}."

View File

@ -0,0 +1,30 @@
/*
*
* ******************************************************************************
* *
* * This program and the accompanying materials are made available under the
* * terms of the Apache License, Version 2.0 which is available at
* * https://www.apache.org/licenses/LICENSE-2.0.
* *
* * See the NOTICE file distributed with this work for additional
* * information regarding copyright ownership.
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* * License for the specific language governing permissions and limitations
* * under the License.
* *
* * SPDX-License-Identifier: Apache-2.0
* *****************************************************************************
*
*/
package net.brutex.ai;
public class LoaderTest {
public static void main(String[] args){
System.load("C:\\Users\\brian\\_projects\\deeplearning4j\\cavis-native\\cavis-native-lib"
+ "\\build\\generated\\sources\\javacpp\\cuda\\windows-x86_64-avx2\\jnind4jcuda.dll");
}
}

View File

@ -129,14 +129,14 @@ import java.util.List;
}, },
compiler = {"cpp11", "nowarnings"}, compiler = {"cpp11", "nowarnings"},
library = "jnind4jcuda", library = "jnind4jcuda",
link = "nd4jcuda", link = "nd4jcuda"),
preload = "nd4jcuda"), //preload = "nd4jcuda"),
@Platform(value = "linux", preload = "gomp@.1", preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/", "/usr/local/cuda/lib64"}), @Platform(value = "linux", preload = "gomp@.1", preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/", "/usr/local/cuda/lib64"}),
@Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}), @Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}),
@Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}), @Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}),
@Platform(value = "linux-ppc64", preloadpath = {"/usr/powerpc64-linux-gnu/lib/", "/usr/powerpc64le-linux-gnu/lib/", "/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}), @Platform(value = "linux-ppc64", preloadpath = {"/usr/powerpc64-linux-gnu/lib/", "/usr/powerpc64le-linux-gnu/lib/", "/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}),
@Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6", "nd4jcuda"}) @Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6"})
}) })
public class Nd4jCudaPresets implements LoadEnabled, InfoMapper { public class Nd4jCudaPresets implements LoadEnabled, InfoMapper {

View File

@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.20)
project(libnd4j) project(libnd4j)
set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
@ -160,10 +161,10 @@ elseif (APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fPIC -Wno-braced-scalar-init -Wno-delete-non-virtual-dtor -Wno-unused-command-line-argument -Wno-dangling-else -D__APPLE_OS__=true -D_RELEASE=true") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fPIC -Wno-braced-scalar-init -Wno-delete-non-virtual-dtor -Wno-unused-command-line-argument -Wno-dangling-else -D__APPLE_OS__=true -D_RELEASE=true")
set(CMAKE_CXX_FLAGS_DEBUG " -O0 -g -fPIC -Wno-braced-scalar-init -Wno-delete-non-virtual-dtor -Wno-unused-command-line-argument -Wno-dangling-else -D__APPLE_OS__=true") set(CMAKE_CXX_FLAGS_DEBUG " -O0 -g -fPIC -Wno-braced-scalar-init -Wno-delete-non-virtual-dtor -Wno-unused-command-line-argument -Wno-dangling-else -D__APPLE_OS__=true")
elseif(WIN32) elseif(WIN32)
set(SD_X86_BUILD true) set(SD_X86_BUILD false)
if (SD_CUDA) if (SD_CUDA)
set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE=true") set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE=true")
set(CMAKE_CXX_FLAGS_DEBUG " /FS /EHsc") #set(CMAKE_CXX_FLAGS_DEBUG " /FS /EHsc")
else() else()
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fPIC -D_RELEASE=true") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fPIC -D_RELEASE=true")
set(CMAKE_CXX_FLAGS_DEBUG " -g -O2 -fPIC") set(CMAKE_CXX_FLAGS_DEBUG " -g -O2 -fPIC")
@ -375,7 +376,6 @@ if (MSVC_DEV)
set(SD_BUILD_MINIFIER false) set(SD_BUILD_MINIFIER false)
endif () endif ()
set (CMAKE_INSTALL_PREFIX $ENV{ND4J_HOME}/bruai4j-native/bruai4j-native-common/src/main/resources)
# Set package information # Set package information
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Native operations for nd4j.") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Native operations for nd4j.")

View File

@ -187,6 +187,7 @@ task deepClean(type: Delete) {
tasks.withType(org.bytedeco.gradle.javacpp.BuildTask).configureEach { org.bytedeco.gradle.javacpp.BuildTask it -> tasks.withType(org.bytedeco.gradle.javacpp.BuildTask).configureEach { org.bytedeco.gradle.javacpp.BuildTask it ->
/*
it.buildResource = ["/org/bytedeco/openblas/${javacppPlatform}/", it.buildResource = ["/org/bytedeco/openblas/${javacppPlatform}/",
"/org/bytedeco/mkldnn/${javacppPlatform}/"] "/org/bytedeco/mkldnn/${javacppPlatform}/"]
@ -194,6 +195,8 @@ tasks.withType(org.bytedeco.gradle.javacpp.BuildTask).configureEach { org.bytede
it.linkResource = ["/org/bytedeco/openblas/${javacppPlatform}/", it.linkResource = ["/org/bytedeco/openblas/${javacppPlatform}/",
"/org/bytedeco/openblas/${javacppPlatform}/lib/"] "/org/bytedeco/openblas/${javacppPlatform}/lib/"]
*/
} }

View File

@ -224,7 +224,7 @@ if(SD_CUDA)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -DCUDA_VERSION_MAJOR=12 -w -Xfatbin -compress-all") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -DCUDA_VERSION_MAJOR=12 -w -Xfatbin -compress-all")
set(CUDAHOSTCXX "${CMAKE_CXX_COMPILER}") set(CUDAHOSTCXX "${CMAKE_CXX_COMPILER}")
if(WIN32) if(WIN32)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=/EHsc") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=/EHsc -Xcompiler=/bigobj")
endif() endif()
message("CMAKE_CUDA_FLAGS = ${CMAKE_CUDA_FLAGS}") message("CMAKE_CUDA_FLAGS = ${CMAKE_CUDA_FLAGS}")
@ -307,7 +307,7 @@ if(SD_CUDA)
# Done by nvcc as default on windows # Done by nvcc as default on windows
if(WIN32) if(WIN32)
message("CUDA on Windows: enabling /EHsc") message("CUDA on Windows: enabling /EHsc and /bigobj")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /bigobj") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /bigobj")
endif() endif()