ubuntu18.04下cuda10.0及cudnn安装记录

一.cuda

1. cuda10.0下载地址:cuda10.0

2. 运行‘sudo sh cuda_10.0.130_410.48_linux.run’遵循提示安装。不要安装cuda自带的显卡驱动

 

3. 配置环境

sudo gedit ~/.bashrc

在文件末尾添加如下代码:

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

使生效

  . ~/.bashrc

使用自带例子测试:

 


cd /usr/local/cuda-10.0/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.2, CUDA Runtime Version = 10.0, NumDevs = 1
Result = PASS

输出成功
 

 

2.cuDNN

官网下载对应版本cuDNN:cuDNN官网

选择用于Linux的cuDNN库

下载完成后解压缩,运行:

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 /usr/local/cuda/lib64/libcudnn*

终端下运行:

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

出现如下版本信息说明安装成功:

#define CUDNN_MAJOR 7
#define CUDNN_MINOR 6
#define CUDNN_PATCHLEVEL 3
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

#include "driver_types.h"

 

你可能感兴趣的:(解决方法)