ubuntu16.04+ cuda9.0+cudnn7.0 卸载cuda,cudnn以及查看版本号

ubuntu 卸载cuda
在命令行中输入

sudo apt-get remove cuda

sudo apt-get autoclean

sudo apt-get remove cuda*

然后在目录切换到 cd /usr/local/
~$:sudo rm -r cuda-<版本号>
卸载cudnn
sudo rm -rf /usr/local/cuda/include/cudnn.h
sudo rm -rf /usr/local/cuda/lib64/libcudnn
查看cuda版本
cat /usr/local/cuda/version.txt
查看cudnn版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
.装cuda9.0deb文件
https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal

`sudo dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb`
`sudo apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub`
`sudo apt-get update`
`sudo apt-get install cuda`

8.0

`sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb`
`sudo apt-get update`
`sudo apt-get install cuda`

5.reboot后添加环境变量
sudo gedit ~/.bashrc
最后末尾写入:
export PATH=/usr/local/cuda-9.0/binKaTeX parse error: Expected '}', got 'EOF' at end of input: {PATH:+:{PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64KaTeX parse error: Expected '}', got 'EOF' at end of input: …LIBRARY_PATH:+:{LD_LIBRARY_PATH}}
保存一下:
source ~/.bashrc
6.测试cuda:参考网址一
7.cudnn安装
http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html
tar -xzvf cudnn-9.0-linux-x64-v7.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*
ubuntu16.04+cuda9.0+opencv2.4.13.6
https://blog.csdn.net/zhuangwu116/article/details/81136117

你可能感兴趣的:(系统配置)