本帖最后由 18755080270 于 2020-12-2 01:43 编辑
【8269CY+2080TI】安装Centos7+CUDA9.0+CUDNN9.0 深度学习环境搭建(五) 作者:小白
前言 好久没有更新教程了,为了生活而忙于工作不能自拔。最近给客户调试了一台深度学习主机,记录下遇到的问题和解决办法,希望可以帮助到大家!
电脑主机配置 CPU:8269CY 2.5Ghz 26C 52T *2 主板:超微X11DAi-N 内存:三星 2933 RECC 16G *8 硬盘:三星 870 QVO 1T 企业级固态 显卡:DELL RTX2080TI 11G *2 电源:长城巨龙 1250W
安装教程即将开始。。。
再次安装CUDA [root@localhost Downloads]# sudo yum install cuda
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
epel/x86_64/metalink | 7.5 kB 00:00
* base: mirrors.cn99.com
* elrepo: hkg.mirror.rackspace.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.ustc.edu.cn
* updates: mirrors.cn99.com
base | 3.6 kB 00:00
cuda-10-2-local-10.2.89-440.33.01 | 2.5 kB 00:00
cuda-rhel7-11-1-local | 2.5 kB 00:00
elrepo | 2.9 kB 00:00
epel | 4.7 kB 00:00
extras | 2.9 kB 00:00
updates | 2.9 kB 00:00
(1/10): cuda-10-2-local-10.2.89-440.33.01/primary_db | 46 kB 00:00
(2/10): cuda-rhel7-11-1-local/primary_db | 52 kB 00:00
(3/10): base/7/x86_64/group_gz | 153 kB 00:00
(4/10): base/7/x86_64/primary_db | 6.1 MB 00:00
(5/10): elrepo/primary_db | 481 kB 00:00
(6/10): epel/x86_64/group_gz | 95 kB 00:00
(7/10): epel/x86_64/updateinfo | 1.0 MB 00:00
(8/10): epel/x86_64/primary_db | 6.9 MB 00:00
(9/10): extras/7/x86_64/primary_db | 222 kB 00:00
(10/10): updates/7/x86_64/primary_db | 3.7 MB 00:00
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
cuda-driver-devel-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 33 k
cuda-drivers x86_64 455.23.05-1 cuda-rhel7-11-1-local 3.6 k
cuda-gdb-11-1 x86_64 11.1.69-1 cuda-rhel7-11-1-local 4.6 M
cuda-libraries-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 2.9 k
cuda-libraries-devel-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 3.0 k
cuda-memcheck-11-1 x86_64 11.1.69-1 cuda-rhel7-11-1-local 174 k
cuda-nsight-11-1 x86_64 11.1.69-1 cuda-rhel7-11-1-local 113 M
cuda-nsight-compute-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 5.2 k
cuda-nsight-systems-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 4.9 k
cuda-nvcc-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 34 M
cuda-nvdisasm-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 31 M
cuda-nvml-devel-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 93 k
cuda-nvprof-11-1 x86_64 11.1.69-1 cuda-rhel7-11-1-local 4.5 M
cuda-nvprune-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 63 k
cuda-nvrtc-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 14 M
cuda-nvrtc-devel-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 27 k
cuda-nvtx-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 83 k
cuda-nvvp-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 116 M
cuda-runtime-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 2.7 k
cuda-samples-11-1 x86_64 11.1.74-1 cuda-rhel7-11-1-local 93 M
cuda-sanitizer-11-1 x86_64 11.1.49-1 cuda-rhel7-11-1-local 13 M
cuda-toolkit-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 3.3 k
cuda-tools-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 2.6 k
cuda-visual-tools-11-1 x86_64 11.1.0-1 cuda-rhel7-11-1-local 3.2 k
kmod-nvidia-latest-dkms x86_64 3:455.23.05-1.el7 cuda-rhel7-11-1-local 19 M
libcublas-11-1 x86_64 11.2.1.74-1 cuda-rhel7-11-1-local 220 M
libcublas-devel-11-1 x86_64 11.2.1.74-1 cuda-rhel7-11-1-local 227 M
libcufft-11-1 x86_64 10.3.0.74-1 cuda-rhel7-11-1-local 160 M
libcufft-devel-11-1 x86_64 10.3.0.74-1 cuda-rhel7-11-1-local 280 M
libcurand-11-1 x86_64 10.2.2.74-1 cuda-rhel7-11-1-local 46 M
libcurand-devel-11-1 x86_64 10.2.2.74-1 cuda-rhel7-11-1-local 46 M
libcusolver-11-1 x86_64 11.0.0.74-1 cuda-rhel7-11-1-local 582 M
libcusolver-devel-11-1 x86_64 11.0.0.74-1 cuda-rhel7-11-1-local 47 M
libcusparse-11-1 x86_64 11.2.0.275-1 cuda-rhel7-11-1-local 152 M
libcusparse-devel-11-1 x86_64 11.2.0.275-1 cuda-rhel7-11-1-local 304 M
nvidia-driver-latest-NvFBCOpenGL
x86_64 3:455.23.05-1.el7 cuda-rhel7-11-1-local 119 k
nvidia-driver-latest-cuda x86_64 3:455.23.05-1.el7 cuda-rhel7-11-1-local 330 k
nvidia-libXNVCtrl-devel x86_64 3:455.23.05-1.el7 cuda-rhel7-11-1-local 58 k
nvidia-modprobe-latest x86_64 3:455.23.05-1.el7 cuda-rhel7-11-1-local 34 k
Transaction Summary
================================================================================
Install 1 Package (+68 Dependent packages)
Total download size: 3.3 G
Installed size: 6.1 G
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cuda-repo-rhel7-11-1-local/cuda-11.1.0-1.x86_64.rpm: Header V3 RSA/SHA512 Signature, key ID 7fa2af80: NOKEY
Public key for cuda-11.1.0-1.x86_64.rpm is not installed
(1/5): libglvnd-opengl-1.0.1-0.8.git5baa1e5.el7.x86_64.rpm | 43 kB 00:00
(2/5): ocl-icd-2.2.12-1.el7.x86_64.rpm | 43 kB 00:00
(3/5): opencl-filesystem-1.0-5.el7.noarch.rpm | 3.9 kB 00:00
(4/5): vulkan-filesystem-1.1.97.0-1.el7.noarch.rpm | 6.3 kB 00:00
(5/5): yum-plugin-nvidia-1.0.2-1.el7.elrepo.noarch.rpm | 12 kB 00:00
--------------------------------------------------------------------------------
Total 684 MB/s | 3.3 GB 00:05
Retrieving key from file:///var/cuda-repo-rhel7-11-1-local/7fa2af80.pub
Importing GPG key 0x7FA2AF80:
Userid : "cudatools <cudatools@nvidia.com>"
Fingerprint: ae09 fe4b bd22 3a84 b2cc fce3 f60f 4b3d 7fa2 af80
Package : cuda-repo-rhel7-11-1-local-11.1.0_455.23.05-1.x86_64 (installed)
From : /var/cuda-repo-rhel7-11-1-local/7fa2af80.pub
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Removing existing driver runfile install
Installing : cuda-driver-devel-11-1-11.1.74-1.x86_64 1/69
Installing : cuda-nvprof-11-1-11.1.69-1.x86_64 2/69
Installing : libnvjpeg-11-1-11.2.0.74-1.x86_64 3/69
Installing : libnvjpeg-devel-11-1-11.2.0.74-1.x86_64 4/69
Installing : libnpp-11-1-11.1.1.269-1.x86_64 5/69
Installing : libnpp-devel-11-1-11.1.1.269-1.x86_64 6/69
Installing : libcufft-11-1-10.3.0.74-1.x86_64 7/69
Installing : libcufft-devel-11-1-10.3.0.74-1.x86_64 8/69
Installing : cuda-nvrtc-11-1-11.1.74-1.x86_64 9/69
Installing : cuda-nvrtc-devel-11-1-11.1.74-1.x86_64 10/69
Installing : cuda-nvml-devel-11-1-11.1.74-1.x86_64 11/69
Installing : libcusparse-11-1-11.2.0.275-1.x86_64 12/69
Installing : libcusparse-devel-11-1-11.2.0.275-1.x86_64 13/69
Installing : libcusolver-11-1-11.0.0.74-1.x86_64 14/69
Installing : libcusolver-devel-11-1-11.0.0.74-1.x86_64 15/69
Installing : cuda-nvcc-11-1-11.1.74-1.x86_64 16/69
Installing : libcublas-11-1-11.2.1.74-1.x86_64 17/69
Installing : libcublas-devel-11-1-11.2.1.74-1.x86_64 18/69
Installing : libcurand-11-1-10.2.2.74-1.x86_64 19/69
Installing : libcurand-devel-11-1-10.2.2.74-1.x86_64 20/69
Installing : cuda-nvdisasm-11-1-11.1.74-1.x86_64 21/69
Installing : cuda-cudart-11-1-11.1.74-1.x86_64 22/69
Installing : cuda-cudart-devel-11-1-11.1.74-1.x86_64 23/69
Installing : cuda-libraries-11-1-11.1.0-1.x86_64 24/69
Installing : cuda-samples-11-1-11.1.74-1.x86_64 25/69
Installing : cuda-libraries-devel-11-1-11.1.0-1.x86_64 26/69
Installing : cuda-nvvp-11-1-11.1.74-1.x86_64 27/69
Installing : ocl-icd-2.2.12-1.el7.x86_64 28/69
Installing : cuda-nvprune-11-1-11.1.74-1.x86_64 29/69
Installing : cuda-cupti-11-1-11.1.69-1.x86_64 30/69
Installing : cuda-memcheck-11-1-11.1.69-1.x86_64 31/69
Installing : yum-plugin-nvidia-1.0.2-1.el7.elrepo.noarch 32/69
Installing : 1:libglvnd-opengl-1.0.1-0.8.git5baa1e5.el7.x86_64 33/69
Installing : nsight-systems-2020.3.4-2020.3.4.32_52657a0-0.x86_64 34/69
Installing : cuda-nsight-systems-11-1-11.1.0-1.x86_64 35/69
Installing : cuda-demo-suite-11-1-11.1.74-1.x86_64 36/69
Installing : cuda-gdb-11-1-11.1.69-1.x86_64 37/69
Installing : cuda-documentation-11-1-11.1.74-1.x86_64 38/69
Installing : cuda-nsight-11-1-11.1.69-1.x86_64 39/69
Installing : cuda-sanitizer-11-1-11.1.49-1.x86_64 40/69
Installing : vulkan-filesystem-1.1.97.0-1.el7.noarch 41/69
Installing : cuda-cuobjdump-11-1-11.1.74-1.x86_64 42/69
Installing : cuda-compiler-11-1-11.1.0-1.x86_64 43/69
Installing : cuda-nvtx-11-1-11.1.74-1.x86_64 44/69
Installing : cuda-command-line-tools-11-1-11.1.0-1.x86_64 45/69
Installing : opencl-filesystem-1.0-5.el7.noarch 46/69
Installing : 3:nvidia-persistenced-latest-455.23.05-1.el7.x86_64 47/69
Installing : 3:nvidia-driver-latest-cuda-libs-455.23.05-1.el7.x86_64 48/69
Installing : 3:nvidia-xconfig-latest-455.23.05-1.el7.x86_64 49/69
Installing : 3:nvidia-driver-latest-NVML-455.23.05-1.el7.x86_64 50/69
Installing : 3:nvidia-driver-latest-NvFBCOpenGL-455.23.05-1.el7.x86_6 51/69
Installing : 3:nvidia-modprobe-latest-455.23.05-1.el7.x86_64 52/69
Installing : 3:nvidia-driver-latest-devel-455.23.05-1.el7.x86_64 53/69
Installing : 3:nvidia-driver-latest-libs-455.23.05-1.el7.x86_64 54/69
Installing : 3:kmod-nvidia-latest-dkms-455.23.05-1.el7.x86_64 55/69
Installing : 3:nvidia-driver-latest-455.23.05-1.el7.x86_64 56/69
Installing : 3:nvidia-driver-latest-cuda-455.23.05-1.el7.x86_64 57/69
Installing : 3:nvidia-libXNVCtrl-455.23.05-1.el7.x86_64 58/69
Installing : 3:nvidia-settings-455.23.05-1.el7.x86_64 59/69
Installing : 3:nvidia-libXNVCtrl-devel-455.23.05-1.el7.x86_64 60/69
Installing : cuda-runtime-11-1-11.1.0-1.x86_64 61/69
Installing : nsight-compute-2020.2.0-2020.2.0.18-1.x86_64 62/69
Installing : cuda-nsight-compute-11-1-11.1.0-1.x86_64 63/69
Installing : cuda-visual-tools-11-1-11.1.0-1.x86_64 64/69
Installing : cuda-tools-11-1-11.1.0-1.x86_64 65/69
Installing : cuda-toolkit-11-1-11.1.0-1.x86_64 66/69
Installing : cuda-11-1-11.1.0-1.x86_64 67/69
Installing : cuda-11.1.0-1.x86_64 68/69
Installing : cuda-drivers-455.23.05-1.x86_64 69/69
Installed:
cuda.x86_64 0:11.1.0-1
此处省略5000字!此处省略5000字!此处省略5000字!
Complete!
################################################################################
2.CUDA添加到全环境变量
[root@localhost deviceQuery]# vim /etc/profile
export PATH=$PATH:/usr/local/cuda-11.1/bin #添加此行
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.1/lib64 #添加此行
[root@localhost deviceQuery]#source /etc/profile
3.查看nvcc版本号:nvcc -V
[root@localhost deviceQuery]# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0
4.测试cuda
[root@localhost ~]# cd /usr/local/cuda-11.1/samples/1_Utilities/deviceQuery
[root@localhost 1_Utilities]# ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 2 CUDA Capable device(s)
Device 0: "GeForce RTX 2080 Ti"
CUDA Driver Version / Runtime Version 11.1 / 11.1
CUDA Capability Major/Minor version number: 7.5
Total amount of global memory: 11019 MBytes (11554324480 bytes)
(68) Multiprocessors, ( 64) CUDA Cores/MP: 4352 CUDA Cores
GPU Max Clock rate: 1545 MHz (1.54 GHz)
Memory Clock rate: 7000 Mhz
Memory Bus Width: 352-bit
L2 Cache Size: 5767168 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total shared memory per multiprocessor: 65536 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1024
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 3 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device supports Managed Memory: Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 175 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
Device 1: "GeForce RTX 2080 Ti"
CUDA Driver Version / Runtime Version 11.1 / 11.1
CUDA Capability Major/Minor version number: 7.5
Total amount of global memory: 11019 MBytes (11554717696 bytes)
(68) Multiprocessors, ( 64) CUDA Cores/MP: 4352 CUDA Cores
GPU Max Clock rate: 1545 MHz (1.54 GHz)
Memory Clock rate: 7000 Mhz
Memory Bus Width: 352-bit
L2 Cache Size: 5767168 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total shared memory per multiprocessor: 65536 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1024
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 3 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device supports Managed Memory: Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 216 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
> Peer access from GeForce RTX 2080 Ti (GPU0) -> GeForce RTX 2080 Ti (GPU1) : No
> Peer access from GeForce RTX 2080 Ti (GPU1) -> GeForce RTX 2080 Ti (GPU0) : No
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.1, CUDA Runtime Version = 11.1, NumDevs = 2
Result = PASS
################################################################################
安装CUDNN9.0
1.解压cudnn9.0压缩包
[root@localhost Downloads]# tar -xvf cudnn-9.0-linux-x64-v7.1.tgz
2.将cudnn9.0解压后的文件复制到cuda的路径下
[root@localhost Downloads]# cd cuda
[root@localhost cuda]# cp include/* /usr/local/cuda-9.0/inlcude/
[root@localhost cuda]# cp lib64/lib* /usr/local/cuda-9.0/lib64/
3.修改文件权限
[root@localhost cuda]# chmod a+r /usr/local/cuda-9.0/include/cudnn.h /usr/local/cuda-9.0/lib64/libcudnn*
################################################################################
[root@localhost cuda]# nvidia-smi
注意:此处千万不要重启服务器哟,NVIDIA驱动需要安装!!!!
注意:此处千万不要重启服务器哟,NVIDIA驱动需要安装!!!!
注意:此处千万不要重启服务器哟,NVIDIA驱动需要安装!!!!
下一贴教你安装NVIDIA 440.64 驱动!!!
|