Ububtu: java.lang.UnsatisfiedLinkError: Could not load native library

Hi,
i just tried to sun the sample in JCudaRuntimeSample.java , but gave the this error:

Exception in thread “main” java.lang.UnsatisfiedLinkError: Could not load native library
at jcuda.LibUtils.loadLibrary(LibUtils.java:79)
at jcuda.runtime.JCuda.assertInit(JCuda.java:225)
at jcuda.runtime.JCuda.cudaMalloc(JCuda.java:1513)
at JCudaRuntimeSample.main(JCudaRuntimeSample.java:41)

i read the sticky FAQ and read other posts too, but didn’t help

just to be clear here, i put the file JCudaRuntimeSample.java and all its dependencies in one directory,

i compiled the file using this command:

u019@u019-laptop:~/Downloads/JCuda-All-0.3.1-bin-linux-x86_64$ javac -cp “.:jcuda-0.3.1.jar:jcublas-0.3.1.jar:jcudpp-0.3.1.jar:jcufft-0.3.1.jar” JCudaRuntimeSample.java

with no error.

i run the sample with this command:

u019@u019-laptop:~/Downloads/JCuda-All-0.3.1-bin-linux-x86_64$ java -cp “.:jcuda-0.3.1.jar:jcublas-0.3.1.jar:jcudpp-0.3.1.jar:jcufft-0.3.1.jar” JCudaRuntimeSample

and the output was:

Creating input data
Initializing device data using JCuda
Error while loading native library with base name “JCudaRuntime”
Operating system name: Linux
Architecture : amd64
Architecture bit size: 64
Exception in thread “main” java.lang.UnsatisfiedLinkError: Could not load native library
at jcuda.LibUtils.loadLibrary(LibUtils.java:79)
at jcuda.runtime.JCuda.assertInit(JCuda.java:225)
at jcuda.runtime.JCuda.cudaMalloc(JCuda.java:1513)
at JCudaRuntimeSample.main(JCudaRuntimeSample.java:41)

the folder contents are:

-rw-r–r-- 1 u019 u019 12525 2010-07-19 12:46 jcublas-0.3.1.jar
-rw-r–r-- 1 u019 u019 65494 2010-07-19 15:05 jcuda-0.3.1.jar
-rw-r–r-- 1 u019 u019 2695 2010-09-19 12:42 JCudaRuntimeSample.class
-rw-r–r-- 1 u019 u019 3947 2010-09-19 12:23 JCudaRuntimeSample.java
-rw-r–r-- 1 u019 u019 6664 2010-07-19 12:46 jcudpp-0.3.1.jar
-rw-r–r-- 1 u019 u019 7191 2010-07-19 12:46 jcufft-0.3.1.jar
-rwxr-xr-x 1 u019 u019 168437 2010-07-19 12:48 libJCublas-linux-x86_64.so
-rwxr-xr-x 1 u019 u019 124304 2010-07-19 14:58 libJCudaDriver-linux-x86_64.so
-rwxr-xr-x 1 u019 u019 113433 2010-07-19 12:48 libJCudaRuntime-linux-x86_64.so
-rwxr-xr-x 1 u019 u019 32415 2010-07-19 14:52 libJCudpp-linux-x86_64.so
-rwxr-xr-x 1 u019 u019 28511 2010-07-19 12:48 libJCufft-linux-x86_64.so

i got the libraries from this file:

JCuda-All-0.3.1-bin-linux-x86_64.zip

my java version is :

java version “1.6.0_21”
Java™ SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot™ 64-Bit Server VM (build 17.0-b16, mixed mode)

my linux version :

Linux u019-laptop 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:58:24 UTC 2010 x86_64 GNU/Linux

any help please?

Hello

Thanks for the detailed information, this already helps to eliminate many possible reasons for this error. The only thing that you did not mention (and which I therefore have to ask about first) is your CUDA driver and toolkit: Did you install the CUDA driver and the CUDA Toolkit version 3.1 from the NVIDIA CUDA download site?

I’m assuming that your Laptop contains a CUDA capable GPU - which seems unusual for me, but may be possible, of course. But you might want to test one of the CUDA samples, for example, the vector addition, to see whether CUDA is working in general.

bye
Marco