This repo contains docker images handy for running tensorflow, keras, opencv on GPU instance
./install-docker-ce.sh
Run
./install-nvidia-drivers.sh
Now reboot your server
sudo shutdown -r now
Check if drivers are working:
lsmod | grep nvidia
or
nvidia-smi
./install-nvidia-docker.sh
For GPU instance:
cd ./docker.gpu.py35.cv2.tf.keras
nvidia-docker build -t chayka/ml:gpu.py35.cv2.tf.keras .
For non-GPU instance:
cd ./docker.cpu.py35.cv2.tf.keras
nvidia-docker build -t chayka/ml:cpu.py35.cv2.tf.keras .
That is optional but might be handy for running
[sudo] apt-get install -y screen
sudo nvidia-smi -pm 1
If you plan to run time consuming task, say neural network training, better run it in connection independent environment:
screen
When disconnected and reconnected to the server, you can reconnect to your screen session:
screen -r
nvidia-docker run --rm -p 8888:8888 --mount type=bind,source=/home/$(whoami)/,target=/host/ chayka/ml:gpu.py35.cv2.tf.keras
nvidia-docker run --rm -it --mount type=bind,source=/home/$(whoami)/,target=/host/ chayka/ml:gpu.py35.cv2.tf.keras /bin/bash
Get running container id or alias:
docker ps -a
Let's say ours is nostalgic_fermat, then:
docker exec -it nostalgic_fermat /bin/bash