不为别的,只为做一个连自己都羡慕的人

ubuntu安装nvidia-docker2

1.配置源:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

2.安装:nvidia-docker有安装

sudo apt install nvidia-docker2

3. 然后/etc/docker/daemon.json里的内容如下:

{
    "registry-mirrors": ["https://f1z25q5p.mirror.aliyuncs.com"],
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

4.重启docker

sudo systemctl daemon-reload
sudo systemctl restart docker

5.测试nvidia-docker2是否安装成功

docker run --runtime=nvidia --rm nvidia/cuda:10.2-devel nvidia-smi

 

posted @ 2022-09-17 11:55  升级打怪  阅读(1475)  评论(0编辑  收藏  举报