8000 UnsatisfiedLinkError with Fedora 40 (cuda 12.6) · Issue #45 · jcuda/jcuda · GitHub
[go: up one dir, main page]

Skip to content

UnsatisfiedLinkError with Fedora 40 (cuda 12.6) #45

Open

Description

@btbouwens

The latest version of jcuda on Maven is 12.0.0, but when I use that I get
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: no JCudaDriver-12.0.0-linux-x86_64 in java.library.path: /usr/local/cuda/lib:/usr/local/cuda/lib::/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2434)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
at java.base/java.lang.System.loadLibrary(System.java:2006)
at jcuda.LibUtils.loadLibrary(LibUtils.java:168)
at jcuda.LibUtilsCuda.loadLibrary(LibUtilsCuda.java:68)
at jcuda.driver.JCudaDriver.(JCudaDriver.java:350)
at ...
...
Stack trace from the attempt to load the library as a resource:
java.lang.UnsatisfiedLinkError: /tmp/libJCudaDriver-12.0.0-linux-x86_64.so: libcuda.so.1: cannot open shared object file: No such file or directory
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1970)
at jcuda.LibUtils.loadLibraryResource(LibUtils.java:285)
at jcuda.LibUtils.loadLibrary(LibUtils.java:183)
at jcuda.LibUtilsCuda.loadLibrary(LibUtilsCuda.java:68)
at jcuda.driver.JCudaDriver.(JCudaDriver.java:350)

which does make somem sense I guess, as the current libraries are from cuda-libraries-devel-12-6-12.6.2-1.x86_64

I'm not sure if I can make a simple work around, need to simply rebuild against this version, or better roll back to the formally obsolete Fedora 39 :(

Bram

Activity

  1. jcuda commented on Nov 14, 2024

    @jcuda
    Owner

    The CUDA version and the JCuda version must match, insofar that it will not be possible to use JCuda 12.0.0 to access CUDA 12.6.

    I know that an update is overdue, but ... I'm not sooo actively maintaining JCuda (for many reasons).

    However, an update for the latest CUDA version is already in the pipeline (as a follow-up of #44 (comment) ). I already downloaded and installed the latest CUDA version, and need to do an update pass for possible changes in cuDNN, and then will hopefully be able to create a new release (for CUDA 12.6) soon.

  2. jcuda commented on Nov 14, 2024

    @jcuda
    Owner

    An aside:

    need to simply rebuild against this version

    This is theoretically possible, but it's not clear (yet) whether there have been breaking changes in the API (meaning that you would have to update the code). If you can compile the .so files, it should be possible to load them (with caveats).

  3. btbouwens commented on Nov 15, 2024

    @btbouwens
    Author

    OK, trying that. Cmake complains about the cmake_minimum_required(VERSION 3.1) being deprecated, and it doesn't know CUDA_CUDA_LIBRARY and CUDA_cuDNN_LIBRARY, but that should be easy to fix I think.

  4. btbouwens commented on Nov 15, 2024

    @btbouwens
    Author

    There are some other differences: the newer cmake has a different way of finding the CUDA toolkit, and/or it's in a different place.
    Apart from that, nvcc doesn't like gcc-14, a work around could be to use clang instead, there's a trick for that I think.

  5. btbouwens commented on Nov 15, 2024

    @btbouwens
    Author

    Actually, the problem I had originally is much simpler: I simply didn't have nvidia-driver-cuda-libs-3:565.57.01-1.fc40.x86_64 installed, which contains the required libraries.
    To fix, it's just sudo dnf -y module install nvidia-driver:open-dkms.
    This doesn't fix the issue with gcc-14 though, for that the "-ccbin /usr/bin/clang++ " helps in the nvcc call.

  6. jcuda commented on Nov 15, 2024

    @jcuda
    Owner

    I cannot say much about the specifics of the Linux setup and compilation. But

    it doesn't know CUDA_CUDA_LIBRARY and CUDA_cuDNN_LIBRARY, but that should be easy to fix I think.

    You may have to manually set these to the .lib files that correspond to
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib\x64\cuda.lib
    and
    C:\Program Files\NVIDIA\CUDNN\v9.5\lib\12.6\x64\cudnn.lib
    on Linux.

    (Similarly, it may not find the proper _INCLUDE... directories, and these may also have to be set manually).

    There's that FindCUDA.cmake script that usually does most of the work, but ... it may not always work and may not always be up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0