Support for cuda 13.0 toolkit?

I’m trying to get DL4J working with my RTX 5070 card, which means I need support for the cuda 13.0 toolkit (compute capability 12.0). By now I’ve figured I’m not going to have this working using the current sources. Any idea if or when this will be the case?

(by the way, there’s a typo in the artifactid of commons-lang3 in deeplearning4j/nd4j/nd4j-common/pom.xml:

        commonas-lang3

)

@markiemark if you’re building from source let me look in to it a little bit. The main thing to do would be to update the cuda-version.sh shell script. Unfortunately, I havent done a build without javacpp supporting a particular version.

Usually I pin the version. I”m not sure how the java side will interact there. I can ensure the build works with cuda 13 though.

In terms of the compute level that’s not hard to update the cmake. I can step you through a PR if you’d like to attempt it or I can take a look at this this week.

It’s not impossible but some things I”m not sure on due to the upstream javacpp issue. Javacpp only works with cuda 12.9.

After modifying change_cuda_versions.sh such that it accepts 13.0 (version2=9.13, version3=1.5.12) and upgrading the cuda toolkit back to 13.0 (I tried with 12.6, but that obviously failed) I ran into Cmake problems. I suspect this has to do with your last comment about javacpp. A friendly AI assisted me all day and made a nice summary:

Problem Description: “I am trying to build Deeplearning4j (ND4J) 1.0.0-SNAPSHOT with CUDA 13.0 and GCC 12 on Ubuntu 24.04. The build consistently fails during the libnd4j module’s native compilation phase with the following CMake error:”

-- Detecting CUDA compiler ABI info
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
_CMAKE_CUDA_WHOLE_FLAG
CMake Error at /opt/cmake-3.26.0-linux-x86_64/share/cmake-3.26/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  /opt/cmake-3.26.0-linux-x86_64/share/cmake-3.26/Modules/CMakeTestCUDACompiler.cmake:19 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:1155 (enable_language)

3. Troubleshooting Steps Already Taken:

  • Compiler/Toolkit Setup:

    • Verified CUDA_HOME is /usr/local/cuda-13.0.

    • PATH and LD_LIBRARY_PATH are set to prioritize CUDA 13.0, and LD_LIBRARY_PATH is explicitly cleared before setting.

    • CUDACXX, CC, CXX are explicitly set to /usr/bin/g++-12 and /usr/bin/gcc-12.

    • CMAKE_CUDA_COMPILER is explicitly set to /usr/local/cuda-13.0/bin/nvcc.

    • CUDAARCHS is set to 120.

  • CMake Installation:

    • Attempted multiple CMake versions (3.28, 4.1.0, 3.26.0) through apt purge and manual binary installs from cmake.org. The current version is 3.26.0 installed to /opt/cmake-3.26.0-linux-x86_64.

    • CMAKE_INSTALL_DIR is set, and its bin directory is first in PATH.

    • Explicitly set CMAKE_MAKE_PROGRAM, CMAKE_LINKER, CMAKE_AR, CMAKE_RANLIB via which command.

  • Diagnostic Tests (Crucially, these pass):

    • NVCC Diagnostic Test: A simple C++ CUDA program (.cu file) compiles successfully with nvcc -ccbin=/usr/bin/g++-12 when run directly in the shell.

    • Manual CMake ABI Test: A minimal CMakeLists.txt project (cmake_minimum_required(VERSION 3.5), project(CudaAbiTest LANGUAGES CXX CUDA), add_executable(cuda_abi_test main.cu)) successfully configures and builds when executed manually with the same environment variables.

    • Implication: The underlying CUDA toolkit, nvcc, and g++-12 appear to be correctly installed and functional, and CMake itself can successfully perform its ABI detection when run directly in a controlled environment.

    • Maven clean install is run with -U (force update of snapshots).

    • The problem arises when Maven’s javacpp-cppbuild plugin internally invokes CMake.

  • Recent Clues:

    • A previous log indicated CMake explicitly looked for dlltool-12 (or dlltool) and failed to find it just before the _CMAKE_CUDA_WHOLE_FLAG error. This happened after binutils-mingw-w64-x86-64 and its symlink were removed for a clean environment.

4. Request for Maintainer Guidance: "Given that individual compiler and CMake ABI tests pass in my shell environment, but the error persists during the Maven build, it seems like a very subtle interaction issue when javacpp-cppbuild invokes CMake. Could this be related to:

  • Specific internal variables or paths that javacpp-cppbuild needs or might be overriding for CMake’s CUDA detection?

  • An unexpected dependency on dlltool (even for a native Linux build) within CMake’s CUDA modules that isn’t satisfied by the default Linux binutils?

  • Any known compatibility issues with CMake 3.26.0 / CUDA 13.0 / GCC 12 that might not be fully covered by standard environment variable settings?"