I have imported the following libraries in Gradle:
compile group: 'org.jcuda', name: 'jcuda-natives', version: '0.9.2'
compile group: 'org.jcuda', name: 'jcublas-natives', version: '0.9.2'
compile group: 'org.jcuda', name: 'jcublas', version: '0.9.2'
and copy pasted JCublasSampleexample from JCuda page.
Unfortunately, I am getting the following error:
Creating input data...
Performing Sgemm with Java...
Performing Sgemm with JCublas...
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error while loading native library "JCudaRuntime-0.9.2-windows-x86_64"
Operating system name: Windows 10
Architecture : amd64
Architecture bit size: 64
---(start of nested stack traces)---
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: no JCudaRuntime-0.9.2-windows-x86_64 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at jcuda.LibUtils.loadLibrary(LibUtils.java:143)
at jcuda.runtime.JCuda.initialize(JCuda.java:422)
at jcuda.runtime.JCuda.<clinit>(JCuda.java:406)
at jcuda.jcublas.JCublas.initialize(JCublas.java:93)
at jcuda.jcublas.JCublas.<clinit>(JCublas.java:81)
...
Of course, library is absent. The question is how to link it Maven/Gradle? Site says all DLLs should be inside JARs.
CUDA is installed, but I didn't specify it's version anywhere as I was to do with nd4j.
It was my fault: cublas DLL of correct CUDA version was not in the
PATH.DLLof JCublas was loading successfully without any Gradle tricks, because code was copying it intotmpdirectory froumeCLASSPATH. Simultaneously, error message was not informative, suggesting me to look for problems in other place and also Gradle example was confusing.Summarizing what is required: to have CUDA of the same version as JCublas installed (and PATH correct) and required "native" JARs on classpath.