1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu20.04にnvidia-docker runtimeをインストールする

Last updated at Posted at 2021-08-12

公式: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/nvidia-docker.html   

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
curl -s -L https://nvidia.github.io/nvidia-container-runtime/experimental/$distribution/nvidia-container-runtime.list | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list

sudo apt-get update -y
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

イメージは公式のdockerhubから選ぶ。

# 動作確認
sudo docker run --rm --gpus all nvidia/cuda:11.4.1-runtime-ubuntu20.04 nvidia-smi

docker-composeで扱いたい場合は nvidia-dockerをdocker-composeで動かす(ver3系) を参考に。

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?