ubuntu16.04 CUDA, CUDNN 安裝

basasuya發表於2018-07-03

這次介紹的是使用 tensorflow1.8, cuda9.0, cudnn7.0的版本

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

相關文章