Windows10 WSL2 get error “cudaErrorInsufficientDriver”

System info:
Window10 1909(OS internal version 18363.1139)
NVIDIA GeForce RTX 2080

First, I install cuda driver with 460.20_gameready_win10-dch_64bit_international and get info as blow:

PS C:\Users\Neo> nvidia-smi.exe
±----------------------------------------------------------------------------+
| NVIDIA-SMI 460.20 Driver Version: 460.20 CUDA Version: 11.2 |
|-------------------------------±---------------------±---------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce RTX 2080 WDDM | 00000000:01:00.0 On | N/A |
| N/A 35C P8 5W / N/A | 919MiB / 8192MiB | 15% Default |
| | | N/A |
±------------------------------±---------------------±---------------------

Then I Install Linux subsystem

PS C:\Users\Neo> wsl --list --verbose
NAME STATE VERSION

  • Ubuntu-18.04 Running 2

PS C:\Users\Neo> wsl cat /proc/version
Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020

Third, I Install cuda on linux subsystem, but get error when I run the BlackScholes

wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run
sudo sh cuda_11.1.1_455.32.00_linux.run

root@DESKTOP-QRJOSER:/usr/local/cuda# ./bin/nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:09:46_PDT_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.TC455_06.29190527_0

root@DESKTOP-QRJOSER:/usr/local/cuda/samples/4_Finance/BlackScholes# ./BlackScholes
[./BlackScholes] - Starting…
CUDA error at …/…/common/inc/helper_cuda.h:779 code=35(cudaErrorInsufficientDriver) “cudaGetDeviceCount(&device_count)”

1 Like

For CUDA in WSL2 you need a Windows Insider build version 20145 or superior.

CUDA on WSL :: CUDA Toolkit Documentation (nvidia.com)

my win10 is 20246,but have the same problem

In that case you need to uninstall the CUDA driver inside WSL2. This can be tricky so I recommend to uninstall your distro and install again.
In a brand new distro install you only need the Windows driver installed. You will know the GPU is detected if the file /dev/dxg exists.

I am experiencing the same issue. I tried starting from scratch in WSL 2. Reinstalled Ubuntu and nvidia cuda drivers. I have windows insider (20H2 build 19042.685) + Latest nvidia drivers 465.21.

I have no idea where you are getting 20145 from. I selected Beta Channel for the windows insider.

You need to select dev channel, not beta channel.

1 Like

THANK YOU VERY MUCH! They didn’t make that clear and the Beta channel was noted as the Recommended choice so thought it would be the same.

This worked and should be addressed in the docs. Currently being in the beta ring puts you at a build higher than in the build shown in the install docs. The docs show that they are using 4.19.121 but currently the beta ring will put you at 4.19.128. Even at the newer build, it will not work. Switching to the dev ring does work.

Indeed all the docs should be self contained. I happened to stumble across these sources before switching to the insiders program, which tell you to join the Dev channel.

Even the windows docs make it unclear. Yes they do say dev channel but a couple of lines down they say:

“For this preview, you need a kernel version of 4.19.121 or higher. You can check the version number by running the following command in PowerShell”

Which at this point can be achieved by using the beta ring. I used the beta ring and had 4.19.128 and spent a day trying to figure out what the deal was until out of frustration I tried the dev channel. They should just take that out and say you need to be on dev. I guess this is what happens when you want to use preview tech.

Hello, I have the same problem too, but I am already in the dev chanel, any ideas on how I can fix this problem please.

Hello, the same thing is happening with me, can you tell me how you managed to fix the issue?