디지털 라이프 電子的生活 My Digital Life/슈퍼컴퓨터 (HPC)

NGC(NVIDIA GPU Cloud)를 사용하기 위한 환경 설정하기

미친도사 2020. 6. 3. 18:04

For CentOS 7

Prepare nvidia-docker repository

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo

Prepare docker-ce repository

dist=$(. /etc/os-release; echo $ID)
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/$dist/docker-ce.repo

Install nvidia docker & docker-ce

yum install -y nvidia-container-toolkit docker-ce

systemctl enable docker
systemctl restart docker

Auth login to nvcr.io

echo "You need NGC API Key to login to nvcr.io"
echo "If you don't have, visit https://ngc.nvidia.com/setup/api-key after login to ngc.nvidia.com"
echo "Username should be $oauthtoken"
echo "Password should be a generated 'API Key'."
echo "[ENTER] to continue, CTRL-C to stop"
read x

docker login nvcr.io

 

 

For Ubuntu

sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt-get update && sudo apt-cache search docker-ce

sudo apt-get update && sudo apt-get install docker-ce

sudo usermod -aG docker $USER

 

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

sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

반응형