docker-compose


use nvidia-docker-compose launch a container, but exited soon


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:
nvidia-smi
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.
docker volume create --name=nvidia_driver_367.57 -d nvidia-docker
Step 3
in the docker-compose.yml file:
version: '2'
volumes:
nvidia_driver_367.57: # same name as one created above
external: true #this will use the volume we created above
services:
cuda:
command: nvidia-smi
devices: #this is required
- /dev/nvidiactl
- /dev/nvidia-uvm
- /dev/nvidia0 #in general: /dev/nvidia# where # depends on which gpu card is wanted to be used
image: nvidia/cuda
volumes:
- nvidia_driver_367.57:/usr/local/nvidia/:ro

Related Links

docker-compose Windows volume
Trying to figure out why eslint-watch doesn't work with docker-compose correctly
docker-compose the latest stable version on ubuntu
docker compose environment variable for command
java.net.UnknownHostException: failed to resolve 'inventory-microservice'. Exceeded max queries per resolve 3
What does working_dir tag mean in a docker-compose yml file
If I upgrade an image in docker-compose, will its volumes be lost?
How to solve this docker-compose upgrading error?
Fabric Network - what happens when a downed peer connects back to the network?
Docker-compose and load balancing
Run arguments in Docker Compose
Docker compose file config
Systemd “No such file or directory” itself during “docker-compose up”
Docker compose yml static IP addressing
compose extend file results in a validation error
hubot rocketchat adapter does not work

Categories

HOME
gcc
typo3
cors
process
grpc
aix
spss
where
multipartform-data
autocad
flowtype
minimax
google-my-business-api
digital
jpql
velocity
captcha
element
reportlab
md2
legend-properties
aws-devicefarm
gpo
ejb-3.1
connectiq
onclicklistener
oracle-golden-gate
uipath
symlink
android-cursorloader
angular2-changedetection
csproj
abide
anypoint-studio
file-conversion
jvisualvm
google-cloud-powershell
encoder
ocamlbuild
spring-ide
remap
evaluation
history
flask-socketio
openxava
gige-sdk
aot
disassembly
suitesparse
sqlproj
lattice
racket-student-languages
easy68k
jira-agile
jigsaw
falcon
nsoperationqueue
jcalendar
jersey-test-framework
opendolphin
javapackager
tess4j
playn
glog
genome
sicstus-prolog
ultraedit
cl.exe
qxorm
crystal-reports-7
method-overloading
javacompiler
fscanf
parallel-port
mvcgrid
telerik-appbuilder
twitter-finagle
winrun4j
friendly-id
tlbimp
ia-32
qmainwindow
system.transactions
yii-components
junit-rule
inflate
jquery-ui-map
github-archive
towerjs
scsf
cgaffinetransform
automapper-2
soapexception
object-tag
hs-err
simultaneous
linq-to-mysql
code-golf
uccapi
helios
qlibrary
high-load
memory-consumption

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App