I have been trying for several days to get CUDA on Windows Subsystem for Linux 2 working and I think this is my last roadblock.
When I test this:
sudo docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
I get this output:
docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].
In Ubuntu
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.
In powershell nvidia-smi
±----------------------------------------------------------------------------+
| NVIDIA-SMI 455.41 Driver Version: 455.41 CUDA Version: 11.1 |
|-------------------------------±---------------------±---------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 2080 WDDM | 00000000:01:00.0 On | N/A |
| N/A 36C P8 8W / N/A | 850MiB / 8192MiB | 3% Default |
±------------------------------±---------------------±---------------------+
I am running
6/17/2020: Initial Version.
(This driver is 3 days old)
The following software versions are supported with this preview release for WSL 2:
- NVIDIA Driver for Windows 10: 455.38
- NVIDIA Container Toolkit: nvidia-docker2 (2.3) and libnvidia-container (1.2.0-rc.1)
Install the driver using the executable. This is the only driver you need to install.
Note: Do not install any Linux display driver in WSL. The Windows Display Driver will install both the regular driver components for native Windows and for WSL support.
Windows 10, Version 2004 (OS Build 20150.1000)
WSL2
Ubuntu-18.04
Linux version 4.19.121-microsoft-WSL2-standard
Docker 19.03.6
I have tried basically everything I could find to fix this with no luck. I have even started over from scratch with Ubuntu and end up at the same place.
This probably the best reference I have found and it is also only 3 days old.
sudo sh NVIDIA-Linux-x86_64-440.82.run
sudo apt install nvidia-settings
sudo apt install cuda-drivers
sudo sh cuda_11.0.1_450.36.06_linux.run
sudo apt install nvidia-cuda-toolkit
sudo apt-get install nvidia-driver-440
sudo apt-get install cuda
and many more…
In addition to DirectX and CUDA support, NVIDIA is also adding support for the NVIDIA Container Toolkit (previously nvidia-docker2) within WSL 2