http://blog.csdn.net/shijiandehaizi/article/details/76946516
1 下载
选择对应版本的cuda
https://developer.nvidia.com/cuda-downloads
2 安装cuda
sudo /usr/bin/nvidia-uninstall(可选,如果之前安装过cuda,可以先卸载掉)
chmod +x cuda_xxx.run
sudo ./cuda_xxx.run
3 安装选项设置
刚开始显示描述文档,按下“q”键即可。
Do you accept the prevIoUsly read EULA?
accept/decline/quit: accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?
(y)es/(n)o/(q)uit: n (不要用cuda内部带的NVIDIA驱动,可能会和自己的显卡驱动不一致,需要自己额外安装,可以参考上一篇)
Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y
Enter Toolkit Location
[ default is /usr/local/cuda-8.0 ]:
Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y
Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y
Enter CUDA Samples Location
[ default is /home/test ]:
Installing the CUDA Toolkit in /usr/local/cuda-8.0 ...
注意:
安装显卡时选择: n
如果提示安装opengl是选择:n (如果选择了y,后续可能会有循环登录问题)
其他的都是:y
选择路径时:直接回车
4 配置环境变量
sudo gedit /etc/profile
在末尾添加:
export PATH=/usr/local/cuda-8.0/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64$LD_LIBRARY_PATH
5 重启电脑
sudo reboot
6 开机验证是否cuda安装成功
cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
显示些GPU信息,说明安装成功。
大功告成,好好体验NVIDIA的神奇魅力吧,^o^ 原文链接:https://www.f2er.com/ubuntu/351752.html