NVIDIA : Container Toolkit インストール2025/10/02 |
|
NVIDIA Container Toolkit をインストールすると、コンテナーから GPU を容易に利用可能となります。 |
|
| [1] | |
| [2] | |
| [3] | NVIDIA Container Toolkit をインストールします。 |
|
root@dlp:~#
root@dlp:~# curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /etc/apt/keyrings/nvidia-docker.key root@dlp:~# wget https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list -O /etc/apt/sources.list.d/nvidia-container-toolkit.list root@dlp:~# sed -i -e "s/^deb/deb \[signed-by=\/etc\/apt\/keyrings\/nvidia-docker.key\]/g" /etc/apt/sources.list.d/nvidia-container-toolkit.list
apt update root@dlp:~# apt -y install nvidia-container-toolkit root@dlp:~# systemctl restart docker |
| [4] | コンテナーからの [nvidia-smi] コマンドの利用方法です。 |
|
root@dlp:~# docker pull nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 root@dlp:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nvidia/cuda 12.4.1-cudnn-runtime-ubuntu22.04 a029a877f7e3 17 months ago 3.32GBroot@dlp:~# docker run --gpus all nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 nvidia-smi ========== == CUDA == ========== CUDA Version 12.4.1 Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. This container image and its contents are governed by the NVIDIA Deep Learning Container License. By pulling and using the container, you accept the terms and conditions of this license: https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience. Wed Oct 1 05:02:21 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 550.163.01 Driver Version: 550.163.01 CUDA Version: 12.4 | |-----------------------------------------+------------------------+----------------------+ | 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 RTX 3060 Off | 00000000:05:00.0 Off | N/A | | 0% 57C P8 11W / 170W | 2MiB / 12288MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ # 対話セッションから [nvidia-smi] root@dlp:~# docker run --gpus all -it nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 /bin/bash root@d8dae0757b8b:/# nvidia-smi Wed Oct 1 05:04:01 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 550.163.01 Driver Version: 550.163.01 CUDA Version: 12.4 | |-----------------------------------------+------------------------+----------------------+ | 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 RTX 3060 Off | 00000000:05:00.0 Off | N/A | | 0% 58C P8 11W / 170W | 2MiB / 12288MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ |
| Sponsored Link |
|
|