大服务器配置CUDA cuDNN
大服务器,两块 Tesla P100-PCIE显卡,安装驱动,配置cuda、cuDNN
https://developer.nvidia.com/cuda-11.2.2-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=2004&target_type=runfilelocal
1、下载CUDA11.2
wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
(base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run --2022-03-25 09:31:21-- https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.199.39.144 Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.199.39.144|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://developer.download.nvidia.cn/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run [following] --2022-03-25 09:31:21-- https://developer.download.nvidia.cn/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run Resolving developer.download.nvidia.cn (developer.download.nvidia.cn)... 58.205.210.82 Connecting to developer.download.nvidia.cn (developer.download.nvidia.cn)|58.205.210.82|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 3057439068 (2.8G) [application/octet-stream] Saving to: ‘cuda_11.2.2_460.32.03_linux.run’ cuda_11.2.2_460.32.03_linux.run 100%[=============================================================>] 2.85G 11.3MB/s in 4m 43s 2022-03-25 09:36:06 (10.3 MB/s) - ‘cuda_11.2.2_460.32.03_linux.run’ saved [3057439068/3057439068] (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$
2、安装
sudo sh cuda_11.2.2_460.32.03_linux.run
①点击continue
②输入accept
③按空格去掉安装显卡驱动的选项,然后选择install
3、配置环境变量
gedit ~/.bashrc
export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
4、更新环境变量
source ~/.bashrc
(base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ source ~/.bashrc (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$
5、查看cuda
nvcc -V
(base) bim@bim-PowerEdge-R730:~$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Sun_Feb_14_21:12:58_PST_2021 Cuda compilation tools, release 11.2, V11.2.152 Build cuda_11.2.r11.2/compiler.29618528_0 (base) bim@bim-PowerEdge-R730:~$
6、下载cuDNN
7、将cuda/include/cudnn.h文件复制到usr/local/cuda/include文件夹,将cuda/lib64/下所有文件复制到/usr/local/cuda/lib64文件夹中,并添加读取权限:
(base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ cd Downloads (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ ls cudnn-10.1-linux-x64-v8.0.5.39.tgz cudnn-11.3-linux-x64-v8.2.1.32.tgz cudnn-linux-x86_64-8.3.2.44_cuda10.2-archive.tar.xz libcudnn8_8.2.1.32-1+cuda11.3_amd64.deb libcudnn8-dev_8.2.1.32-1+cuda11.3_amd64.deb PaddleDetection-release-2.3.zip (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ tar cudnn-11.3-linux-x64-v8.2.1.32.tgz tar: Old option 'g' requires an argument. Try 'tar --help' or 'tar --usage' for more information. (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ tar -zxvf cudnn-11.3-linux-x64-v8.2.1.32.tgz cuda/include/cudnn.h cuda/include/cudnn_adv_infer.h cuda/include/cudnn_adv_infer_v8.h cuda/include/cudnn_adv_train.h cuda/include/cudnn_adv_train_v8.h cuda/include/cudnn_backend.h cuda/include/cudnn_backend_v8.h cuda/include/cudnn_cnn_infer.h cuda/include/cudnn_cnn_infer_v8.h cuda/include/cudnn_cnn_train.h cuda/include/cudnn_cnn_train_v8.h cuda/include/cudnn_ops_infer.h cuda/include/cudnn_ops_infer_v8.h cuda/include/cudnn_ops_train.h cuda/include/cudnn_ops_train_v8.h cuda/include/cudnn_v8.h cuda/include/cudnn_version.h cuda/include/cudnn_version_v8.h cuda/NVIDIA_SLA_cuDNN_Support.txt cuda/lib64/libcudnn.so cuda/lib64/libcudnn.so.8 cuda/lib64/libcudnn.so.8.2.1 cuda/lib64/libcudnn_adv_infer.so cuda/lib64/libcudnn_adv_infer.so.8 cuda/lib64/libcudnn_adv_infer.so.8.2.1 cuda/lib64/libcudnn_adv_train.so cuda/lib64/libcudnn_adv_train.so.8 cuda/lib64/libcudnn_adv_train.so.8.2.1 cuda/lib64/libcudnn_cnn_infer.so cuda/lib64/libcudnn_cnn_infer.so.8 cuda/lib64/libcudnn_cnn_infer.so.8.2.1 cuda/lib64/libcudnn_cnn_infer_static.a cuda/lib64/libcudnn_cnn_infer_static_v8.a cuda/lib64/libcudnn_cnn_train.so cuda/lib64/libcudnn_cnn_train.so.8 cuda/lib64/libcudnn_cnn_train.so.8.2.1 cuda/lib64/libcudnn_cnn_train_static.a cuda/lib64/libcudnn_cnn_train_static_v8.a cuda/lib64/libcudnn_ops_infer.so cuda/lib64/libcudnn_ops_infer.so.8 cuda/lib64/libcudnn_ops_infer.so.8.2.1 cuda/lib64/libcudnn_ops_train.so cuda/lib64/libcudnn_ops_train.so.8 cuda/lib64/libcudnn_ops_train.so.8.2.1 cuda/lib64/libcudnn_static.a cuda/lib64/libcudnn_static_v8.a (base) bim@bim-PowerEdge-R730:~/Downloads$ (base) bim@bim-PowerEdge-R730:~/Downloads$ cd cuda (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ sudo cp lib64/lib* /usr/local/cuda/lib64 [sudo] password for bim: (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ sudo cp include/cudnn.h /usr/local/cuda/include/ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Sun_Feb_14_21:12:58_PST_2021 Cuda compilation tools, release 11.2, V11.2.152 Build cuda_11.2.r11.2/compiler.29618528_0 (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$ (base) bim@bim-PowerEdge-R730:~/Downloads/cuda$
8、查看配置结果
(wind_paddle) bim@bim-PowerEdge-R730:~$ (wind_paddle) bim@bim-PowerEdge-R730:~$ cat /usr/local/cuda/version.json { "cuda" : { "name" : "CUDA SDK", "version" : "11.2.20210226" }, "cuda_cudart" : { "name" : "CUDA Runtime (cudart)", "version" : "11.2.152" }, "cuda_cuobjdump" : { "name" : "cuobjdump", "version" : "11.2.152" }, "cuda_cupti" : { "name" : "CUPTI", "version" : "11.2.152" }, "cuda_cuxxfilt" : { "name" : "CUDA cu++ filt", "version" : "11.2.152" }, "cuda_demo_suite" : { "name" : "CUDA Demo Suite", "version" : "11.2.152" }, "cuda_gdb" : { "name" : "CUDA GDB", "version" : "11.2.152" }, "cuda_memcheck" : { "name" : "CUDA Memcheck", "version" : "11.2.152" }, "cuda_nsight" : { "name" : "Nsight Eclipse Plugins", "version" : "11.2.152" }, "cuda_nvcc" : { "name" : "CUDA NVCC", "version" : "11.2.152" }, "cuda_nvdisasm" : { "name" : "CUDA nvdisasm", "version" : "11.2.152" }, "cuda_nvml_dev" : { "name" : "CUDA NVML Headers", "version" : "11.2.152" }, "cuda_nvprof" : { "name" : "CUDA nvprof", "version" : "11.2.152" }, "cuda_nvprune" : { "name" : "CUDA nvprune", "version" : "11.2.152" }, "cuda_nvrtc" : { "name" : "CUDA NVRTC", "version" : "11.2.152" }, "cuda_nvtx" : { "name" : "CUDA NVTX", "version" : "11.2.152" }, "cuda_nvvp" : { "name" : "CUDA NVVP", "version" : "11.2.152" }, "cuda_samples" : { "name" : "CUDA Samples", "version" : "11.2.152" }, "cuda_sanitizer_api" : { "name" : "CUDA Compute Sanitizer API", "version" : "11.2.152" }, "libcublas" : { "name" : "CUDA cuBLAS", "version" : "11.4.1.1043" }, "libcufft" : { "name" : "CUDA cuFFT", "version" : "10.4.1.152" }, "libcurand" : { "name" : "CUDA cuRAND", "version" : "10.2.3.152" }, "libcusolver" : { "name" : "CUDA cuSOLVER", "version" : "11.1.0.152" }, "libcusparse" : { "name" : "CUDA cuSPARSE", "version" : "11.4.1.1152" }, "libnpp" : { "name" : "CUDA NPP", "version" : "11.3.2.152" }, "libnvjpeg" : { "name" : "CUDA nvJPEG", "version" : "11.4.0.152" }, "nsight_compute" : { "name" : "Nsight Compute", "version" : "2020.3.1.4" }, "nsight_systems" : { "name" : "Nsight Systems", "version" : "2020.4.3.7" }, "nvidia_driver" : { "name" : "NVIDIA Linux Driver", "version" : "460.32.03" } } (wind_paddle) bim@bim-PowerEdge-R730:~$ (wind_paddle) bim@bim-PowerEdge-R730:~$
参考: https://developer.nvidia.com/rdp/cudnn-archive#a-collapse821-113
参考:https://www.jb51.net/article/192060.htm
################
QQ 3087438119