Closed DJtheRedstoner closed 1 year ago
Thanks @DJtheRedstoner, will be fixed in the first 3.3.3 snapshot.
Hello, I'm trying to run the HelloCuda, and I encounter exactly the same problem on the v3.3.3 :
[LWJGL] Failed to load a library. Possible solutions:
a) Install the library or the driver that provides the library.
b) Ensure that the library is accessible from the system library paths.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: libnvcuda.so
at org.lwjgl@3.3.3+5/org.lwjgl.system.Library.loadNative(Library.java:346)
at org.lwjgl@3.3.3+5/org.lwjgl.system.Library.loadNative(Library.java:236)
at org.lwjgl@3.3.3+5/org.lwjgl.system.Library.loadNative(Library.java:217)
at org.lwjgl@3.3.3+5/org.lwjgl.system.Library.loadNative(Library.java:431)
at org.lwjgl@3.3.3+5/org.lwjgl.system.Library.loadNative(Library.java:402)
at org.lwjgl.cuda@3.3.3+5/org.lwjgl.cuda.CUDA.isPerThreadDefaultStreamSupported(CUDA.java:76)
at org.nyaneer/org.xyz.CudaTest.run(CudaTest.java:94)
at org.nyaneer/org.xyz.XYZApplicationLauncher.main(XYZApplicationLauncher.java:26)
I'm on Archlinux, with cuda
package installed. It looks like the library is named "libcuda.so" there
# find / -name "*cuda.so" -type f 2>/dev/null
/opt/cuda/targets/x86_64-linux/lib/stubs/libcuda.so
Ok, I got it working, but there is still a problem.
On Archlinux, libcuda.so
is located in the package nvidia-utils (and not in package cuda)
But LWJGL 3.3.3 is still looking for a lib named libnvcuda.so
.
As a workaround, I made a symbolic link:
ln -s /usr/lib/libcuda.so /usr/lib/libnvcuda.so
Version
3.3.2
Platform
Linux x64
JDK
openjdk version "17.0.6" (Ubuntu package)
Module
CUDA
Bug description
The default library name for CUDA is set to
nvcuda
, which is correct for Windows but on Linux the library name is justcuda
. https://github.com/LWJGL/lwjgl3/blob/5ed7786c0461ee7621078fd8a437f8455948ac6a/modules/lwjgl/cuda/src/generated/java/org/lwjgl/cuda/CU.java#L34Setting
-Dorg.lwjgl.cuda.libname=cuda
fixes this problem.Stacktrace or crash log output