Error in Setting up a minimum JCuda test project

Hello,
I was trying to prove “Setting up a test project JCuda minimum” and I get the following error:


administrador@ubuntu:~/Desarrollo/jcuda042$ java -cp ".:jcuda-0.4.2.jar" JCudaRuntimeTest
Error while loading native library "JCudaRuntime-linux-x86" with base name "JCudaRuntime"
Operating system name: Linux
Architecture         : i386
Architecture bit size: 32
Stack trace from the attempt to load the library as a resource:
java.lang.NullPointerException: No resource found with name '/lib/libJCudaRuntime-linux-x86.so'
	at jcuda.LibUtils.loadLibraryResource(LibUtils.java:151)
	at jcuda.LibUtils.loadLibrary(LibUtils.java:83)
	at jcuda.runtime.JCuda.initialize(JCuda.java:303)
	at jcuda.runtime.JCuda.<clinit>(JCuda.java:290)
	at JCudaRuntimeTest.main(JCudaRuntimeTest.java:8)
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: no JCudaRuntime-linux-x86 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
	at java.lang.Runtime.loadLibrary0(Runtime.java:823)
	at java.lang.System.loadLibrary(System.java:1028)
	at jcuda.LibUtils.loadLibrary(LibUtils.java:94)
	at jcuda.runtime.JCuda.initialize(JCuda.java:303)
	at jcuda.runtime.JCuda.<clinit>(JCuda.java:290)
	at JCudaRuntimeTest.main(JCudaRuntimeTest.java:8)

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load the native library
	at jcuda.LibUtils.loadLibrary(LibUtils.java:129)
	at jcuda.runtime.JCuda.initialize(JCuda.java:303)
	at jcuda.runtime.JCuda.<clinit>(JCuda.java:290)
	at JCudaRuntimeTest.main(JCudaRuntimeTest.java:8)


I placed the .jar and .SO to jcuda in the same folder called jcuda042, where I have also placed the “JCudaRuntimeTest.java”.

Anyone can help me?

Thank you very much.

Hello

There has recently been a thread reporting problems with the Linux32 binaries, but this referred to the driver API, and according to this post, the runtime API did work (although the reason for the problems with the driver API have not been found out yet … I don’t have access to a CUDA-capable Linux32 machine :frowning: )

Which version of the CUDA Toolkit do you have installed?

bye

Ah, wait a moment: It simply says
java.lang.UnsatisfiedLinkError: no JCudaRuntime-linux-x86 in java.library.path

That usually means that the respecive .SO file seems not to be located in the same directory - are you sure that the “libJCudaRuntime-linux-x86.so” is located in the same directory as the JAR and your Java file?

[QUOTE=Marco13]Ah, wait a moment: It simply says
java.lang.UnsatisfiedLinkError: no JCudaRuntime-linux-x86 in java.library.path

That usually means that the respecive .SO file seems not to be located in the same directory - are you sure that the “libJCudaRuntime-linux-x86.so” is located in the same directory as the JAR and your Java file?[/QUOTE]

It’s Toolkit version 4.2. Yes, I decompress the file “Binaries for Linux 32bit” (and then I changed the name to “jcuda042”), and then added the java file in the same folder.

I’ll try it in Windows XP, but I would be more interesting to make it work in Linux : (

Well, on Windows it should definitely work, since that’s my main development OS.

But for Linux… I can’t imagine why it should not find a library that is located in the same directory. You might try to add the respective directory to the java.library.path, or to the LD_LIBRARY_PATH environment variable, although it should not be necessary.

(Maybe I should remove the Linux32 binaries from the site - there’s no point in providing binaries that I could not really test… -_- )