GPU服务器安装显卡驱动、CUDA和cuDNN

news2024/11/19 3:50:07

GPU服务器安装cuda和cudnn

  • 1. 服务器驱动安装
  • 2. cuda安装
  • 3. cudNN安装
  • 4. 安装docker环境
  • 5. 安装nvidia-docker2
    • 5.1 ubuntu系统安装
    • 5.2 centos系统安装
  • 6. 测试docker容调用GPU服务

1. 服务器驱动安装

  • 显卡驱动下载地址
  • https://www.nvidia.cn/Download/index.aspx?lang=cn
  • 显卡驱动安装完成后可以通过命令:nvidia-smi 查看驱动信息
  • 显卡型号查看命令:lspci |grep -i vga
root@hk-MZ32-AR0-00:~#  nvidia-smi 
Fri Feb 10 17:27:58 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.106.00   Driver Version: 460.106.00   CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            Off  | 00000000:04:00.0 Off |                    0 |
| N/A   46C    P0    27W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  Tesla T4            Off  | 00000000:06:00.0 Off |                    0 |
| N/A   43C    P0    28W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  Tesla T4            Off  | 00000000:0D:00.0 Off |                    0 |
| N/A   48C    P0    28W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  Tesla T4            Off  | 00000000:0F:00.0 Off |                    0 |
| N/A   45C    P0    26W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   4  Tesla T4            Off  | 00000000:17:00.0 Off |                    0 |
| N/A   48C    P0    27W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   5  Tesla T4            Off  | 00000000:19:00.0 Off |                    0 |
| N/A   48C    P0    28W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   6  Tesla T4            Off  | 00000000:21:00.0 Off |                    0 |
| N/A   45C    P0    26W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   7  Tesla T4            Off  | 00000000:23:00.0 Off |                    0 |
| N/A   45C    P0    27W /  70W |      0MiB / 15109MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

2. cuda安装

  • CUDA安装的时候需要注意显卡的驱动版本
  • 参考文档 :接入附上一份

在这里插入图片描述

  • 此次实验机的驱动版本是 460.106.00,我选用的版本是CUDA 11.0
  • 下载地址:https://developer.nvidia.com/cuda-toolkit-archive
root@hk-MZ32-AR0-00:~#  wget http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run  
--2023-01-29 19:55:42--  http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_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|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run [following]
--2023-01-29 19:55:43--  https://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run
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.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run [following]
--2023-01-29 19:55:44--  https://developer.download.nvidia.cn/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run
Resolving developer.download.nvidia.cn (developer.download.nvidia.cn)... 125.64.2.195, 125.64.2.196, 150.138.231.66, ...
Connecting to developer.download.nvidia.cn (developer.download.nvidia.cn)|125.64.2.195|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3066694836 (2.9G) [application/octet-stream]
Saving to: ‘cuda_11.0.2_450.51.05_linux.run’

100%[=====================================================================================================================================>] 3,066,694,836 11.3MB/s   in 4m 25s 

2023-01-29 20:00:15 (11.0 MB/s) - ‘cuda_11.0.2_450.51.05_linux.run’ saved [3066694836/3066694836]

3. cudNN安装

  • 下载链接:https://developer.nvidia.com/rdp/cudnn-archive
  • cudNN下载的时候也需要注意CUDA的版本,如下图红色框标注的版本

在这里插入图片描述

root@hk-MZ32-AR0-00:~#   rz
 ZMODEM  Session started            e50
------------------------            
 Sent  cudnn-linux-x86_64-8.7.0.84_cuda11-archive.tar.xz               
root@hk-MZ32-AR0-00:~#  tar  -xvf cudnn-linux-x86_64-8.7.0.84_cuda11-archive.tar.xz 
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_infer_static.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_infer_static_v8.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_train_static.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_train_static_v8.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_infer_static.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_infer_static_v8.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_train_static.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_train_static_v8.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_infer_static.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_infer_static_v8.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_train_static.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_train_static_v8.a
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn.so.8
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn.so
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn.so.8.7.0
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_infer.so.8
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_infer.so
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_infer.so.8.7.0
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_train.so.8
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_train.so
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_adv_train.so.8.7.0
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_infer.so
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_infer.so.8
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_infer.so.8.7.0
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_train.so
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_train.so.8.7.0
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_cnn_train.so.8
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_infer.so.8.7.0
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_infer.so
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_infer.so.8
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_train.so.8.7.0
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_train.so
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/libcudnn_ops_train.so.8
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_adv_infer_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_adv_train_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_backend_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_cnn_infer_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_cnn_train_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_ops_infer_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_ops_train_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_version_v8.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_adv_infer.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_adv_train.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_backend.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_cnn_infer.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_cnn_train.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_ops_infer.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_ops_train.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/cudnn_version.h
cudnn-linux-x86_64-8.7.0.84_cuda11-archive/LICENSE

root@hk-MZ32-AR0-00:~# ll cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/
总用量 2520176
drwxr-xr-x 2 25503 2174      4096 1122 04:14 ./
drwxr-xr-x 4 25503 2174      4096 1122 04:14 ../
lrwxrwxrwx 1 25503 2174        23 1122 03:58 libcudnn_adv_infer.so -> libcudnn_adv_infer.so.8*
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_adv_infer.so.8 -> libcudnn_adv_infer.so.8.7.0*
-rwxr-xr-x 1 25503 2174 130381904 1122 03:58 libcudnn_adv_infer.so.8.7.0*
-rw-r--r-- 1 25503 2174 132979922 1122 03:58 libcudnn_adv_infer_static.a
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_adv_infer_static_v8.a -> libcudnn_adv_infer_static.a
lrwxrwxrwx 1 25503 2174        23 1122 03:58 libcudnn_adv_train.so -> libcudnn_adv_train.so.8*
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_adv_train.so.8 -> libcudnn_adv_train.so.8.7.0*
-rwxr-xr-x 1 25503 2174 121095120 1122 03:58 libcudnn_adv_train.so.8.7.0*
-rw-r--r-- 1 25503 2174 123566296 1122 03:58 libcudnn_adv_train_static.a
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_adv_train_static_v8.a -> libcudnn_adv_train_static.a
lrwxrwxrwx 1 25503 2174        23 1122 03:58 libcudnn_cnn_infer.so -> libcudnn_cnn_infer.so.8*
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_cnn_infer.so.8 -> libcudnn_cnn_infer.so.8.7.0*
-rwxr-xr-x 1 25503 2174 639185544 1122 03:58 libcudnn_cnn_infer.so.8.7.0*
-rw-r--r-- 1 25503 2174 829548950 1122 03:58 libcudnn_cnn_infer_static.a
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_cnn_infer_static_v8.a -> libcudnn_cnn_infer_static.a
lrwxrwxrwx 1 25503 2174        23 1122 03:58 libcudnn_cnn_train.so -> libcudnn_cnn_train.so.8*
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_cnn_train.so.8 -> libcudnn_cnn_train.so.8.7.0*
-rwxr-xr-x 1 25503 2174 102197000 1122 03:58 libcudnn_cnn_train.so.8.7.0*
-rw-r--r-- 1 25503 2174 153525776 1122 03:58 libcudnn_cnn_train_static.a
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_cnn_train_static_v8.a -> libcudnn_cnn_train_static.a
lrwxrwxrwx 1 25503 2174        23 1122 03:58 libcudnn_ops_infer.so -> libcudnn_ops_infer.so.8*
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_ops_infer.so.8 -> libcudnn_ops_infer.so.8.7.0*
-rwxr-xr-x 1 25503 2174  97489336 1122 03:58 libcudnn_ops_infer.so.8.7.0*
-rw-r--r-- 1 25503 2174 100636906 1122 03:58 libcudnn_ops_infer_static.a
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_ops_infer_static_v8.a -> libcudnn_ops_infer_static.a
lrwxrwxrwx 1 25503 2174        23 1122 03:58 libcudnn_ops_train.so -> libcudnn_ops_train.so.8*
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_ops_train.so.8 -> libcudnn_ops_train.so.8.7.0*
-rwxr-xr-x 1 25503 2174  74703096 1122 03:58 libcudnn_ops_train.so.8.7.0*
-rw-r--r-- 1 25503 2174  75156862 1122 03:58 libcudnn_ops_train_static.a
lrwxrwxrwx 1 25503 2174        27 1122 03:58 libcudnn_ops_train_static_v8.a -> libcudnn_ops_train_static.a
lrwxrwxrwx 1 25503 2174        13 1122 03:58 libcudnn.so -> libcudnn.so.8*
lrwxrwxrwx 1 25503 2174        17 1122 03:58 libcudnn.so.8 -> libcudnn.so.8.7.0*
-rwxr-xr-x 1 25503 2174    150200 1122 03:58 libcudnn.so.8.7.0*



root@hk-MZ32-AR0-00:~# ll cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/
总用量 448
drwxr-xr-x 2 25503 2174  4096 1122 04:14 ./
drwxr-xr-x 4 25503 2174  4096 1122 04:14 ../
-rw-r--r-- 1 25503 2174 29025 1122 03:58 cudnn_adv_infer.h
-rw-r--r-- 1 25503 2174 29025 1122 03:58 cudnn_adv_infer_v8.h
-rw-r--r-- 1 25503 2174 27700 1122 03:58 cudnn_adv_train.h
-rw-r--r-- 1 25503 2174 27700 1122 03:58 cudnn_adv_train_v8.h
-rw-r--r-- 1 25503 2174 24727 1122 03:58 cudnn_backend.h
-rw-r--r-- 1 25503 2174 24727 1122 03:58 cudnn_backend_v8.h
-rw-r--r-- 1 25503 2174 29083 1122 03:58 cudnn_cnn_infer.h
-rw-r--r-- 1 25503 2174 29083 1122 03:58 cudnn_cnn_infer_v8.h
-rw-r--r-- 1 25503 2174 10217 1122 03:58 cudnn_cnn_train.h
-rw-r--r-- 1 25503 2174 10217 1122 03:58 cudnn_cnn_train_v8.h
-rw-r--r-- 1 25503 2174  2968 1122 03:58 cudnn.h
-rw-r--r-- 1 25503 2174 49631 1122 03:58 cudnn_ops_infer.h
-rw-r--r-- 1 25503 2174 49631 1122 03:58 cudnn_ops_infer_v8.h
-rw-r--r-- 1 25503 2174 25733 1122 03:58 cudnn_ops_train.h
-rw-r--r-- 1 25503 2174 25733 1122 03:58 cudnn_ops_train_v8.h
-rw-r--r-- 1 25503 2174  2968 1122 03:58 cudnn_v8.h
-rw-r--r-- 1 25503 2174  3113 1122 03:58 cudnn_version.h
-rw-r--r-- 1 25503 2174  3113 1122 03:58 cudnn_version_v8.h
root@hk-MZ32-AR0-00:~# cp  -P  cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/*   /usr/local/cuda/lib64/

root@hk-MZ32-AR0-00:~# cp  -P  cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/*  /usr/local/cuda/include/
root@hk-MZ32-AR0-00:~# ll /usr/local/cuda/lib64/libcudnn* 
lrwxrwxrwx 1 root root        23 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_infer.so -> libcudnn_adv_infer.so.8*
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_infer.so.8 -> libcudnn_adv_infer.so.8.7.0*
-rwxr-xr-x 1 root root 130381904 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_infer.so.8.7.0*
-rw-r--r-- 1 root root 132979922 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_infer_static.a
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_infer_static_v8.a -> libcudnn_adv_infer_static.a
lrwxrwxrwx 1 root root        23 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_train.so -> libcudnn_adv_train.so.8*
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_train.so.8 -> libcudnn_adv_train.so.8.7.0*
-rwxr-xr-x 1 root root 121095120 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_train.so.8.7.0*
-rw-r--r-- 1 root root 123566296 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_train_static.a
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_adv_train_static_v8.a -> libcudnn_adv_train_static.a
lrwxrwxrwx 1 root root        23 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_infer.so -> libcudnn_cnn_infer.so.8*
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_infer.so.8 -> libcudnn_cnn_infer.so.8.7.0*
-rwxr-xr-x 1 root root 639185544 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_infer.so.8.7.0*
-rw-r--r-- 1 root root 829548950 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_infer_static.a
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_infer_static_v8.a -> libcudnn_cnn_infer_static.a
lrwxrwxrwx 1 root root        23 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_train.so -> libcudnn_cnn_train.so.8*
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_train.so.8 -> libcudnn_cnn_train.so.8.7.0*
-rwxr-xr-x 1 root root 102197000 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_train.so.8.7.0*
-rw-r--r-- 1 root root 153525776 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_train_static.a
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_cnn_train_static_v8.a -> libcudnn_cnn_train_static.a
lrwxrwxrwx 1 root root        23 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_infer.so -> libcudnn_ops_infer.so.8*
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_infer.so.8 -> libcudnn_ops_infer.so.8.7.0*
-rwxr-xr-x 1 root root  97489336 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_infer.so.8.7.0*
-rw-r--r-- 1 root root 100636906 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_infer_static.a
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_infer_static_v8.a -> libcudnn_ops_infer_static.a
lrwxrwxrwx 1 root root        23 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_train.so -> libcudnn_ops_train.so.8*
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_train.so.8 -> libcudnn_ops_train.so.8.7.0*
-rwxr-xr-x 1 root root  74703096 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_train.so.8.7.0*
-rw-r--r-- 1 root root  75156862 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_train_static.a
lrwxrwxrwx 1 root root        27 210 17:39 /usr/local/cuda/lib64/libcudnn_ops_train_static_v8.a -> libcudnn_ops_train_static.a
lrwxrwxrwx 1 root root        13 210 17:39 /usr/local/cuda/lib64/libcudnn.so -> libcudnn.so.8*
lrwxrwxrwx 1 root root        17 210 17:39 /usr/local/cuda/lib64/libcudnn.so.8 -> libcudnn.so.8.7.0*
-rwxr-xr-x 1 root root    150200 210 17:39 /usr/local/cuda/lib64/libcudnn.so.8.7.0*
root@hk-MZ32-AR0-00:~# ll /usr/local/cuda/lib64/libcudnn*   | wc -l
33
root@hk-MZ32-AR0-00:~# ll cudnn-linux-x86_64-8.7.0.84_cuda11-archive/
include/ lib/     LICENSE  
root@hk-MZ32-AR0-00:~# ll cudnn-linux-x86_64-8.7.0.84_cuda11-archive/lib/*  |wc -l
33



root@hk-MZ32-AR0-00:~# ll /usr/local/cuda/include/cudn*   
-rw-r--r-- 1 root root 29025 210 17:39 /usr/local/cuda/include/cudnn_adv_infer.h
-rw-r--r-- 1 root root 29025 210 17:39 /usr/local/cuda/include/cudnn_adv_infer_v8.h
-rw-r--r-- 1 root root 27700 210 17:39 /usr/local/cuda/include/cudnn_adv_train.h
-rw-r--r-- 1 root root 27700 210 17:39 /usr/local/cuda/include/cudnn_adv_train_v8.h
-rw-r--r-- 1 root root 24727 210 17:39 /usr/local/cuda/include/cudnn_backend.h
-rw-r--r-- 1 root root 24727 210 17:39 /usr/local/cuda/include/cudnn_backend_v8.h
-rw-r--r-- 1 root root 29083 210 17:39 /usr/local/cuda/include/cudnn_cnn_infer.h
-rw-r--r-- 1 root root 29083 210 17:39 /usr/local/cuda/include/cudnn_cnn_infer_v8.h
-rw-r--r-- 1 root root 10217 210 17:39 /usr/local/cuda/include/cudnn_cnn_train.h
-rw-r--r-- 1 root root 10217 210 17:39 /usr/local/cuda/include/cudnn_cnn_train_v8.h
-rw-r--r-- 1 root root  2968 210 17:39 /usr/local/cuda/include/cudnn.h
-rw-r--r-- 1 root root 49631 210 17:39 /usr/local/cuda/include/cudnn_ops_infer.h
-rw-r--r-- 1 root root 49631 210 17:39 /usr/local/cuda/include/cudnn_ops_infer_v8.h
-rw-r--r-- 1 root root 25733 210 17:39 /usr/local/cuda/include/cudnn_ops_train.h
-rw-r--r-- 1 root root 25733 210 17:39 /usr/local/cuda/include/cudnn_ops_train_v8.h
-rw-r--r-- 1 root root  2968 210 17:39 /usr/local/cuda/include/cudnn_v8.h
-rw-r--r-- 1 root root  3113 210 17:39 /usr/local/cuda/include/cudnn_version.h
-rw-r--r-- 1 root root  3113 210 17:39 /usr/local/cuda/include/cudnn_version_v8.h
root@hk-MZ32-AR0-00:~# ll /usr/local/cuda/include/cudn*    |wc  -l
18
root@hk-MZ32-AR0-00:~# ll cudnn-linux-x86_64-8.7.0.84_cuda11-archive/include/* | wc -l 
18

4. 安装docker环境

root@hk-MZ32-AR0-00:~# curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

root@hk-MZ32-AR0-00:~# add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

root@hk-MZ32-AR0-00:~# apt-get -y install docker-ce

5. 安装nvidia-docker2

5.1 ubuntu系统安装

root@hk-MZ32-AR0-00:~# curl -s -L https://nvidia.github.io/nvidia-docker/$(. /etc/os-release;echo $ID$VERSION_ID)/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
deb https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/$(ARCH) /
#deb https://nvidia.github.io/libnvidia-container/experimental/ubuntu18.04/$(ARCH) /
deb https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/$(ARCH) /
#deb https://nvidia.github.io/nvidia-container-runtime/experimental/ubuntu18.04/$(ARCH) /
deb https://nvidia.github.io/nvidia-docker/ubuntu18.04/$(ARCH) /


root@hk-MZ32-AR0-00:~# apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
命中:2 https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease                                                                                                        
获取:3 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]                                                                                                     
命中:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease                                                                                                             
获取:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [88.7 kB]                                                                                           
获取:6 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                                      
获取:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [83.3 kB]                                                                                         
获取:8 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  InRelease [1,484 B]                                                                             
命中:9 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease                                                                             
获取:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [88.7 kB]                                                              
获取:11 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]                                                                   
获取:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed InRelease [242 kB]                                         
命中:13 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal InRelease                                                                
命中:14 https://linux.teamviewer.com/deb stable InRelease                                                                                   
获取:15 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main i386 Packages [1,604 kB]
获取:16 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [83.3 kB]             
获取:17 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 Packages [2,909 kB]
获取:18 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [76.8 kB]           
获取:19 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 DEP-11 Metadata [297 kB]                     
获取:20 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [302 kB]                
获取:21 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]                    
获取:22 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main amd64 DEP-11 Metadata [8,108 B]     
获取:23 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [10.0 kB]                       
获取:24 https://nvidia.github.io/libnvidia-container/stable/ubuntu22.04/amd64  InRelease [1,484 B]                                  
获取:25 http://mirrors.aliyun.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [61.0 kB]
获取:26 http://mirrors.aliyun.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
获取:27 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 Packages [2,909 kB] 
获取:28 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main amd64 DEP-11 Metadata [76.8 kB]
获取:29 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe amd64 DEP-11 Metadata [61.1 kB]               
获取:30 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]            
获取:31 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu22.04/amd64  InRelease [1,481 B]                     
获取:32 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed/main Sources [81.3 kB]                   
获取:33 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed/main Translation-en [38.8 kB]
获取:34 https://nvidia.github.io/nvidia-docker/ubuntu22.04/amd64  InRelease [1,474 B]       
获取:35 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed/main amd64 DEP-11 Metadata [6,552 B]         
获取:36 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  Packages [22.3 kB]
获取:37 https://nvidia.github.io/libnvidia-container/stable/ubuntu22.04/amd64  Packages [22.3 kB]
获取:38 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu22.04/amd64  Packages [7,416 B]
获取:39 https://nvidia.github.io/nvidia-docker/ubuntu22.04/amd64  Packages [4,488 B]        
获取:40 http://mirrors.aliyun.com/ubuntu bionic-updates/main i386 Packages [1,604 kB]                                                                                           
获取:41 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [297 kB]                                                                                     
获取:42 http://mirrors.aliyun.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [302 kB]                                                                                 
获取:43 http://mirrors.aliyun.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]                                                                              
获取:44 http://mirrors.aliyun.com/ubuntu bionic-proposed/main Sources [81.3 kB]                                                                                                 
获取:45 http://mirrors.aliyun.com/ubuntu bionic-proposed/main Translation-en [38.8 kB]                                                                                          
获取:46 http://mirrors.aliyun.com/ubuntu bionic-proposed/main amd64 DEP-11 Metadata [6,516 B]                                                                                   
获取:47 http://mirrors.aliyun.com/ubuntu bionic-backports/main amd64 DEP-11 Metadata [8,092 B]                                                                                  
获取:48 http://mirrors.aliyun.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [10.1 kB]                                                                              
已下载 11.9 MB,耗时 11(1,115 kB/s)                                                                                                                                          
正在读取软件包列表... 2%
正在读取软件包列表... 完成
root@test:/etc/apt/sources.list.d# 
root@test:/etc/apt/sources.list.d# apt-get install nvidia-docker2
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  libevent-2.1-7 libnatpmp1 libxvmc1 transmission-common
使用'apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  libnvidia-container-tools libnvidia-container1 nvidia-container-toolkit nvidia-container-toolkit-base
下列【新】软件包将被安装:
  libnvidia-container-tools libnvidia-container1 nvidia-container-toolkit nvidia-container-toolkit-base nvidia-docker2
升级了 0 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 80 个软件包未被升级。
需要下载 3,773 kB 的归档。
解压缩后会消耗 14.6 MB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  libnvidia-container1 1.12.0-1 [927 kB]
获取:2 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  libnvidia-container-tools 1.12.0-1 [24.5 kB]                                                      
获取:3 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  nvidia-container-toolkit-base 1.12.0-1 [2,066 kB]                                                 
获取:4 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  nvidia-container-toolkit 1.12.0-1 [750 kB]                                                        
获取:5 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  nvidia-docker2 2.12.0-1 [5,544 B]                                                                 
已下载 3,773 kB,耗时 213(28.3 kB/s)                                                                                                                                      
正在选中未选择的软件包 libnvidia-container1:amd64。
(正在读取数据库 ... 系统当前共安装有 202374 个文件和目录。)
准备解压 .../libnvidia-container1_1.12.0-1_amd64.deb  ...
正在解压 libnvidia-container1:amd64 (1.12.0-1) ...
正在选中未选择的软件包 libnvidia-container-tools。
准备解压 .../libnvidia-container-tools_1.12.0-1_amd64.deb  ...
正在解压 libnvidia-container-tools (1.12.0-1) ...
正在选中未选择的软件包 nvidia-container-toolkit-base。
准备解压 .../nvidia-container-toolkit-base_1.12.0-1_amd64.deb  ...
正在解压 nvidia-container-toolkit-base (1.12.0-1) ...
正在选中未选择的软件包 nvidia-container-toolkit。
准备解压 .../nvidia-container-toolkit_1.12.0-1_amd64.deb  ...
正在解压 nvidia-container-toolkit (1.12.0-1) ...
正在选中未选择的软件包 nvidia-docker2。
准备解压 .../nvidia-docker2_2.12.0-1_all.deb  ...
正在解压 nvidia-docker2 (2.12.0-1) ...
正在设置 nvidia-container-toolkit-base (1.12.0-1) ...
正在设置 libnvidia-container1:amd64 (1.12.0-1) ...
正在设置 libnvidia-container-tools (1.12.0-1) ...
正在设置 nvidia-container-toolkit (1.12.0-1) ...
正在设置 nvidia-docker2 (2.12.0-1) ...
正在处理用于 libc-bin (2.31-0ubuntu9.7) 的触发器 ...



root@hk-MZ32-AR0-00:~# systemctl restart docker

5.2 centos系统安装

[root@bj ~]# sudo yum install -y nvidia-docker2
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                                      | 6.2 kB  00:00:00     
 * base: mirrors.163.com
 * epel: mirrors.bfsu.edu.cn
 * extras: mirrors.ustc.edu.cn
 * updates: mirrors.ustc.edu.cn
base                                                                                                                                                      | 3.6 kB  00:00:00     
docker-ce-stable                                                                                                                                          | 3.5 kB  00:00:00     
extras                                                                                                                                                    | 2.9 kB  00:00:00     
libnvidia-container/x86_64/signature                                                                                                                      |  833 B  00:00:00     
Retrieving key from https://nvidia.github.io/libnvidia-container/gpgkey
Importing GPG key 0xF796ECB0:
 Userid     : "NVIDIA CORPORATION (Open Source Projects) <cudatools@nvidia.com>"
 Fingerprint: c95b 321b 61e8 8c18 09c4 f759 ddca e044 f796 ecb0
 From       : https://nvidia.github.io/libnvidia-container/gpgkey
libnvidia-container/x86_64/signature                                                                                                                      | 2.1 kB  00:00:00 !!! 
nvidia-container-runtime/x86_64/signature                                                                                                                 |  833 B  00:00:00     
Retrieving key from https://nvidia.github.io/nvidia-container-runtime/gpgkey
Importing GPG key 0xF796ECB0:
 Userid     : "NVIDIA CORPORATION (Open Source Projects) <cudatools@nvidia.com>"
 Fingerprint: c95b 321b 61e8 8c18 09c4 f759 ddca e044 f796 ecb0
 From       : https://nvidia.github.io/nvidia-container-runtime/gpgkey
nvidia-container-runtime/x86_64/signature                                                                                                                 | 2.1 kB  00:00:00 !!! 
nvidia-docker/x86_64/signature                                                                                                                            |  833 B  00:00:00     
Retrieving key from https://nvidia.github.io/nvidia-docker/gpgkey
Importing GPG key 0xF796ECB0:
 Userid     : "NVIDIA CORPORATION (Open Source Projects) <cudatools@nvidia.com>"
 Fingerprint: c95b 321b 61e8 8c18 09c4 f759 ddca e044 f796 ecb0
 From       : https://nvidia.github.io/nvidia-docker/gpgkey
nvidia-docker/x86_64/signature                                                                                                                            | 2.1 kB  00:00:00 !!! 
teamviewer/x86_64/signature                                                                                                                               |  867 B  00:00:00     
teamviewer/x86_64/signature                                                                                                                               | 2.5 kB  00:00:00 !!! 
updates                                                                                                                                                   | 2.9 kB  00:00:00     
(1/3): nvidia-container-runtime/x86_64/primary                                                                                                            |  11 kB  00:00:01     
(2/3): nvidia-docker/x86_64/primary                                                                                                                       | 8.0 kB  00:00:01     
(3/3): libnvidia-container/x86_64/primary                                                                                                                 |  27 kB  00:00:03     
libnvidia-container                                                                                                                                                      171/171
nvidia-container-runtime                                                                                                                                                   71/71
nvidia-docker                                                                                                                                                              54/54
Resolving Dependencies
--> Running transaction check
---> Package nvidia-docker2.noarch 0:2.11.0-1 will be installed
--> Processing Dependency: nvidia-container-toolkit >= 1.10.0-1 for package: nvidia-docker2-2.11.0-1.noarch
--> Running transaction check
---> Package nvidia-container-toolkit.x86_64 0:1.11.0-1 will be installed
--> Processing Dependency: nvidia-container-toolkit-base = 1.11.0-1 for package: nvidia-container-toolkit-1.11.0-1.x86_64
--> Processing Dependency: libnvidia-container-tools < 2.0.0 for package: nvidia-container-toolkit-1.11.0-1.x86_64
--> Processing Dependency: libnvidia-container-tools >= 1.11.0-1 for package: nvidia-container-toolkit-1.11.0-1.x86_64
--> Running transaction check
---> Package libnvidia-container-tools.x86_64 0:1.11.0-1 will be installed
--> Processing Dependency: libnvidia-container1(x86-64) >= 1.11.0-1 for package: libnvidia-container-tools-1.11.0-1.x86_64
--> Processing Dependency: libnvidia-container.so.1(NVC_1.0)(64bit) for package: libnvidia-container-tools-1.11.0-1.x86_64
--> Processing Dependency: libnvidia-container.so.1()(64bit) for package: libnvidia-container-tools-1.11.0-1.x86_64
---> Package nvidia-container-toolkit-base.x86_64 0:1.11.0-1 will be installed
--> Running transaction check
---> Package libnvidia-container1.x86_64 0:1.11.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
 Package                                                 Arch                             Version                            Repository                                     Size
=================================================================================================================================================================================
Installing:
 nvidia-docker2                                          noarch                           2.11.0-1                           libnvidia-container                           8.7 k
Installing for dependencies:
 libnvidia-container-tools                               x86_64                           1.11.0-1                           libnvidia-container                            50 k
 libnvidia-container1                                    x86_64                           1.11.0-1                           libnvidia-container                           1.0 M
 nvidia-container-toolkit                                x86_64                           1.11.0-1                           libnvidia-container                           780 k
 nvidia-container-toolkit-base                           x86_64                           1.11.0-1                           libnvidia-container                           2.5 M

Transaction Summary
=================================================================================================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 4.3 M
Installed size: 12 M
Downloading packages:
(1/5): libnvidia-container-tools-1.11.0-1.x86_64.rpm                                                                                                      |  50 kB  00:00:01     
(2/5): libnvidia-container1-1.11.0-1.x86_64.rpm                                                                                                           | 1.0 MB  00:00:03     
(3/5): nvidia-container-toolkit-1.11.0-1.x86_64.rpm                                                                                                       | 780 kB  00:00:03     
(4/5): nvidia-docker2-2.11.0-1.noarch.rpm                                                                                                                 | 8.7 kB  00:00:00     
(5/5): nvidia-container-toolkit-base-1.11.0-1.x86_64.rpm                                                                                                  | 2.5 MB  00:00:43     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                             94 kB/s | 4.3 MB  00:00:46     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : nvidia-container-toolkit-base-1.11.0-1.x86_64                                                                                                                 1/5 
  Installing : libnvidia-container1-1.11.0-1.x86_64                                                                                                                          2/5 
  Installing : libnvidia-container-tools-1.11.0-1.x86_64                                                                                                                     3/5 
  Installing : nvidia-container-toolkit-1.11.0-1.x86_64                                                                                                                      4/5 
  Installing : nvidia-docker2-2.11.0-1.noarch                                                                                                                                5/5 
  Verifying  : libnvidia-container1-1.11.0-1.x86_64                                                                                                                          1/5 
  Verifying  : nvidia-container-toolkit-base-1.11.0-1.x86_64                                                                                                                 2/5 
  Verifying  : nvidia-container-toolkit-1.11.0-1.x86_64                                                                                                                      3/5 
  Verifying  : libnvidia-container-tools-1.11.0-1.x86_64                                                                                                                     4/5 
  Verifying  : nvidia-docker2-2.11.0-1.noarch                                                                                                                                5/5 

Installed:
  nvidia-docker2.noarch 0:2.11.0-1                                                                                                                                               

Dependency Installed:
  libnvidia-container-tools.x86_64 0:1.11.0-1 libnvidia-container1.x86_64 0:1.11.0-1 nvidia-container-toolkit.x86_64 0:1.11.0-1 nvidia-container-toolkit-base.x86_64 0:1.11.0-1

Complete!
  • 若是centos系统,需要用yum安装过nvidia-docker2,虽然已经安装过nvidia-container-toolkit,但是在容器中使用gpu的时候报错,更新安装 nvidia-container-toolkit

在这里插入图片描述

# 设置yum源:nvidia-container-toolkit.repo


[root@bj ~]# distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
>    && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.repo | tee /etc/yum.repos.d/nvidia-container-toolkit.repo
[libnvidia-container]
name=libnvidia-container
baseurl=https://nvidia.github.io/libnvidia-container/stable/centos7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://nvidia.github.io/libnvidia-container/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

[libnvidia-container-experimental]
name=libnvidia-container-experimental
baseurl=https://nvidia.github.io/libnvidia-container/experimental/centos7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=0
gpgkey=https://nvidia.github.io/libnvidia-container/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt


[root@bj ~]# yum install -y nvidia-container-toolkit
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * epel: mirrors.ustc.edu.cn
 * extras: mirrors.ustc.edu.cn
 * updates: mirrors.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package nvidia-container-toolkit.x86_64 0:1.11.0-1 will be updated
---> Package nvidia-container-toolkit.x86_64 0:1.12.0-0.1.rc.3 will be an update
--> Processing Dependency: nvidia-container-toolkit-base = 1.12.0-0.1.rc.3 for package: nvidia-container-toolkit-1.12.0-0.1.rc.3.x86_64
--> Processing Dependency: libnvidia-container-tools >= 1.12.0-0.1.rc.3 for package: nvidia-container-toolkit-1.12.0-0.1.rc.3.x86_64
--> Running transaction check
---> Package libnvidia-container-tools.x86_64 0:1.11.0-1 will be updated
---> Package libnvidia-container-tools.x86_64 0:1.12.0-0.1.rc.3 will be an update
--> Processing Dependency: libnvidia-container1(x86-64) >= 1.12.0-0.1.rc.3 for package: libnvidia-container-tools-1.12.0-0.1.rc.3.x86_64
---> Package nvidia-container-toolkit-base.x86_64 0:1.11.0-1 will be updated
---> Package nvidia-container-toolkit-base.x86_64 0:1.12.0-0.1.rc.3 will be an update
--> Running transaction check
---> Package libnvidia-container1.x86_64 0:1.11.0-1 will be updated
---> Package libnvidia-container1.x86_64 0:1.12.0-0.1.rc.3 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
 Package                                            Arch                        Version                              Repository                                             Size
=================================================================================================================================================================================
Updating:
 nvidia-container-toolkit                           x86_64                      1.12.0-0.1.rc.3                      libnvidia-container-experimental                      797 k
Updating for dependencies:
 libnvidia-container-tools                          x86_64                      1.12.0-0.1.rc.3                      libnvidia-container-experimental                       50 k
 libnvidia-container1                               x86_64                      1.12.0-0.1.rc.3                      libnvidia-container-experimental                      1.0 M
 nvidia-container-toolkit-base                      x86_64                      1.12.0-0.1.rc.3                      libnvidia-container-experimental                      3.4 M

Transaction Summary
=================================================================================================================================================================================
Upgrade  1 Package (+3 Dependent packages)

Total download size: 5.2 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/4): libnvidia-container-tools-1.12.0-0.1.rc.3.x86_64.rpm                                                                                               |  50 kB  00:00:00     
(2/4): nvidia-container-toolkit-1.12.0-0.1.rc.3.x86_64.rpm                                                                                                | 797 kB  00:00:00     
(3/4): libnvidia-container1-1.12.0-0.1.rc.3.x86_64.rpm                                                                                                    | 1.0 MB  00:00:02     
(4/4): nvidia-container-toolkit-base-1.12.0-0.1.rc.3.x86_64.rpm                                                                                           | 3.4 MB  00:00:00     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                            2.0 MB/s | 5.2 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : nvidia-container-toolkit-base-1.12.0-0.1.rc.3.x86_64                                                                                                          1/8 
  Updating   : libnvidia-container1-1.12.0-0.1.rc.3.x86_64                                                                                                                   2/8 
  Updating   : libnvidia-container-tools-1.12.0-0.1.rc.3.x86_64                                                                                                              3/8 
  Updating   : nvidia-container-toolkit-1.12.0-0.1.rc.3.x86_64                                                                                                               4/8 
  Cleanup    : nvidia-container-toolkit-1.11.0-1.x86_64                                                                                                                      5/8 
  Cleanup    : libnvidia-container-tools-1.11.0-1.x86_64                                                                                                                     6/8 
  Cleanup    : libnvidia-container1-1.11.0-1.x86_64                                                                                                                          7/8 
  Cleanup    : nvidia-container-toolkit-base-1.11.0-1.x86_64                                                                                                                 8/8 
  Verifying  : libnvidia-container1-1.12.0-0.1.rc.3.x86_64                                                                                                                   1/8 
  Verifying  : nvidia-container-toolkit-base-1.12.0-0.1.rc.3.x86_64                                                                                                          2/8 
  Verifying  : libnvidia-container-tools-1.12.0-0.1.rc.3.x86_64                                                                                                              3/8 
  Verifying  : nvidia-container-toolkit-1.12.0-0.1.rc.3.x86_64                                                                                                               4/8 
  Verifying  : libnvidia-container-tools-1.11.0-1.x86_64                                                                                                                     5/8 
  Verifying  : nvidia-container-toolkit-base-1.11.0-1.x86_64                                                                                                                 6/8 
  Verifying  : nvidia-container-toolkit-1.11.0-1.x86_64                                                                                                                      7/8 
  Verifying  : libnvidia-container1-1.11.0-1.x86_64                                                                                                                          8/8 

Updated:
  nvidia-container-toolkit.x86_64 0:1.12.0-0.1.rc.3                                                                                                                              

Dependency Updated:
  libnvidia-container-tools.x86_64 0:1.12.0-0.1.rc.3         libnvidia-container1.x86_64 0:1.12.0-0.1.rc.3         nvidia-container-toolkit-base.x86_64 0:1.12.0-0.1.rc.3        

Complete!
[root@bj ~]# systemctl restart docker  

6. 测试docker容调用GPU服务

root@hk-MZ32-AR0-00:~# docker run --rm --gpus all 97cca2bac989 nvidia-smi
Sat Feb 11 07:13:48 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.106.00   Driver Version: 460.106.00   CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            Off  | 00000000:04:00.0 Off |                    0 |
| N/A   47C    P0    27W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  Tesla T4            Off  | 00000000:06:00.0 Off |                    0 |
| N/A   43C    P0    28W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  Tesla T4            Off  | 00000000:0D:00.0 Off |                    0 |
| N/A   49C    P0    28W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  Tesla T4            Off  | 00000000:0F:00.0 Off |                    0 |
| N/A   45C    P0    26W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   4  Tesla T4            Off  | 00000000:17:00.0 Off |                    0 |
| N/A   48C    P0    27W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   5  Tesla T4            Off  | 00000000:19:00.0 Off |                    0 |
| N/A   49C    P0    28W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   6  Tesla T4            Off  | 00000000:21:00.0 Off |                    0 |
| N/A   45C    P0    26W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   7  Tesla T4            Off  | 00000000:23:00.0 Off |                    0 |
| N/A   45C    P0    28W /  70W |      0MiB / 15109MiB |      5%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/338344.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Zabbix 构建监控告警平台(三)

Zabbix User parametersZabbix Trigger1.Zabbix User parameters 1.1即自定义KEY 注意&#xff1a;mysql安装在被监测主机 [rootlocalhost ~]# yum -y install mariadb-server mariadb [rootlocalhost ~]# systemctl start mariadb [rootlocalhost ~]# mysqladmin -uroot statu…

[electron] 一 vue3.2+vite+electron 项目集成

一 开发环境系统&#xff1a;windows开发工具&#xff1a; git , vscode&#xff0c;termial环境依赖&#xff1a; node, npm 二 步骤2.1 通过vite 创建vue项目通过 终端执行命令&#xff0c;选择 模板 vuenpm init vite cd 项目目录 npm install npm run dev2.2 集成 electro…

T06 成绩排序

查找和排序 题目&#xff1a;输入任意&#xff08;用户&#xff0c;成绩&#xff09;序列&#xff0c;可以获得成绩从高到低或从低到高的排列,相同成绩 都按先录入排列在前的规则处理。 示例&#xff1a; jack 70 peter 96 Tom 70 smith 67 从高到低 成…

LC-70-爬楼梯

原题链接&#xff1a;爬楼梯 个人解法 思路&#xff1a; 动态规划 状态表示&#xff1a;f[i]表示走到第n阶台阶有几种方法 状态转移&#xff1a;f[i] f[i -1] f[i - 2] 这实际上就是斐波那契数列&#xff0c;通过转移可以看到&#xff0c;我们只用了三个变量&#xff0c;故…

Java、JSP职工人事管理系统设计与实现

技术&#xff1a;Java、JSP等摘要&#xff1a;现在随着我们这个社会的计算机技术的快速发展&#xff0c;计算机在企业管理中得到普遍的应用&#xff0c;现在我们利用计算机在实现企业职工的管理越来越重要。当今社会是快速发展的信息社会&#xff0c;自动化信息的作用也变得越来…

Python 之 NumPy 简介和创建数组

文章目录一、NumPy 简介1. 为什么要使用 NumPy2. NumPy 数据类型3. NumPy 数组属性4. NumPy 的 ndarray 对象二、numpy.array() 创建数组1. 基础理论2. 基础操作演示3. numpy.array() 参数详解三、numpy.arange() 生成区间数组四、numpy.linspace() 创建等差数列五、numpy.logs…

第四章 Opencv图像色彩空间与通道

文章目录1.色彩空间1-1.RGB/BGR色彩空间1-2.GRAY色彩空间1-3.HSV色彩空间2.通道2-1.拆分通道&#xff1a;split()方法1.拆BGR色彩空间图像的通道2.拆HSV色彩空间图像的通道2-2.合并通道&#xff1a;merge()方法1.B、G、R 通道的合并2.H、S、V 通道的合并3.B、G、R、A 通道的合并…

M100嵌入式自动吞吐式读写器|电动读卡机如何通过C#程序读取社保卡号

M100嵌入式自动吞吐式读写器|电动读卡机是一款双保护门功能读卡器&#xff0c;第一层防尘防异物机械门&#xff0c;第二层电动门。 M100嵌入式自动吞吐式读写器|电动读卡机采用耐高温、耐磨擦、高强度、抗老化的复合型塑胶为主体&#xff0c;在走卡通道两侧镶有不锈钢金属&…

YUV数据和格式

一、YUV简介 1.YUV说明 YUV是一种颜色编码方法&#xff0c; 与RGB&#xff08;红 - 绿 - 蓝&#xff09;不同。 <1>Y表示亮度分量&#xff0c;也叫灰阶值&#xff1a;如果只显示Y&#xff0c;图片会是一张黑白照 <2>U&#xff08;Cb&#xff09;表示色度分量&…

2022年12月电子学会Python等级考试试卷(三级)答案解析

目录 一、单选题(共25题&#xff0c;共50分) 二、判断题(共10题&#xff0c;共20分) 三、编程题(共3题&#xff0c;共30分) 青少年软件编程&#xff08;Python&#xff09;等级考试试卷&#xff08;三级&#xff09; 一、单选题(共25题&#xff0c;共50分) 1. 列表L1中全是…

你知道ChatGPT能搞钱吗?哎呦喂,不知道,那没意思

这段时间&#xff0c;热度zui大的是什么&#xff1f;答案是—— &#x1f389;&#x1f389;ChatGPT&#x1f389;&#x1f389;。去年11月底上线&#xff0c;当时仅在AI和科技圈内小火了一把&#xff0c;没想到在今年春节后&#xff0c;火爆出圈。 ChatGPT的爆火&#xff0c;对…

微信小程序nodej‘s+vue警局便民服务管理系统

本文首先介绍了设计的背景与研究目的,其次介绍系统相关技术,重点叙述了系统功能分析以及详细设计,最后总结了系统的开发心得在Internet高速发展的今天,我们生活的各个领域都涉及到计算机的应用,其中包括“最多跑一次”微信小程序的网络应用,在外国小程序的使用已经是很普遍的方…

java多线程开发

1.并发和并行 并发&#xff1a;同一时间段内多个任务同时进行。 并行&#xff1a;同一时间点多个任务同时进行。 2.进程线程 进程&#xff08;Process&#xff09;&#xff1a;进程是程序的一次动态执行过程&#xff0c;它经历了从代码加载、执行、到执行完毕的一个完整过程…

当资深程序员深夜去“打劫”会发生什么?——打家劫舍详解

文章目录一、前言二、概述三、打家劫舍第一晚四、打家劫舍第二晚五、打家劫舍第三晚......一、前言 大家好久不见&#xff0c;正如标题所示&#xff0c;今天我不打算聊一些枯燥的算法理论&#xff0c;我们来聊一聊程序员有多厉害&#xff01; 注意&#xff01;&#xff01;&am…

JDBC(新版)

文章目录JDBC概念优势总结JDBC核心api和使用路线涉及具体核心类和接口DriverManagerConnectionstatement、preparedstatement、callablestatementResult核心API使用步骤总结基于statement演示查询基于statement方式问题基于preparedstatement的优化基于preparedstatement的curd…

浅谈动态代理

什么是动态代理&#xff1f;以下为个人理解:动态代理就是在程序运行的期间&#xff0c;动态地针对对象的方法进行增强操作。并且这个动作的执行者已经不是"this"对象了&#xff0c;而是我们创建的代理对象&#xff0c;这个代理对象就是类似中间人的角色&#xff0c;帮…

【论文】基于AI边缘计算的铁路行车视频监控智能识别研究

本文转载自《科技与创新》2022年第01期 作者&#xff1a;李博&#xff0c; 杨欣 单位&#xff1a;中国铁路武汉局集团有限公司麻城车务段 摘要 随着铁路信息化建设的不断推进&#xff0c;视频监控设备应用到越来越多岗位中&#xff0c;运用智能化手段管理工作人员必将成为一…

BiseNet v1论文及其代码详解

来源&#xff1a;投稿 作者&#xff1a;蓬蓬奇 编辑&#xff1a;学姐 BiSeNet v1说明&#xff1a; 文章链接&#xff1a;https://arxiv.org/abs/1808.00897 官方开源代码&#xff1a;https://github.com/CoinCheung/BiSeNet &#xff08;本文未使用&#xff09; 文章标题&am…

宝塔搭建实战php开源likeadmin通用管理admin端vue3源码(二)

大家好啊&#xff0c;我是测评君&#xff0c;欢迎来到web测评。 上一期给大家分享了server端的部署方式&#xff0c;今天来给大家分享admin端在本地搭建&#xff0c;与打包发布到宝塔的方法。感兴趣的朋友可以自行下载学习。 技术架构 vscode node16 vue3 elementPlus vit…

1627_MIT 6.828 PC硬件与x86编程幻灯片资料阅读

全部学习汇总&#xff1a; GreyZhang/g_unix: some basic learning about unix operating system. (github.com) 按照MIT 6.828的计划表继续往下走&#xff0c;看到了一份需要看的阅读资料&#xff0c;也就是这次整理的这一份幻灯片。其实&#xff0c;为了解决之前的疑惑相关的…