I followed the guide to setup CUDA in WSL2 until the particular recomendations for WSL-Ubuntu:
wget https://developer.download.nvidia.com/compute/cuda/11.4.1/local_installers/cuda_11.4.1_470.57.02_linux.run sudo sh cuda_11.4.1_470.57.02_linux.run
This does not complete the installation and I get the following in the nvidia-installer.log:
... WARNING: You do not appear to have an NVIDIA GPU supported by the 470.57.02 NVIDIA Linux graphics driver installed in this system. For further details, please see the appendix SUPPORTED NVIDIA GRAPHICS CHIPS in the README available on the Linux driver download page at www.nvidia.com. -> Installing NVIDIA driver version 470.57.02. ... ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.
Apparently my GPU is not supported by the CUDA driver suggested by the guide or the CUDA Toolkit 11.4 Update 1 for Ubuntu; both point to the 470.57.02 driver currently (deb installers failled with different error when trying to run the first example in the CUDA in WSL guide).
BUT if I check that version in the display driver webpage, my GTX 1650 Ti appears as supported:
I am not sure if the cuda and the display drivers are supposed to be the same, but I am guessing they might do different things. I do not understand the problem though.
I tried to download directly the latest display driver, 470.63.01, which also lists the GTX 1650 Ti as supported, but it does not run (maybe due to WSL2?):
Could someone provide some help please?
P.D. My GPU works fine with CUDA in Windows, but I need WSL because I intend to use it with a python library (JAX) that only supports Linux.
Here is some WSL info:
$ wsl cat /proc/version Linux version 18.104.22.168-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 22.214.171.12400220) #1 SMP Fri Apr 2 22:23:49 UTC 2021