GTX1080ti 安装cuda-8.0和cudnn-7.5

前面一章讲了安装1080ti驱动的一些坑,首先查看自己的显卡驱动

sudo nvidia-smi
显示,比较奇怪,明明已经安装成功了为啥还是显示0 Graphics Device     Off,理论上这边应该显示GTX1080 ti,在安装1080的时候就现实gtx1080

Wed Apr  5 14:43:15 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 378.13                 Driver Version: 378.13                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Graphics Device     Off  | 0000:01:00.0      On |                  N/A |
| 23%   34C    P8    12W / 250W |    272MiB / 11171MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      1128    G   /usr/bin/X                                     153MiB |
|    0      2047    G   compiz                                         116MiB |
+-----------------------------------------------------------------------------+
可能1080ti和1080还是有点区别的吧,就当驱动已经安装成功了,网上也很少有关于1080ti的教程,也懒得折腾了

下面安装cuda-8.0,此处参考 http://www.2cto.com/os/201607/528798.html

cuda_8.0.27_linux.run(下载地址为:https://developer.nvidia.com/cuda-toolkit 不过需要注册)拷到home/xu目录下。

1、给权限

sudo chmod 777 cuda_8.0.61_375.26_linux.run

2、开始run

sudo ./cuda_8.0.61_375.26_linux.run

然后在第二个是否安装驱动选择否,注意,run开始后会有一会不动了,需要按F2或者ENter

然后按照提示

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

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_2961.log

1、安装完成后添加环境变量

在终端输入这两句:

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的两句,保存,退出。

source /etc/profile

sudo ldconfig

2、添加lib路径,在/etc/ld.so.conf.d/新建文件cuda.conf,并编辑

cd /etc/ld.so.conf.d

$ sudo touch cuda.conf 

$ sudo gedit cuda.conf

/usr/local/cuda-6.5/lib64

执行下列命令使之立刻生效

$ sudo ldconfig

3、安装cuda sample

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

cd /usr/local/cuda-8.0/samples
sudo make

编译完成后, 进入 samples/bin/x86_64/linux/release

$ sudo ./deviceQuery

看见显卡信息则代表成功了

安装cudnn7.5  此处参考http://www.2cto.com/os/201607/528798.html

安装cuDNN比较简单,解压后把相应的文件拷贝到对应的CUDA目录下即可:

tar -zxvf cudnn-8.0.ga.tgz

显示以下信息:
*cuda/include/cudnn.h
cuda/lib64/libcudnn.so
cuda/lib64/libcudnn.so.5
cuda/lib64/libcudnn.so.5.0.5
cuda/lib64/libcudnn_static.a*
继续执行以下指令:

sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn.h
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*


8) 验证一下,哈哈哈哈哈啊哈哈哈哈哈
cuda的samples 里面有个deviceQuery 运行之后会显示信息,最后一行出行pass说明成功啦~~~~


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值