Refer to the following post: https://boramchan-corgi.tistory.com/13
https://nvidia.github.io/nvidia-container-runtime/
sudo apt-get update
sudo apt install curl
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get install nvidia-container-runtime
sudo apt install docker.io
sudo chmod 666 /var/run/docker.sock
sudo apt-get update
sudo apt-get install -y nvidia-docker2
docker login
but it takes a lot of time, I guess downloading predefined images and adapting a new image on it is much faster than uploading my image
https://hub.docker.com/r/nvidia/cuda/tags
https://dongle94.github.io/docker/docker-image-storage-change/
# daemon.json update
{
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
"data-root": "/home/docker"
}
docker pull nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
# build your image from "nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04" in dockerfile
vim dockerfile
# make it into real image
# 1st base image
docker build -t clay/maler-torch:cu11.8cudnn8torch2.0 .
# 2nd specific image for specific users or docker settings
docker build -t clay:00 .
# make container from images
sudo docker run -it --gpus 'device=1' --cpus=12 --memory=128G -p 18185:22 -p 18186:8888 -v /home/maler/clay-storage:/home/clay/userdata --name clay --shm-size 32G clay:00