ubuntu 18.04安装cuda 8.0 和cudnn 6.0

我的cuda 8.0的下载链接为:

https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run

cudnn 6.0的下载链接为:

https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v6/prod/8.0_20170427/cudnn-8.0-linux-x64-v6.0-tgz

如果我给的两个链接下载不了的话,那就只能去官网下载了。

https://developer.nvidia.com/cuda-80-ga2-download-archive

cuda安装

下载完以后,进行安装:

sh cuda_8.0.61_375.26_linux.run --noexec --target cuda

进入cuda目录下

 sudo cp InstalUtil.pm /etc/perl

配置环境变量:

export $PERL5LIB

安装cuda

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

我的安装信息为:

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

You are attempting to install on an unsupported configuration. Do you wish to continue?
(y)es/(n)o [ default is no ]: y

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
(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: n

Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: 
Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: n

Installing the CUDA Toolkit in /usr/local/cuda-8.0 ...

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-8.0
Samples:  Not Selected

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 <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run -silent -driver

然后增加环境变量到~/.bashrc文件里:

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

运行下面的命令就可以显示cuda 8.0的信息了:

source ~/.bashrc 
nvcc -V 

我的显示信息为:

(base) ➜  data nvcc -V   
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

cudnn安装

cp cudnn-8.0-linux-x64-v6.0.solitairetheme8 cudnn-8.0-linux-x64-v6.0.tgz
tar -xvf cudnn-8.0-linux-x64-v6.0.tgz 
cd cuda/
sudo cp include/cudnn.h /usr/local/cuda-8.0/include 
sudo cp lib64/libcudnn* /usr/local/cuda-8.0/lib64

参考文献

[1]. 在ubuntu上安装多个版本的CUDA,并且可以随时切换. https://blog.csdn.net/ksws0292756/article/details/80120561

[2].ubuntu 安装CUDA时,找不到 InstalUtils.pm解决方案. https://blog.csdn.net/u013406197/article/details/90172039

[3]. cudnn6.0的安装简单教程. https://blog.csdn.net/w5688414/article/details/78195505

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

农民小飞侠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值