1.更新到合适的源(否则下载会很慢)
在系统设置中找到software&updates, 然后如果在国内的话,选择国内的源(例如中科大等)。
2. apt-get update(否则很多软件无法安装更新)
apt-get upgrade(强烈建议执行,1. 不安装的话可能运行会有问题,例如卡顿等;2. 如果安装好驱动后在upgrade则可能会导致驱动被修改,驱动被修改后重装cuda即可)
3. 安装openssh(否则图形界面甚至tty无法运行,没法进入系统)
sudo apt-get install openssh-server
4.查看环境信息,与参考3的文档比对是否符合版本要求。
gcc版本:gcc --version(Ubuntu16.04自带的5.4版本也可以)
glibc版本:ldd --version
5. 关闭图形界面(见参考4)
另外如果开启的话,可以
首先设置:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
sudo update-grub
然后
sudo systemctl set-default graphical.target
6. 屏蔽掉Nouveau(参考6)
7. 可以直接利用cuda8进行安装(建议用cuda安装,可以有多个选项,如果先装驱动在装cuda,之前安装并未成功)
注意:(1)如果电脑本来的显卡不是NVIDIA的,则安装OpenGL时选择no。
8. 配置x.conf
由于Ubuntu16.04没有x.conf,因此可以考虑在/etc/X11/下简历x.conf文件,然后运行nvidia-xconfig即可
9. 安装后可以按照步骤5开启图形界面
注意:如果开启图形界面后一直重启,但guest账户可以进入则参考5
参考:
1.官方驱动安装说明:
NVIDIA Accelerated Linux Graphics Driver README and Installation Guide http://cn.download.nvidia.com/XFree86/Linux-x86/367.35/README/index.html
2. 官方的各个版本的cuda:
CUDA Toolkit Archive | NVIDIA Developer https://developer.nvidia.com/cuda-toolkit-archive
3. 官方的CUDA_Installation_Guide_Linux.pdf
4. 关闭图形界面参考资料
boot - Change runlevel on 16.04? - Ask Ubuntu http://askubuntu.com/questions/788323/change-runlevel-on-16-04
http://askubuntu.com/questions/16371/how-do-i-disable-x-at-boot-time-so-that-the-system-boots-in-text-mode
5. 解决 Ubuntu15.04 登陆界面无限循环 的问题_Linux_第七城市 http://www.th7.cn/system/lin/201506/108394.shtml
6. 基于Ubuntu14.04系统的nvidia tesla K40驱动和cuda 7.5安装笔记 - 飞翔的蜘蛛人 - 博客园 http://www.cnblogs.com/muchong/p/6093328.html
7. CUDA GPUs | NVIDIA Developer https://developer.nvidia.com/cuda-gpus