uncomplicate / neanderthal

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

CUDA is not available on macOS from version 11 and up #100

Closed blueberry closed 3 years ago

blueberry commented 3 years ago

Stack trace from the attempt to load the library as a resource:

java.io.IOException: No resource found with name '/lib/libJCudaRuntime-11.0.0-apple-x86_64.dylib'
etc.

This is not a bug. CUDA is not available on macOS any more, due to Apple/Nvidia hostility.

The solution is to explicitly exclude all dependencies related to CUDA.

For example, add something like this in your project.clj to globally exclude JCuda jars:

:exclusions [org.jcuda/jcuda
                    org.jcuda/jcublas]
blueberry commented 3 years ago

Please see the updated hello world project.clj. These exclusions have to be added:

:exclusions [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]
            [org.jcuda/jcublas-natives :classifier "apple-x86_64"]]
HLevering commented 2 years ago

On Mac with M1 Arm chip you have to leave out the classifier or change the classifier to "linux-aarch64" otherwise it will complain on not finding these packages at first repl start.

Could not find artifact org.jcuda:jcuda-natives:jar:linux-aarch64:11.4.1 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.jcuda:jcuda-natives:jar:linux-aarch64:11.4.1 in clojars (https://repo.clojars.org/)
Could not find artifact org.jcuda:jcublas-natives:jar:linux-aarch64:11.4.1 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.jcuda:jcublas-natives:jar:linux-aarch64:11.4.1 in clojars (https://repo.clojars.org/)