jcuda / jcuda-main

Summarizes the main JCuda libraries
MIT License
98 stars 20 forks source link

Cannot build project with JCublas2 #17

Closed ratthapon closed 7 years ago

ratthapon commented 7 years ago

I just simply add,

        <dependency>
            <groupId>org.jcuda</groupId>
            <artifactId>jcuda</artifactId>
            <version>0.8.0</version>
        </dependency>
        <dependency>
            <groupId>org.jcuda</groupId>
            <artifactId>jcublas</artifactId>
            <version>0.8.0</version>
        </dependency>

, to the dependency in pom.xml of project. The project can be built. But when the JCublas2 is called in testing phase, it broked like this,

java.lang.UnsatisfiedLinkError: Error while loading native library "JCublas2-0.8.0-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 JCublas2-0.8.0-windows-x86_64 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at jcuda.LibUtils.loadLibrary(LibUtils.java:143)
    at jcuda.jcublas.JCublas2.initialize(JCublas2.java:81)
    at jcuda.jcublas.JCublas2.<clinit>(JCublas2.java:66)

I can still run with only JCuda. Could you help me fix this?

ratthapon commented 7 years ago

Sorry. I've use inconsistent CUDA Toolkit version.

jcuda commented 7 years ago

Good to hear that you solved it.

(BTW: When the library cannot be loaded, there are actually two stack traces printed, and I assume that the other one said something about "... cannot find dependent libraries", because it did not find the right CUBLAS.DLL. This might have been a hint)