OS: ubuntu16.04 , 显卡 Nvidia 1080
装CUDA原因:
1.在配置elasticFusion等需要GPU加速的开源SLAM工程时要装CUDA (配置时请将elasticfusion的bash中的CUDA-7-5删掉)
2.深度学习装CUDA
安装流程:
- 先安装机子显卡对应的显卡驱动:
- sudo add-apt-repository ppa:graphics-drivers/ppa
- 出现“按回车继续或者 Ctrl+c 取消添加” 按回车。
- sudo apt-get update
- sudo apt-get install nvidia-* (这里的*号是你的显卡要装的驱动,如我的1080是nvidia-367)
- sudo apt-get install mesa-common-dev
- sudo apt-get install freeglut3-dev
- 重启让驱动生效
下载安装CUDA:
- CUDA8下载页:https://developer.nvidia.com/cuda-release-candidate-download,先注册然后才能下载。
- 选择Ubuntu16.04系统 runfile安装方案:
sudo sh cuda_8.0.27_linux.run (可能出现提示空间不足,改为sudo sh cuda_8.0.27_linux.run –tmpdir=/opt/temp/)
出现一长串阅读信息,直接按住D快速略过
- 出现选择: do you accept the previously read EULA?
- accept
- Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 361.62?
(y)es/(n)o/(q)uit: n Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: yEnter Toolkit Location
Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: yInstall the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: yEnter CUDA Samples Location
- 安装完毕后,再声明一下环境变量,并将其写入到 ~/.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}}
最后键入nvidia-smi 测试下CUDA和驱动是否成功安装