![4a71abec99fbcad04d67d1c702631197.png](https://i-blog.csdnimg.cn/blog_migrate/a4247f4252ba827798d27c4695c2059a.jpeg)
宿主机环境要求
1.nvidia-driver与cuda
# 查看驱动
nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.78 Driver Version: 410.78 CUDA Version: 10.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro RTX 5000 Off | 00000000:B3:00.0 On | Off |
| 33% 22C P8 2W / 230W | 414MiB / 16086MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 2849 G /usr/lib/xorg/Xorg 39MiB |
| 0 2961 G /usr/bin/gnome-shell 55MiB |
| 0 3813 G /usr/lib/xorg/Xorg 170MiB |
| 0 4400 G /usr/bin/gnome-shell 65MiB |
| 0 11281 G ...quest-channel-token=7490845094831916557 82MiB |
+-----------------------------------------------------------------------------+
#查看cuda版本
nvcc -V
上面可以看到显卡型号为 型号Quadro RTX 5000,
2.cudnn
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 6
#define CUDNN_PATCHLEVEL 4
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
#include "driver_types.h"
3.docker >= 19.03
4.nvidia-docker2
5.nvidia-container-runtime (nvidia-docker2默认安装了nvidia-container-runtime)
(base) root@xxribd-Precision-7920-Tower:/home/xxribd/# nvidia-docker version
NVIDIA Docker: 2.2.2
Client: Docker Engine - Community
Version: 19.03.7
API version: 1.40
Go version: go1.12.17
Git commit: 7141c199a2
Built: Wed Mar 4 01:22:36 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.7
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: 7141c199a2
Built: Wed Mar 4 01:21:08 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
nvidia:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
注意 cudnn, cuda, nvidia driver的版本一定要对应
配置宿主机需要的环境
安装nvidia-driver
首先查看一下自己的电脑需要怎样的驱动,我们可以先到 htt