style 進行 apt tdm .bashrc upd pda pkg library

Ubuntu 安裝顯卡驅動

查看顯卡硬件信息

lspci | grep -i Nvidia

lspci | grep -i vga

查看驅動版本信息

nvidia-smi

P1: You appear to be running an X server; please exit X before installing.

Sudo service lightdm stop

P2: distribution-provided pre-install script failed ubuntu

不必理會,繼續安裝;

P3:the nouveau kernel driver is currently in use by your system

https://askubuntu.com/questions/841876/how-to-disable-nouveau-kernel-driver

安裝cuda8在線安裝

https://developer.nvidia.com/cuda-downloads

  1. `sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb`
  2. `sudo apt-get update`
  3. `sudo apt-get install cuda`

大約2小時2GB

配置環境變量

export PATH=/usr/local/cuda/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

添加到~/.bashrc文件

source activate

查看cuda版本

nvcc -V

安裝cudnn

tar -zxvf cudnn-7.0-linux-x64-v3.0-prod.tgz

sudo cp cuDNN/cuda/include/cudnn.h /usr/local/cuda/include

sudo cp cuDNN/cuda/lib64/* /usr/local/cuda/lib64/

#下面的操作在/usr/local/cuda/lib64/目錄下進行

sudo rm -rf libcudnn.so libcudnn.so.7.0#刪除兩個符號鏈接;

sudo ln -s libcudnn.so.7.0.64 libcudnn.so.7.0

sudo ln -s libcudnn.so.7.0 libcudnn.so

Ubuntu安裝顯卡驅動+cuda8+cudnn