'libcuda.so.1' not being looked for in '/usr/lib/wsl/lib' as shown in strace output of 'deviceQuery'

Several versions of Windows Insider Preview and NVIDIA’s preview drivers ago I tried CUDA support on WSL 2 and it worked fine on my machine with a 2080 Ti GPU. Recently I started to work on CUDA (on Linux) again and revisited this setup (after everything updated) only to find that PyTorch can no longer pick up the GPU as torch.cuda.is_available() returns False. I then started to perform some further inspections.

I reinstalled the preview driver (the latest version 465.42 cannot work even on Windows as nvidia-smi failed to read GPU information so I tried 465.12, 460.20 and 460.15) using downloaded installers and cuda-toolkit-11-0 using apt (uninstall everything and then install) but still all CUDA program I tried failed to run. I noticed it’s a common problem on this site that the deviceQuery sample provided in the CUDA Toolkit returns code 35 and I’m getting the same error:

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

But according to diagnositic procedures given on those threads, most parts of my setup seems to be fine. I am using Dev channel Insider Preview version of Windows, am using the latest kernel, have the 3D controller item in lspci output, did not install drivers inside Linux, and have those files in places like C:\Windows\System32\lxss\lib, /usr/lib/wsl/lib and /dev/dxg.

The only curious thing is that, as shown in strace output of deviceQuery, libcuda.so.1 is being looked for in places like /usr/lib/tls/x86_64, /usr/lib/tls/haswell, /lib/tlsor /usr/lib/x86_64-linux-gnu instead of /usr/lib/wsl/lib, with or without CUDA Toolkit installed. I did not see similar behaviors in strace output provided by other users with correct driver settings. Is this another driver installation issue you didn’t mention in previous threads? I installed CUDA Toolkit using sudo apt install -y cuda-toolkit-11-0 so no driver should be installed inside Linux.

I ran out of ideas and really hope someone can help me get this problem solved. Thanks in advance!

I’m also experiencing the same issue, and I also tried installing cuda toolkit via executing cuda*.run, but it was in vain. (CUDA Toolkit 11.2 Update 1 Downloads | NVIDIA Developer)