ubuntu16.04 CUDA, CUDNN 安装
这次介绍的是使用 tensorflow1.8, cuda9.0, cudnn7.0的版本
- https://developer.nvidia.com/cuda-90-download-archive 下载相应的cuda,推荐使用deb进行安装
sudo dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb
sudo apt-key add /var/cuda-9-0-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
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 /usr/local/cuda/lib64/libcudnn*
- 配置环境变量,在~/.bashrc当中加入下面两句
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64$LD_LIBRARY_PATH
- 安装tensorfloww-gpu,还有nvidia库完事
sudo apt-get install nvidia-cuda-toolkit
pip install tensorflow-gpu