본문 바로가기
Development/Docker

[Docker] nvidia-docker2 설치하기 (Ubuntu 20.04)

by 성딱이 2021. 9. 30.
반응형

 

1.  Setting Up Docker (이미 도커가 설치 되어있는경우 이 과정을 Skip하자!!!!)

$ curl https://get.docker.com | sh \
  && sudo systemctl --now enable docker

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 18617  100 18617    0     0   371k      0 --:--:-- --:--:-- --:--:--  371k
# Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be
Warning: the "docker" command appears to already exist on this system.

If you already have Docker installed, this script can cause trouble, which is
why we're displaying this warning and provide the opportunity to cancel the
installation.

If you installed the current Docker package using this script and are using it
again to update Docker, you can safely ignore this message.

You may press Ctrl+C now to abort this script.
+ sleep 20

 

 

2. Setting up NVIDIA Container Toolkit (안정적인 레포지토리와 GPG Key 셋업)

$ 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

 

 

3. apt 패키지 업데이트

$ sudo apt-get update

 

 

4. nvidia-docker 설치

$ sudo apt-get install -y nvidia-docker2

 

 

5. Docker 재실행

$ sudo systemctl restart docker

 

 

6. 테스트

$ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

 

 

 

출처 : https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html

 

Installation Guide — NVIDIA Cloud Native Technologies documentation

On RHEL 7, install the nvidia-container-toolkit package (and dependencies) after updating the package listing: Restart the Docker daemon to complete the installation after setting the default runtime: Note Depending on how your RHEL 7 system is configured

docs.nvidia.com

 

 

반응형

댓글