【ubuntu】22.04安装CUDA和CUDNN

一、CUDA安装方法

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#pre-installation-actions

1、使用二进制

https://developer.nvidia.com/cuda-12-1-0-download-archive

# Installation Instructions:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda-repo-ubuntu2204-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

 

2、通用方法

 

二、 安装CUDNN

1、官方链接

https://developer.nvidia.com/cudnn-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local

 2、在线网络安装

 

 

 三、验证

1、验证CUDA

 

2、验证cudnn

 

 

 

参考链接:

https://blog.csdn.net/zxdd2018/article/details/127705627

https://blog.csdn.net/weixin_44159487/article/details/103364034

https://zhuanlan.zhihu.com/p/658392929

posted @ 2024-05-20 20:12  代码诠释的世界  阅读(2154)  评论(0编辑  收藏  举报