首先,检查是否安装了CUDA:ls -l /usr/local | grep cuda
http:// https://developer.nvidia.com/cuda-toolkit-archive 如下截图, 选择自己系统对应的 CUDA
版本,
若第1步提示Existing package manager installation of the driver found. It is strongly recommended that you remove this before continuing.,选择continue,继续操作
Do you accept the above EULA? (accept/decline/quit):
│ accept #输入accept
│─────────────────────────────────────────────────────
#安装选项,由于我已经安装有Driver: 535.54.03,所以没有选择。
│ CUDA Installer
│ - [ ] Driver
│ [ ] 535.54.03
│ + [X] CUDA Toolkit 10.2
│ [ ] CUDA Samples 10.2
│ [ ] CUDA Demo Suite 10.2
│ [ ] CUDA Documentation 10.2
│ Options
│ Install #[ ]不选择,带X的是需要安装的部分,之后选择 Install
————————————————
安装好后显示
可以看到 /usr/local/
目录下已经有 cuda -> /usr/local/cuda-10.2//
软链接。
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64
cuDNN的安装与检测
3.1. cuDNN的安装
从NVIDIA官网的cudnn下载页面上下载与安装CUDA对应的cudnn,网址为Log in | NVIDIA Developer。选择Ubuntu2
cudnn–linux-x86_64-8.8.0.121_cuda12-archive.tar.xz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
参考:https://blog.csdn.net/wohu1104/article/details/107041387
原文地址:https://blog.csdn.net/huaooo1/article/details/134784850
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_42044.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!