user3470496
user3470496

Reputation: 171

docker version 18.09 version of --gpus all

I'm trying to run a gpu-enabled container on a server with docker 18.09.5 installed. It's a shared server so I can't just upgrade the docker version.

I have a private server with docker 19.03.12 and the following works fine:

docker pull vistart/cuda
docker run --name somename --gpus all -it --shm-size=10g -v /dataloc:/mountedData vistart/cuda /bin/sh

nvidia-smi

yields: expected gpu stats

When I try this on the server with docker 18.09:

docker pull vistart/cuda
docker run --name somename --gpus all -it --shm-size=10g -v /dataloc:/mountedData 

yields:

unknown flag: --gpus-all
See 'docker run --help'.

docker run --name somename -it --shm-size=10g -v /dataloc:/mountedData 

works but.. nvidia-smi yields:

/bin/sh: 1: nvidia-smi: not found

Is there some v18.09 version of --gpus all that would work?

I've tried with nvidia-docker:

nvidia-docker run --name somename -it --shm-size=10g -v /dataloc:/mountedData 

and this yields:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused \"process_linux.go:407: running prestart hook 1 caused \\\"error running hook: exit status 1, stdout: , stderr: exec command: [/usr/bin/nvidia-container-cli --load-kmods configure --ldconfig=@/sbin/ldconfig --device=all --compute --utility --require=cuda>=11.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411 brand=tesla,driver>=440,driver<441 brand=tesla,driver>=450,driver<451 --pid=3030 /local/var_local/nobackup/docker/overlay2/d096e63d0a34537f04cbafeb1b6c3315b4e6f0ff15e3e2cb30057f549dc75cb5/merged]\\\\nnvidia-container-cli: requirement error: unsatisfied condition: brand = tesla\\\\n\\\"\"": unknown.

Looks like the share is running CUDA 10.1 so it's not hitting the cuda>-11.0 req...

Upvotes: 1

Views: 7898

Answers (1)

Paolo
Paolo

Reputation: 26074

From 19.03 onwards, you can use:

docker run --gpus all myimage

For previous versions, you would use nvidia-docker like this:

nvidia-docker run myimage

Upvotes: 2

Related Questions