uncomplicate / neanderthal

Fast Clojure Matrix Library
http://neanderthal.uncomplicate.org
Eclipse Public License 1.0
1.06k stars 55 forks source link

CUDA 10.1 libJCublas2 .so loading issue #58

Closed jonesn closed 5 years ago

jonesn commented 5 years ago

Hi,

I was working through the install of the CUDA Hello World demos (MKL has been fine) and I'm getting an exception when libJCublas is trying to load a non-existent shared object. The Nvidia CUDA installation has been completed.

Is this because 10.1 is too new or should the linking be looking for the 10 series libcublas.so.10 as oppose to libcublas.so.10.0?

It sounds similar to this downstream issue, but I'm unsure if it is exactly the same problem. https://github.com/jcuda/jcuda-main/issues/24

Setup

Linux Mint (Ubuntu 18.04)
Java 1.8.0_201
Leiningen 2.9.1 on Java 1.8.0_201 Java HotSpot(TM) 64-Bit Server VM

Relevant Stacktrace

Stack trace from the attempt to load the library as a resource:
java.lang.UnsatisfiedLinkError: /tmp/libJCublas2-10.0.0-linux-x86_64.so: libcublas.so.10.0: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at jcuda.LibUtils.loadLibraryResource(LibUtils.java:260)
    at jcuda.LibUtils.loadLibrary(LibUtils.java:158)
    at jcuda.jcublas.JCublas2.initialize(JCublas2.java:81)
    at jcuda.jcublas.JCublas2.<clinit>(JCublas2.java:66)
    at uncomplicate.neanderthal.internal.device.cublas$fn__38049.invokeStatic(cublas.clj:2007)

Shared Objects Present

λ megadrive scorpion → λ git master* → locate libcublas
/usr/lib/x86_64-linux-gnu/libcublas.so
/usr/lib/x86_64-linux-gnu/libcublas.so.10
/usr/lib/x86_64-linux-gnu/libcublas.so.10.1.0.105
/usr/lib/x86_64-linux-gnu/libcublasLt.so
/usr/lib/x86_64-linux-gnu/libcublasLt.so.10
/usr/lib/x86_64-linux-gnu/libcublasLt.so.10.1.0.105
/usr/lib/x86_64-linux-gnu/libcublasLt_static.a
/usr/lib/x86_64-linux-gnu/libcublas_static.a
/usr/lib/x86_64-linux-gnu/stubs/libcublas.so
/usr/lib/x86_64-linux-gnu/stubs/libcublasLt.so

Relevant Project CLJ

  :dependencies [[org.clojure/clojure            "1.10.0"]
                           [uncomplicate/neanderthal       "0.22.1"]]

Thank you.

blueberry commented 5 years ago

You have to have the matching versions for CUDA and JCublas installations. Current Neanderthal version 0.22.1 uses CUDA/JCublas 10.0, and 10.1 is on the way, but still unavailable.

blueberry commented 5 years ago

Support for CUDA 10.1 is almost ready and will be in 0.24.0.