最初にインストールプロセスを実行します
1. docker-ce リポジトリをセットアップします。
sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
2.containerd.io パッケージをインストールします。
sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm
3. docker-ce ソフトウェア パッケージをインストールします。
sudo yum install docker-ce -y
次のコマンドを使用して、Docker サービスが実行されていることを確認します。
sudo systemctl --now enable docker
最後に、hello-world コンテナーを実行して、Docker インストールをテストします。
sudo docker run --rm hello-world
以下のように表示されるのが正常です
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
4. nvidia-container-toolkit リポジトリと GPG キーをセットアップします。
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
実験用ブランチをリポジトリ リストに追加します。
yum-config-manager --enable libnvidia-container-experimental
5. パッケージリストを更新した後、nvidia-container-toolkit パッケージをインストールします。
sudo yum clean expire-cache
sudo yum install -y nvidia-container-toolkit
NVIDIA コンテナ ランタイムを認識するように Docker デーモンを構成します。
sudo nvidia-ctk runtime configure --runtime=docker
デフォルトのランタイムを設定した後、Docker デーモンを再起動してインストールを完了します。
sudo systemctl restart docker
この時点で、基本的な CUDA コンテナーを実行して、作業セットアップをテストできます。
sudo docker run --rm --runtime=nvidia --gpus all nvidia/cuda:12.1.1-base-centos7 nvidia-smi
これにより、次のようなコンソール出力が生成されるはずです。
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.30.02 Driver Version: 530.30.02 CUDA Version: 12.1 |
|-----------------------------------------+----------------------+----------------------+
| 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 GTX 1080 Ti Off| 00000000:01:00.0 Off | N/A |
| 20% 38C P0 57W / 250W| 0MiB / 11264MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
エラーの理由
仮想環境にはインストールできません
在第4步的储存库地址设置时使用了curl命令
而虚拟环境中的curl和本地源环境所使用的不是一个
所以储存库地址会设置错误
导致找不到nvidia-container-toolkit的软件包