注意:驱动版本并不需要最高版本,以避免cuda版本与tensorflow版本不匹配问题.
配置:x99-WS华硕,titan-Xp,[email protected] .1t固态,ubuntu16.04.5 64位
1,安装中文输入法:
sudo apt-get install vim fcitx
安装fcitx后需要重启系统后,才能设置中文pinin输入法
2,修改配置: sudo vim /etc/modprobe.d/blacklist.conf
在文件尾部加入:blacklist nouveau
保存,退出
3,更新 :sudo update-initramfs -u
4,重启 :reboot
5,重启后.按ctrl + alt +F1,进入控制台
6,sudo service lightdm stop
7.安装32位兼容库:
apt-get install lib32ncurses5 lib32z1
8,安装nvidia的驱动,sudo ./NVIDIA-Linux-x86_64-390.48.run -no-opengl-files
一定别忘了把-no-opengl-files加上
9.重启系统:reboot 或 sudo service lightdm start
以上我们是自己安装的NVIDIA驱动程序,版本是390.48,安装起来比较麻烦,其实,最好是用系统自带的安装方式:
在system settings中,software & updates 中 Addition Drivers中安装版本是384.130,经过验证,他正好与我们后面安装的conda9.0的版本是匹配的!所以,最好还是尽可能用系统自带的384.130!!
10, install cuda9.0
sudo ./cuda_9.0.176_384.81_linux.run
sudo ./cuda_9.0.176.1_linux.run
sudo ./cuda_9.0.176.2_linux.run
sudo ./cuda_9.0.176.3_linux.run
sudo ./cuda_9.0.176.4_linux.run
添加环境变量:
vi .bashrc
export PATH=/usr/local/cuda-9.0/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
测试环境:test:
cd samples/1_Utilities/deviceQuery
make
sudo ./devdeviceQuery
11,install cudnn7.1.4
sudo dpkg -i libcudnn7_7.1.4.18-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.1.4.18-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-doc_7.1.4.18-1+cuda9.0_amd64.deb
测试:参见:https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-linux
- Copy the cuDNN sample to a writable path.
$cp -r /usr/src/cudnn_samples_v7/ $HOME
- Go to the writable path.
$ cd $HOME/cudnn_samples_v7/mnistCUDNN
- Compile the mnistCUDNN sample.
$make clean && make
- Run the mnistCUDNN sample.
$ ./mnistCUDNN
If cuDNN is properly installed and running on your Linux system, you will see a message similar to the following:Test passed!
12 summerize:
driver=390.48
cuda=9.0 + patch1,2,3,4
cudnn7=7.1.4