WSL安装CUDA

安装命令

  1. 删除旧的GPG key
sudo apt-key del 7fa2af80
  1. 安装
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.7.0/local_installers/cuda-repo-wsl-ubuntu-11-7-local_11.7.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-7-local_11.7.0-1_amd64.deb
sudo apt-get update
sudo apt-get -y install cuda

安装过程中遇到的问题及解决办法

  1. public key is not available
$ sudo apt-get update
Get:1 file:/var/cuda-repo-wsl-ubuntu-11-7-local  InRelease [1575 B]
Get:1 file:/var/cuda-repo-wsl-ubuntu-11-7-local  InRelease [1575 B]
Get:2 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease [1581 B]                                                 
Err:2 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease                                                          
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC

上面提示A4B469963BF863CC这个key没有,执行下面的命令即可解决

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC

参考

posted @ 2022-06-02 22:15  marsggbo  阅读(516)  评论(0编辑  收藏  举报