亲测详解ubuntu14.04+cuda8.0+gtx1080+caffe

来源:互联网 发布:淘宝店铺装修全能助手 编辑:程序博客网 时间:2024/06/10 02:17

首先感谢这篇博文,主干线是根据这个来做的:http://www.2cto.com/os/201607/528798.html


最重要的一点:nvidia驱动,我了解到可行的是367.27/367.35/367.44

这里提供367.27的驱动下载,亲测可行:http://www.geforce.cn/drivers/results/104314

0、准备工作

1)下载好驱动: NVIDIA-Linux-x86_64-367.27.run 

2)下载好cuda 8.0: cuda_8.0.27_linux.run

1、安装gtx1080驱动

此时,你的htmi应该是插在集显口上的!

1) 安装过程

Ctrl+alt+F1进入字符界面,关闭图形界面

sudo service lightdm stop //必须有,不然会安装失败。start可回到图形界面

sudo chmod 755 NVIDIA-Linux-x86_64-367.27.run  //获取权限

sudo ./NVIDIA-Linux-x86_64-367.27.run  //安装驱动

Accept

Continue installation

2)安装完成之后,可以通过nvidia -smi测试是否安装成功,注意此时你是无法用图形界面登录的!

reboot重启


2、切换到1080

1)重启时按delete键,进入bios系统。然后将启动的接口由IGXX(集显口,具体记不到了)改为PCIe(1080)

2)将htmi插到1080显卡的接口上,reboot


3、安装cuda 8.0,这里要安装过程中的选项,注意千万别把之前的驱动367.27给覆盖了!

1) 在终端运行指令 sudo sh cuda_8.0.27_linux.run

Do you accept the previously read EULA?
accept/decline/quit: accept


Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 361.62?
(y)es/(n)o/(q)uit: n //是否覆盖驱动?这是关键,要填n


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/zhou ]:


Installing the CUDA Toolkit in /usr/local/cuda-8.0 …
Missing recommended library: libGLU.so
Missing recommended library: libX11.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.so


Installing the CUDA Samples in /home/zhou …
Copying samples to /home/zhou/NVIDIA_CUDA-8.0_Samples now…
Finished copying samples.


===========
= Summary =
===========
Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-8.0
Samples: Installed in /home/zhou, but missing recommended libraries


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 /tmp/cuda_install_3119.log

2)安装依赖

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

3)设置环境变量,重要

在终端输入这两句:

export PATH=/usr/local/cuda-8.0/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

然后修改文件中环境变量设置

sudo vi /etc/profile

输入上面export的两句,保存,退出。

sudo ldconfig //环境变量立即生效

4)通过nvcc -V测试cuda是否安装成功


========caffe\cudnn我用的一键脚本======


ps:libcudart.so.8.0: cannot open shared object file: No such file or directory

答:代表没有链接好cuda共享库,可以vim ~/.bashrc。再末端添加export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

以后每次打开一个shell,都会执行这一句。


到底完毕

注意如果安装依赖出问题,请更新一下/etc/apt/sources.list


pps:

安装搜狗输入法

http://jingyan.baidu.com/article/ad310e80ae6d971849f49ed3.html


安装vscode

https://code.visualstudio.com/docs/?dv=linux64_deb


安装pycharm

http://blog.csdn.net/kengmun/article/details/46674661




0 0
原创粉丝点击