Ubuntu18.04 installation CUDA10, CUDNN

My system is Ubuntu18.04,64 bit, select CUDA10 version is as follows:

STEP1: CUDA official website to choose to download their own version of the system.

 

 STEP2: Installation CUDA

At the command line, type:

sudo sh cuda_10.0.130_410.48_linux.run

If the drive is independent of the installation, be sure to choose not to install the driver! Your choices are:

 

 Will prompt:

*** the WARNING: This is in Incomplete state Installation Installation DID not install at The CUDA Driver A Driver Version of AT Least 384.00 IS required for CUDA 10.0 functions on this page to Work!..

The To install a using the this at The Driver Installer, following the Command at The RUN, Replacing <CudaInstaller> with at the name of the this RUN File:

sudo <CudaInstaller> .run -silent -driver

this is because we do not choose to install when installing CUDA drivers, suggesting the need to install the driver, ignore the line.

STEP3: Add the environment variable:

export CUDA_HOME=/usr/local/cuda 
export PATH=$PATH:$CUDA_HOME/bin 
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

保存并退出

source ~/.bashrc

STEP4:测试是否安装成功

上面的选项选择安装了CUDA例子,运行其中一个来测试是否安装成功:

cd /usr/local/cuda/samples/1_Utilities/deviceQuery 
sudo make
./deviceQuery

结果如下就表明成功啦

 

STEP5:安装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 
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*

在终端查看CUDNN版本:

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

 查看cuda版本

cat /usr/local/cuda/version.txt

 

Guess you like

Origin www.cnblogs.com/answerThe/p/12244354.html