paulwong

国内网络环境安装docker+container toolkit

操作系统为centos 9.

先安装驱动程序

https://www.nvidia.cn/drivers/lookup/ 中查找对应的驱动程序下载到本地,再运行
#切换成文字界面
sudo systemctl set-default multi-user.target
sudo reboot

sh NVIDIA
-Linux-x86_64-550.107.02.run

#切换成图形界面
sudo systemctl set-default graphical.target
sudo reboot

安装docker:

yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

yum install -y yum-utils
yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo

yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo nvidia-ctk runtime configure --runtime=docker

改镜像地址:

[paul@paul-pc ~]$ cat /etc/docker/daemon.json
{  
    
"registry-mirrors"[
        "http://xxx.xxx.xxx"
    ]
,
    
"runtimes": {
        
"nvidia": {
            
"args"[],
            
"path""nvidia-container-runtime"
        }
    }
}

安装container-took-kit:

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Rocky&target_version=9&target_type=runfile_local 中找到对应的container-took-kit,下载到本地,再运行
sh cuda_12.6.0_560.28.03_linux.run

验证:

sudo docker run --rm -it --gpus all ubuntu  nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.107.02             Driver Version: 550.107.02     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 2080 Ti     Off |   00000000:01:00.0  On |                  N/A |
| 62%   36C    P8              4W /  260W |     256MiB /  22528MiB |      1%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA GeForce RTX 2080 Ti     Off |   00000000:02:00.0 Off |                  N/A |
| 64%   35C    P8              5W /  260W |       9MiB /  22528MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      2657      G   /usr/libexec/Xorg                              99MiB |
|    0   N/A  N/A      2735      G   /usr/bin/gnome-shell                           38MiB |
|    0   N/A  N/A      3502      G   /usr/lib64/firefox/firefox                    111MiB |
|    1   N/A  N/A      2657      G   /usr/libexec/Xorg                               4MiB |
+-----------------------------------------------------------------------------------------+
参考地址:
https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/

posted on 2024-08-15 10:49 paulwong 阅读(102) 评论(0)  编辑  收藏 所属分类: DOCKER


只有注册用户登录后才能发表评论。


网站导航: