CUDA in WSL2 on Win10 1909 issues

I’ve followed the following guides

System Info

  • Titan RTX
  • Windows 10 1909 Build 18363.1049

wsl -l -v
NAME STATE VERSION
Ubuntu Running 2

wsl cat /proc/version
Linux version 4.19.121-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Fri Jun 19 21:06:10 UTC 2020

uname -a (in ubuntu)
Linux MINERVA 4.19.121-microsoft-standard #1 SMP Fri Jun 19 21:06:10 UTC 2020 x86_64 x86_64 x86_64
GNU/Linux

nvidia-smi (in windows)
NVIDIA-SMI 455.41 Driver Version: 455.41 CUDA Version: 11.1

ls /usr/lib/wsl/lib
ls: cannot access ‘/usr/lib/wsl/lib’: No such file or directory

cd /dev/dxg
No such file or directory

docker version
19.03.12

nvidia-container-cli -k -d /dev/tty info
I0821 16:21:57.950311 5686 nvc.c:282] initializing library context (version=1.3.0, build=af0220ff5c503d9ac6a1b5a491918229edbb37a4)
I0821 16:21:57.950354 5686 nvc.c:256] using root /
I0821 16:21:57.950358 5686 nvc.c:257] using ldcache /etc/ld.so.cache
I0821 16:21:57.950376 5686 nvc.c:258] using unprivileged user 1000:1000
I0821 16:21:57.950389 5686 nvc.c:299] attempting to load dxcore to see if we are running under Windows Subsystem for Linux (WSL)
I0821 16:21:57.950454 5686 nvc.c:301] dxcore initialization failed, continuing assuming a non-WSL environment
W0821 16:21:57.950514 5686 nvc.c:172] failed to detect NVIDIA devices
W0821 16:21:57.950641 5687 nvc.c:187] failed to set inheritable capabilities
W0821 16:21:57.950680 5687 nvc.c:188] skipping kernel modules load due to failure
I0821 16:21:57.950836 5688 driver.c:101] starting driver service
E0821 16:21:57.950966 5688 driver.c:161] could not start driver service: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory
I0821 16:21:57.951083 5686 driver.c:196] driver service terminated successfully
nvidia-container-cli: initialization error: driver error: failed to process request

./deviceQuery
cudaGetDeviceCount returned 35
→ CUDA driver version is insufficient for CUDA runtime version

docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused “process_linux.go:449: container init caused "process_linux.go:432: running prestart hook 0 caused \"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request\\n\""”: unknown.
ERRO[0000] error waiting for container: context canceled

dir C:\Windows\System32\lxss\lib /d/b
libcuda.so
libcuda.so.1
libcuda.so.1.1

I’ve tried wsl --shutdown and stopping and starting docker service multiple times. With no luck.

sudo dockerd (in a separate WSL2)
prints a bunch of stuff, idle at
INFO[2020-08-24T12:37:22.281116200+01:00] API listen on /var/run/docker.sock

Run sudo docker run --gpus all nvidia/cuda:10.0-base nvidia-smi from another instance
(printed in the first instance)
INFO[2020-08-24T12:37:32.822752100+01:00] shim containerd-shim started address=“/containerd-shim/moby/b3ec723d2f173142de37e4bae69f5c1158af505b5bf4f5739f4a7a87f402891e/shim.sock” debug=false pid=212
INFO[2020-08-24T12:37:32.883190600+01:00] shim reaped id=b3ec723d2f173142de37e4bae69f5c1158af505b5bf4f5739f4a7a87f402891e
ERRO[2020-08-24T12:37:32.893665900+01:00] stream copy error: reading from a closed fifo
ERRO[2020-08-24T12:37:32.893665900+01:00] stream copy error: reading from a closed fifo
ERRO[2020-08-24T12:37:33.069711600+01:00] b3ec723d2f173142de37e4bae69f5c1158af505b5bf4f5739f4a7a87f402891e cleanup: failed to delete container from containerd: no such container
ERRO[2020-08-24T12:37:33.069759000+01:00] Handler for POST /v1.40/containers/b3ec723d2f173142de37e4bae69f5c1158af505b5bf4f5739f4a7a87f402891e/start returned error: OCI runtime create failed: container_linux.go:349: starting container process caused “process_linux.go:449: container init caused "process_linux.go:432: running prestart hook 0 caused \"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request\\n\""”: unknown

“Ensure that you install Windows Build version 20145 or higher.”

It won’t work on your build 18363.1049
For CUDA support in WSL2 you will need to be an user of the Windows Insider Dev channel or just wait for the 21H1 Windows release next year.

1 Like