Ubuntu16.04安装CUDA10.0和CUDNN7.6.3

软件包链接:

链接:https://pan.baidu.com/s/1hyk0Osjz2m3gsCwsoFqZMg 
提取码:2rtb 

(1) 安装CUDA10.0

切换到安装文件所在的目录:

cd cuda_cudnn_packages/

修改安装文件的权限:

sudo chmod a+x cuda_10.0.130_410.48_linux.run

安装 CUDA:

sudo ./cuda_10.0.130_410.48_linux.run

回答问题:
–更多–(0%)

q
Do you accept the previously......				accept
Install NVIDIA Accelerated......					n
Install the CUDA 10.0 Toolkit......				y
Enter Toolkit Location......						Enter(回车)
Do you want to install a symbolic......		y
Install the CUDA 10.0 Samples......			y
Enter CUDA Samples Location......			Enter(回车)

安装完成后,添加环境变量:(注意!别漏掉复制第二条命令后面的内容)

sudo sed -i '$a\export PATH=/usr/local/cuda-10.0/bin:$PATH' /etc/profile
sudo sed -i '$a\export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH' /etc/profile

使修改生效:

source /etc/profile

(2)安装CUDNN7.6.3

解压缩cudnn-10.0-linux-x64-v7.6.3.30.tgz

tar -xzvf cudnn-10.0-linux-x64-v7.6.3.30.tgz

将解压缩后得到的文件拷贝到cuda-10.0/lib64和cuda-10.0/include下

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.h | grep CUDNN_MAJOR -A 2

你可能感兴趣的:(软件部署,ubuntu,cuda)