uncomplicate / neanderthal

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

Dependent jar missing for macOS (neanderthal 0.18.0) #41

Closed neolee closed 6 years ago

neolee commented 6 years ago

OS: macOS High Sierra 10.13.3 JDK: 1.8.0_162 Leiningen: Leiningen 2.8.1 on Java 1.8.0_162 Java HotSpot(TM) 64-Bit Server VM

lein deps Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in central (https://repo1.maven.org/maven2/) Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in clojars (https://repo.clojars.org/) Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:0.9.0 in central (https://repo1.maven.org/maven2/) Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:0.9.0 in clojars (https://repo.clojars.org/) This could be due to a typo in :dependencies, file system permissions, or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.

blueberry commented 6 years ago

That is expected: JCuda 0.9.0 has been released with only Windows and Linux native binaries, since the last Mac with Nvidia GPU has been produced 5 years ago and we couldn't find anyone to build it for macOS.

Since you have Intel & AMD hardware, sadly you cannot build it and contribute it, but you also cannot make use of Neanderthal's CUDA integration, so I guess your issue is just that lein deps fails.

Can you run normal lein commands, or they fail too? If you can, issue solved. If you can't please add jcuda-natives explicitly to :exclusions in your lein project, and report here whether it works right now.

neolee commented 6 years ago

@blueberry After adding org.jcuda/jcuda-natives and org.jcuda/jcublas-natives to :exclusions all run well. Otherwise the REPL will not startup fue to dependency error. Thanks.

blueberry commented 6 years ago

Due to some bug in Clojars, I couldn't make this automatic in Neanderhal (for now), so I added the example of how to use this workaround in the Hello World project. See https://github.com/uncomplicate/neanderthal/blob/master/examples/hello-world/project.clj

kennyjwilli commented 5 years ago

Is there a way to get this to work when using deps.edn?

blueberry commented 5 years ago

There are two ways to handle this:

  1. Compile JCuda on a Mac and contribute it, so it could be included into JCuda distribution.
  2. Ask deps.edn developers (Cognitect) if and how deps.edn support exclusions.
kennyjwilli commented 5 years ago

Alex Miller added a fix for this in TDEPS-112. For clarity, you only need to have :exclusions [org.jcuda/jcuda-natives org.jcuda/jcublas-natives] on a Mac, not a Linux machine, correct?

blueberry commented 5 years ago

You're right. If you had to have exclusions everywhere, I'd exclude those in the project dependencies in the first place.

And even for mac, exclusions are necessary temporarily because we simply could not find anyone to build JCuda for mac, since Apple stopped shipping Nvidia GPU's in their laptops 5 years ago. I'd tried to specify mac-specific exclusions of JCuda in neanderthal itself, but, alas, leiningen's dependency resolution can not pick it up transitively - it has to be excluded from the main project.

On the other hand, if someone with a Mac+Nvidia hardware appears and helps with the (fairly straightforward and automatic) build, that would solve this issue for good.

kennyjwilli commented 5 years ago

Not sure if this would solve the problem, but CircleCI offers MacOS builds at 1x concurrency for free for open source projects (link).

blueberry commented 5 years ago

Access to a mac is not a problem (I regularly build neanderthal-native for mac and win in addition to my main development platform, linux) but an access to a Mac with CUDA-enabled hardware.

Now, it is probably possible to install CUDA binaries on a non-Nvidia mac, and build JCuda without testing, but it was just not a priority.

On that note, if you're a Mac user, and are willing to spare an afternoon to properly set CUDA (without the ability to actually run it and test it) and try to build JCuda for Mac - please contact Marco Hutter, the author of JCuda. He is very eager to help with that!

blueberry commented 5 years ago

Neanderthal 0.24.0 will fix this macos issue by shipping with macos binaries.

SolbiatiAlessandro commented 3 years ago

the issue looks like not fixed for me, I added this line on my project.clj on MacOS 10.15.6

[uncomplicate/neanderthal "0.38.0"]

And got error

Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:11.0.0 in central (https://repo1.maven.org/maven2/) Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:11.0.0 in clojars (https://repo.clojars.org/) Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:11.0.0 in central (https://repo1.maven.org/maven2/) Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:11.0.0 in clojars (https://repo.clojars.org/)

This fix (mentioned above) works for me

[uncomplicate/neanderthal "0.38.0" :exclusions [org.jcuda/jcuda-natives, org.jcuda/jcublas-natives]]

Btw if you google that error you get 0 results so I hope this comment will make this thread appear for future reference

blueberry commented 3 years ago

@SolbiatiAlessandro This had been fixed by providing JCuda for macOS, but recently Nvidia stopped publishing CUDA for macOS at all, so the issue re-surfaced. I've added proper example to Hello World. These exclusions have to be specified in user projects, unfortunately.