我在 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'
并从 JCuda 页面复制粘贴的 JCublasSampleexample 。
不幸的是,我收到以下错误:
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)
...
当然,图书馆是缺席的。问题是如何链接它 Maven/Gradle?网站说所有 DLL 都应该在 JAR 中。
CUDA
已安装,但我没有在任何地方指定它的版本,就像我对nd4j
.