WSL: CUDA throw cudaErrorInsufficientDriver error on WSL Debian

Environment

Windows build number: 10.0.20236.0
Your Distribution version: Debian GNU/Linux 10 (buster)
Whether the issue is on WSL 2 and/or WSL 1: Linux version 4.4.0-20236-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1000-Microsoft Thu Oct 09 16:31:00 PST 2020
apt-cache show cuda-toolkit-11-1
Package: cuda-toolkit-11-1
Version: 11.1.0-1
Architecture: amd64
Maintainer: cudatools <cudatools@nvidia.com>
Installed-Size: 9
Depends: cuda-compiler-11-1 (>= 11.1.0), cuda-libraries-11-1 (>= 11.1.0), cuda-libraries-dev-11-1 (>= 11.1.0), cuda-tools-11-1 (>= 11.1.0), cuda-documentation-11-1 (>= 11.1.74), cuda-nvml-dev-11-1 (>= 11.1.74), cuda-samples-11-1 (>= 11.1.74)
Section: multiverse/devel
Priority: optional
Filename: ./cuda-toolkit-11-1_11.1.0-1_amd64.deb
Size: 2714
MD5sum: ea74dd0c079f713647212c7fc0d6c4ae
SHA1: 735f4f1b5afec6573868eaa38f282f8232a1d072
SHA256: 3086bea82acf44456616f48f8c331e263a57e661575baf81c4188975f545d821
SHA512: 5931d68f6113cf41da1ce65be2c7982cb148d6ba05539428e48e30cf0543577ae2fd9a3884f2bcaa0f551cd989bcc1b19770bcfb3e8eefdf3bb70e032e13ea20
Description: CUDA Toolkit 11.1 meta-package
 Meta-package containing all the available toolkit packages related to native
 CUDA development. Contains the toolkit, samples, and documentation.
 Locked at CUDA Toolkit version 11.1.
Description-md5: 80ca7885ea0a8d7e6b148204e2558cab

Steps to reproduce

Download nvdia driver from https://developer.nvidia.com/cuda/wsl/download and get 460.20_gameready_win10-dch_64bit_international

Following steps in https://docs.nvidia.com/cuda/wsl-user-guide/index.html and install cuda-tookit by sudo apt install cuda-toolkit-11-1

cd /usr/local/cuda/samples/4_Finance/BlackScholes
make
./BlackScholes

then get the error.

Pytorch also fail with cuda

In [2]: torch.cuda.is_available()
Out[2]: False

WSL logs: feedback logs

Expected behavior

the example cuda program works.

Actual behavior

[./BlackScholes] - Starting...
CUDA error at ../../common/inc/helper_cuda.h:779 code=35(cudaErrorInsufficientDriver) "cudaGetDeviceCount(&device_count)"

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 18
  • Comments: 17 (1 by maintainers)

Most upvoted comments

+1 yep same problem, anyone have any luck solving? I had this working on WSL2-Ubuntu-20.04 but no luck on WSL2-Debian

That is strange, I cannot get it to work on ubuntu 20.04. What version of windows are you using ?

Migrate to Ubuntu 20.04 for CUDA too. Maybe there is a problem with debian distro.

What do you mean by “Migrate to Ubuntu 20.04 for CUDA” ? I have installed Ubuntu 20.04 LTS via the microsoft play store and before that installed the nvidia drivers as mentioned here: https://docs.nvidia.com/cuda/wsl-user-guide/index.html

Am I missing something ?

MAKE SURE your windows is in insider dev channel or winver > 20150 as menstioned in document

  1. Install Ubuntu 20.04 from windows store
  2. Make sure you have installed cuda driver for wsl on windows.
  3. Set your default wsl to ubuntu
  4. pip install tensorflow and enjoy it with cuda.