Java Binding for CUDA jcuda

Hi all,

I am using jcuda - Java Binding for CUDA http://www.jcuda.org/

Is there any body with experience.

Any ways

Please help me to find out the solution to this probem.

bibrak@bibrak-laptop:/media/Academics/Academic/Research/HPC/CUDA/JCUDA$ javac -cp .:$JCUDA_HOME/jcuda-0.2.3.jar:$JCUDA_HOME/jcublas-0.2.3.jar:$JCUDA_HOME/jcufft-0.2.3.jar:$JCUDA_HOME/jcudpp-0.2.3.jar JCudaRuntimeSample.java

COMPILES OK

bibrak@bibrak-laptop:/media/Academics/Academic/Research/HPC/CUDA/JCUDA$ java JCudaRuntimeSample
Creating input data
Initializing device data using JCuda
Exception in thread “main” java.lang.NoClassDefFoundError: jcuda/Pointer
at JCudaRuntimeSample.main(JCudaRuntimeSample.java:45)
Caused by: java.lang.ClassNotFoundException: jcuda.Pointer
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320
)
… 1 more

ok I got it,

I run it and then got an other error :(

bibrak@bibrak-laptop:/media/Academics/Academic/Research/HPC/CUDA/JCUDA$ java -cp .:$JCUDA_HOME/jcuda-0.2.3.jar:$JCUDA_HOME/jcublas-0.2.3.jar:$JCUDA_HOME/jcufft-0.2.3.jar:$JCUDA_HOME/jcudpp-0.2.3.jar JCudaRuntimeSample
Creating input data
Initializing device data using JCuda
Error while loading native library with base name “JCudaRuntime”
Operating system name: Linux
Architecture : i386
Architecture bit size: 32
Stack trace:
java.lang.UnsatisfiedLinkError: no JCudaRuntime-linux-x86 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at jcuda.LibUtils.loadLibrary(LibUtils.java:53)
at jcuda.runtime.JCuda.assertInit(JCuda.java:227)
at jcuda.runtime.JCuda.cudaMalloc(JCuda.java:844)
at JCudaRuntimeSample.main(JCudaRuntimeSample.java:47)

ok I successfully run it
by just adding Path of JCUDA libraries to LD_LIBRARY_PATH

SAMPLE PROGRAM

compilation
bibrak@bibrak-laptop:/media/Academics/Academic/Research/HPC/CUDA/JCUDA$ javac -cp .:$JCUDA_HOME/jcublas-0.2.3.jar:$JCUDA_HOME/jcuda-0.2.3.jar:$JCUDA_HOME/jcudpp-0.2.3.jar:$JCUDA_HOME/jcufft-0.2.3.jar JCudaRuntimeSample.java

run
bibrak@bibrak-laptop:/media/Academics/Academic/Research/HPC/CUDA/JCUDA$ java -cp .:$JCUDA_HOME/jcublas-0.2.3.jar:$JCUDA_HOME/jcuda-0.2.3.jar:$JCUDA_HOME/jcudpp-0.2.3.jar:$JCUDA_HOME/jcufft-0.2.3.jar JCudaRuntimeSample
Creating input data
Initializing device data using JCuda
Performing FFT using JCufft
Performing caxpy using JCublas
Performing scan using JCudpp
Result: 196.08002