Ubuntu 18.04
1. Install Docker: https://docs.docker.com/install/
$ sudo apt install docker.io
2. Install NVIDIA docker support: https://github.com/NVIDIA/nvidia-docker
# Add the package repositories
$ 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
$ sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
$ sudo systemctl restart docker
3. Grant permission
$ sudo setfacl -m user:pengy6:rw /var/run/docker.sock
4. Download a TensorFlow Docker image
$ docker pull tensorflow/tensorflow:1.15.0-gpu
$ docker pull pytorch/pytorch
5. Start a TensorFlow Docker container
$ docker run -it --rm pytorch/pytorch bash
6. Mount local folder (in order)
$ docker run --mount type=bind,source=source,target=target -it --rm pytorch/pytorch bash
No comments:
Post a Comment