-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting neanderthal to run in the Windows Subsystem for Linux 2 #130
Comments
Thanks! |
Issue can be closed. Neanderthal on WSL seems to work for native and cuda, but not opencl. And that seems to be what to expect from WSL2 at the moment (microsoft/WSL#6951). Matches what I see when I run lein test on neanderthal's repository, there are three test files that fail (clblast_test.clj, clblast_cpu_test.clj, and tutorial_opencl_test.clj.fail). If I disable those tests, lein test completes. One exception, that might be worth looking in: I have this error popping up a dozen of times:
For those without a linux environment, a plus from running neanderthal in WSL is that it is easy to install a system-wide MKL, and that [org.bytedeco/mkl-platform-redist "2022.0-1.5.7"] works. Both of those currently are non-trivial to get to work when staying in windows. |
This is a little bit a duplicate from the issues #119 and #127, but as I don't seem to run into any trouble getting neanderthal to run on the WSL2, with support of CUDA, it seems worth posting it as a separate issue with a clear title.
Using sublime text as an IDA and the Terminus / Clojure Sublimed packages, I can start a WSL as a terminal, and connect Clojure Sublimed to a clj -M:repl nrepl I start in that terminal. After that, everything is smooth sailing.
These are the steps I took to get neanderthal to run on the WSL. Nothing exotic.
Neanderthal on the WSL2
install WSL & Ubuntu
Go to /users/ and make a file called .wslconfig, and add (and adapt to your system) the following text into the file
Else your WSL only gets access to 6GB of memory or so.
install MKL and clojure in Ubuntu
sudo apt-get update
sudo apt-get install intel-mkl
choose the default in the install screen (libmkl_rt is not the default alternative to BLAS/LAPACK)
sudo apt-get install clojure
As installing clojure in this way doesn't get you the clojure tools ('clj'), I am also installing clojure through homebrew, just minus the 1 million dependencies.
sudo apt-get install build-essential
execute /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
execute eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
nano ~/.bashrc and paste eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" as the top line
run brew install --ignore-dependencies clojure
brew will install clojure for you with the clojure tools (clj). And the ignore dependencies saves you from a ton of weird stuff being installed
sudo apt-get install leiningen
Testing in hello_world of neanderthal
and see that neanderthal native.clj works.
Getting the GPU to work.
GPU won't work yet in the above setting (native will). There is a large block of text available here explaining some of the below steps:
https://docs.nvidia.com/cuda/wsl-user-guide/index.html
From the article, and within WSL
The article uses CUDA 12-0 as an example. Neanderthal uses 11.7.0
Note, that if you look up the syntax to install other packages than 11.7.0 on https://developer.nvidia.com/cuda-downloads?, it will almost give you the correct syntax, just not the last line - the article on how to install cude and wsl specifically warns against that, but it is easy to miss.
So in our case , make sure to do:
8. sudo apt-get install cuda-toolkit-11-7
That is enough to get hello_world running on the wsl (both native and cuda.)
9. navigate to examples/hello_world.
10. do a lein repl in the examples/hello_world directory (in WSL!, not in powershell)
11. (load-file "src/hello_world/native.clj")
12. (load-file "src/hello_world/cuda.clj")
and see that neanderthal native.clj and cuda.clj works :-)
The text was updated successfully, but these errors were encountered: