安装docker
参考这篇文章:Ubuntu22.04安装docker - 掘金
安装nvidia-docker
参考这篇文章:Ubuntu 22.04 LTS : NVIDIA Container Toolkit : Install : Server World
流程:
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu22.04/nvidia-docker.list > /etc/apt/sources.list.d/nvidia-docker.list
apt update
apt -y install nvidia-container-toolkit
systemctl restart docker
进行测试(拉取nvidia cuda11.5镜像并运行nvidia-smi)
docker run --gpus all nvidia/cuda:11.5.2-base-ubuntu20.04 nvidia-smi
# pull Cuda 10.2 image and connect to the interactive session, then run [nvidia-smi]
root@dlp:~# docker run -it --gpus all nvidia/cuda:10.2-base-ubuntu18.04 bash
root@08ae46c44932:/# nvidia-smi
Mon Aug 29 06:04:46 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.85.02 Driver Version: 510.85.02 CUDA Version: 11.6 |
|-------------------------------+----------------------+----------------------+
| 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 NVIDIA GeForce ... Off | 00000000:05:00.0 Off | N/A |
| 0% 50C P5 10W / 120W | 0MiB / 6144MiB | 1% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
参考文章:
Ubuntu22.04安装docker - 掘金文章来源:https://www.toymoban.com/news/detail-785070.html
Ubuntu 22.04 LTS : NVIDIA Container Toolkit : Install : Server World文章来源地址https://www.toymoban.com/news/detail-785070.html
到了这里,关于Ubuntu22.04安装nvidia-docker的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!