Nvidia-docker2 install

Jinha Song·2021년 1월 7일
0

Ubuntu

다음 공식 문서를 참조: Docker Engine Utility for NVIDIA GPUs

Requirements

  • nvidia-docker 설치 전 CUDAdocker-ce 먼저 설치 후 진행

Remove previous version of docker

# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker

apt key 및 repository 추가

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 install

sudo apt-get install -y nvidia-docker2

Reload docker daemon configuration

sudo pkill -SIGHUP dockerd

docker 상에서 nvidia-smi 테스트

docker run --runtime=nvidia --rm nvidia/cuda:${VERSION} nvidia-smi
profile
Jinha Song

0개의 댓글