-
Notifications
You must be signed in to change notification settings - Fork 0
/
cuda_install.txt
57 lines (32 loc) · 1.58 KB
/
cuda_install.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
STEP2:安装CUDA
在命令行中键入:
sudo sh cuda_10.0.130_410.48_linux.run
一直按Enter直至把声明读完(太多了吧!)
如果驱动是独立安装了,一定要选择不安装驱动!选择如下:
会提示:
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 10.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
这是因为我们在安装CUDA的时候没有选择安装驱动,提示需要安装驱动,忽略就行。
STEP3:添加环境变量:
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