The mismatching is version is likely caused by the fact that you have multiple WSL setup on your system. And when typing “wsl cat /proc/version” the default one will be used to run the command which might be different from the one you used to run WSL2. You can check that by running wsl -l and see which one is used by default.
When you installed the CUDA Toolkit check that you have not installed the native driver as well (that driver will shadow the WSL driver and will be picked instead). This is an easy mistake to make if you used the .deb file (the CUDA one will install the native driver as well). You will find couple of forum post on that topic (and various way to get back to a good state).
If you still have an issue after that could you post here a dxdiag log (run dxdiag on your windows machine and you will find a button on the GUI to save the logs) and we can look at it.
Hi Thanks for the answer, I have uninstalled Wsl 1 distro and now the wsl command shows the correct version as well.
But I still have the CUDA issue. I followed exactly the steps mentioned on nvidia site to just install the toolkit. I am not sure if the linux drivers got installed with it? How can I check this?
I have attached dxdiag output DxDiag.txt (117.1 KB)
Reading package lists… Done
Building dependency tree
Reading state information… Done
cuda-toolkit-11-0 is already the newest version (11.0.3-1).
The following packages were automatically installed and are no longer required:
bridge-utils dns-root-data dnsmasq-base libidn11 ubuntu-fan
Use ‘apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
I have the same problem.
./BlackScholes
[./BlackScholes] - Starting…
CUDA error at …/…/common/inc/helper_cuda.h:777 code=35(cudaErrorInsufficientDriver) “cudaGetDeviceCount(&device_count)”
Assuming you are on WSL2 (we don’t support WSL1) this is usually caused by the wrong display driver being installed. This usually happens if instead of just installing the toolkit package a packages that has a dependency on the native linux driver was installed as well.
You should be able to purge that from your package manager (sudo apt --purge followed by the nvidia-driver that got installed) but the process might be a bit tricky.
A quick way to verify that this is what is happening is by checking which CUDA driver is getting used:
The WSL drivers are in /usr/lib/wsl/…
Run strace on your binary and look in the logs for libcuda, if it comes from a different place than /usr/lib/wsl/… (or one of the subfolders) the wrong driver is being used.
I had the same issue and it was resolved by updating to the latest insider build. It is not enough to have the later WSL2 version. You also need the insider build and beta is not enough.
My issue is likely that I am on Windows Version 19041.508 and not 20145 or later like the guide suggests. I guess I have to either wait (I think I will) or run a scary beta version of Windows which I am not ready to do.
I have the same error:
[/usr/local/cuda/samples/4_Finance/BlackScholes/BlackScholes] - Starting…
CUDA error at …/…/common/inc/helper_cuda.h:777 code=35(cudaErrorInsufficientDriver) “cudaGetDeviceCount(&device_count)”
I guess it is using an old driver version and not the proper one.
For all the guys meeting this error
CUDA error at …/…/common/inc/helper_cuda.h:777 code=35(cudaErrorInsufficientDriver) “cudaGetDeviceCount(&device_count)”
Here is my solution
check whether you have followed the instructions in Doc strictly.
If you have installed WSL distro before, most of the time you cannot update it to WSL2 directly (I tried many times all fail).
What you need to do is uninstalling the WSL distro and installing the WSL2 distro.
For example, I have installed Ubuntu20.04 one month ago and it was WSL. And now what I am going to do is uninstalling that distro, install WSL2 from the Microsoft website (download the package and install directly), and then install Ubuntu-20.04/18.04/…
You can use wsl -l -v in your PowerShell to check whether your distro is using WSL2
!!! If necessary backup your important files, backup what you have installed in the previous distro. (I make installed packages and software into a txt file(names))!!!
Windows insider part, and make it dev mode.
Updating may take a long time. From my side, it took about 20 mins.
If you do not have /usr/lib/wsl folder in your WSL2 Ubuntu, it means you fail in installing the windows insider step.(I do not have this folder before installing Windows insider successfully)
if you succeeded in the steps above, do [sudo make clean] under /usr/local/lib/cuda/sample/4_finance/black-whateversomething and recompile the file (sudo make).