Ubuntu安装显卡驱动+cuda8+cudnn

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

 

tensorflow cuda error:Couldn't open CUDA library libcupti.so.8.0.

I have copied everything (3 .so files) from
/usr/local/cuda/extras/CUPTI/lib64/
to
/usr/local/cuda/lib64/

and it works

 

posted @ 2017-06-25 08:41  yizhichun  阅读(495)  评论(0编辑  收藏  举报