Error: CUDANoDevice on WSL

Dear Dr. Will , Prof Freddie,

Thank you for your replyng. I am done with calculating the test case on WSL with CUDA12.1
I leave notes for anybady who has as same errors as I got on WSL with CUDA 12.1.

  1. Installing the GPU driver in Windows automatically puts the driver in the WSL as well.
  2. When installing CUDA, WSL-Ubuntu distribution should be choosen; https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local
  3. After installed CUDA 12.1, make symbolic link of CUDA precompile file
    (shared object) in /usr/lib/wsl/lib into /usr/lib/x86_64-linux-gnu
    For example, wsl@username:/usr/lib/x86_64-linux-gnu$ sudo ln -s /usr/lib/wsl/lib/* ./

Best

Yuji

2 Likes