My docker-compose.yml
file :
version: '2'
services:
zl:
image: zl/caffe-torch-gpu:12.27
ports:
- "8801:8888"
- "6001:6008"
devices:
- /dev/nvidia0
volumes:
- ~/dl-data:/root/dl-data
After nvidia-docker-compose up -d
the container launched, but exited soon.
But when I launch a container by nvidia-docker
way, it worked well.
nvidia-docker run -itd -p 6008:6006 -p 8808:8888 -v `pwd`:/root/dl-data --name zl_test
You don't have to use nvidia-docker-compose. By configuring the nvdia-docker plugin correctly you can just use docker-compose!
Via the nvidia docker git repo: (can confirm it works for me)
Step 1:
Figure out nvidia driver version (it matters). run:
output:
+---------------------------------------------------------------+
NVIDIA-SMI 367.57 Driver Version: 367.57
|-------------------------------+--------+----------------------+
Step 2:
create a docker volume that uses the nvidia-docker plugin must be done outside of compose as compose will mangle the volume name if it creates it.
Step 3
in the docker-compose.yml file: