cuda error encountered by wsl2

CUDA ERROR encountered by WSL2

  1. First, check the driver. It may be that the driver version is too old. Install the latest version of the driver on the Windows system. The address is here , and then run your cuda case. Normally, no error will be reported.
  2. If it is not a program error, but a CUDA calculation error (I have not searched for this problem), I later found out that the CUDA Runtime was installed incorrectly. Please refer to the official address of wsl2-cuda here .In fact, you can’t find the cuda-xxx.run file to install, choose the deb (local) installation method. Here is an example:
    insert image description here
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda-repo-wsl-ubuntu-11-1-local_11.1.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-1-local_11.1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-1-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

Guess you like

Origin blog.csdn.net/qq_41776453/article/details/129682574