0
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 5 years have passed since last update.

dockerでgpuを使用するためのnvidia-docker2インストールガイド

Posted at

概要

  • dockerでGPUを用いるためにはnvidia-docker2のインストールが必要.
  • nvidia-docker2のlinuxへのインストール方法が少々面倒だったので,自分用にメモ.

nvidia-docker2のインストール方法

installガイド
# リポジトリの登録
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

# nvidia-docker2のインストール
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

# 動作テスト
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

これで,dockerを起動する際にruntimeオプションを追加し,--runtime=nvidiaと記述すればdocker内でGPUが認識されます.

0
0
0

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
0
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?