ubuntu16.04安装cuda8.0+cudnn6.0

cuda8.0安装:

1、依赖:

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

2、下载cuda:https://developer.nvidia.com/cuda-80-ga2-download-archive

ubuntu16.04安装cuda8.0+cudnn6.0_第1张图片 

sudo chmod 777 cuda_8.0.44_linux.run 
sudo ./cuda_8.0.44_linux.run

按住空格键加载;

除了这一项:Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?为no,其他都是yes或accpet或默认

最后的结果是

ubuntu16.04安装cuda8.0+cudnn6.0_第2张图片

没有问题

3、环境配置

sudo gedit ~/.bashrc

 

export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

 4、验证

cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery 
sudo make 
sudo ./deviceQuery

 

CUDNN6 安装

https://developer.nvidia.com/rdp/cudnn-archive

ubuntu16.04安装cuda8.0+cudnn6.0_第3张图片

tar -zxvf cudnn-8.0-linux-x64-v6.0.tgz 
cd cuda/include
sudo cp cudnn.h /usr/local/cuda/include
cd ..
cd lib64/
sudo cp lib* /usr/local/cuda/lib64/
cd /usr/local/cuda/lib64/
sudo rm -rf libcudnn.so libcudnn.so.6
sudo ln -s libcudnn.so.6.0.21 libcudnn.so.6
sudo ln -s libcudnn.so.6 libcudnn.so
sudo ldconfig

 其中sudo ln -s libcudnn.so.6.0.21 libcudnn.so.6这个命令,现在路径下ls查看版本号。

验证

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

 

你可能感兴趣的:(ubuntu16.04安装cuda8.0+cudnn6.0)