深度学习环境平台配置
一、 安装NVIDIA显卡驱动
1) 禁止系统使用默认的驱动
sudo gedit /etc/modprobe.d/blacklist.conf
在文件的最后添加
blacklist nouveau options
nouveau modeset=0
安装驱动方法一:
首先去官网查看下载对应版本的显卡驱动(http://www.nvidia.com/Download/index.aspx?lang=en-us)
2) crl+alt+F1进入字符界面,关闭图形界面(crl+alt+F7回到图形界面)
sudo service lightdm stop
sudo chmod 755 NVIDIA-Linux-x86_64-378.13.run
sudo ./ NVIDIA-Linux-x86_64-378.13.run
3) 安装完成后,开启图形界面
sudo service lightdm start
安装驱动方法二:
直接在Ubuntu16.04附加驱动(AdditionalDriver)里下载相应的NVIDIA驱动安装。(可代替上述步骤2,3)
4) 然后关机重启,验证安装是否完成
nvidia-smi或 nvidia-settings
二、 安装CUDA8.0
1) 下载完 cuda8.0后,执行如下语句,运行 runfile 文件:
sudo chmod 777 cuda_8.0.61_375.26_linux.run
sudo ./cuda_8.0.61_375.26_linux.run
执行后会有一系列提示让你确认,但是注意,有个让你选择是否安装 nvidia375驱动时,一定要选择否,因为前面我们已经安装了更加新的 nvidia378,所以这里不要选择安装。其余的都直接默认或者选择是即可。 安装成功后会出现如下界面:
=========== = Summary = =========== Driver: Not Selected Toolkit: Installed in /usr/local/cuda-8.0 Samples: Installed in /home/textminer Please make sure that – PATH includes /usr/local/cuda-8.0/bin – LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64, or, add /usr/local/cuda-8.0/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda- 8.0/doc/pdf for detailed information on setting up CUDA. ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 361.00 is required for CUDA 8.0 functionality to work. To install the driver using this installer, run the following command, replacing with the name of this run file: sudo .run -silent -driver Logfile is /opt/temp//cuda_install_6583.log |
2) 安装完毕后,再声明一下环境变量,并将其写入到 ~/.bashrc的尾部
sudo gedit ~/.bashrc
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
3) 然后设置环境变量和动态链接库,在命令行输入
sudo gedit /etc/profile
在打开的文件末尾加入:
export PATH=/usr/local/cuda/bin:$PATH