欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

cuda10.1,cudnn7.6.5安装

程序员文章站 2022-05-27 14:41:48
...

cuda10.1,cudnn7.6.5安装

cuda10.1安装
1.下载
终端输入

wget http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run

2.安装

sudo sh cuda_10.1.243_418.87.00_linux.run

3.添加环境
打开文件:sudo gedit ~/.bashrc
打开时如果是空文件就在主目录下:Ctrl+h
添加:

#added by cuda10.1 installer
export CUDA_HOME=/usr/local/cuda 
export PATH=$PATH:$CUDA_HOME/bin 
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

再终端输入:source ~/.bashrc
4.验证
终端输入:nvcc -V

cudnn7.6.5安装

tar -zxvf cudnn-10.1-linux-x64-v7.6.5.32.tgz
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 
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*

验证:
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

相关标签: 深度学习