This is the nvidia GPU environment instruction. Some premises are the following.
$ ssh-keygen -t ed25519 -C "<email>"
$ eval "$(ssh-agent -s)"
$ vi ~/.ssh/config
Edit the ssh config file as below.
~/.ssh/config
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
$ ssh-add -k ~/.ssh/id_ed25519
Clone this repository into your Ubuntu based linux environment.
$ git clone git@github.com:makkimaki/exp_docker_env.git
.ssh
directory.ssh
directory.bashrc
like this: ssh-add -k ~/.ssh/<private key name>
runtime: nvidia
option!step
$ docker build
)$ docker run
or $ docker-compose
)$ docker build -t <tag name> .
When it is finished, you can see the named tag via $docker images
.
$ docker run --rm --gpus all -v ~/work:/work -p <host port>:22 -it <container name> bash
Instead of executing the $docker
command, you can use docker-compose
based environment building. The version is expected to have above 1.29.x
as following.
$ docker-compose --version
docker-compose version 1.29.1, build c34c88b2
After switching to the exp_docker_env
directory,
$ docker-compose build
$ docker-compose up -d
If you still don't have any built image, this operation will take you from building the container image to running it.
$ docker-compose ps
You can find the tagged container.
Now you can SSH to the container!
It uses "conda" virtual environment.
conda create python=3.9 --name <env. name>
activation
source activate <env. name>
deactivation
conda deactivate