Help installing Nvidia CUDA on WSL2

I'm trying to follow this guide but it's not working.

System requirements met:

cat /proc/version
Linux version 5.4.72-microsoft-standard-WSL2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Oct 28 23:40:43 UTC 2020

On the windows side, installed the latest version:

Installed cuda toolkit per instructions:

sudo apt-get install cuda-toolkit-11-2

Attempting to run BlackScholes example:

cd /usr/local/cuda/samples/4_Finance/BlackScholes
sudo make
./BlackScholes
[./BlackScholes] - Starting...
CUDA error at ../../common/inc/helper_cuda.h:779 code=100(cudaErrorNoDevice) "cudaGetDeviceCount(&device_count)"

Nvidia-smi:

nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

What's wrong?

1

1 Answer

I have been having similar issues and I had to make sure that my Windows 10 Pro Insider Preview was set to Dev option. I had set this to Beta, and that is incorrect.

I then found this guide, which was very helpful:

Then this guide, which got the toolkits to work:

I also read somewhere, that I cannot find now, that Cuda Toolkit 11-0 & 10-2 is what you need. Apparently 11-2 does not work.

I spent about 3 weeks trying to figure all this out for myself, and I hope it proves useful for you.

EDIT: I still cannot get Docker to work, but the GPU is being read and used by TensorFlow, and nvidia-smi works.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like