Docker Community Forums

Share and learn in the Docker community.

How to make "--gpus all" the default

I’m using docker on an nvidia enabled host. Started with Docker 19.x the installation and usage are slightly different. There’s no nvidia runtime anymore which I could put it to daemon.json, but we can achieve the same by passing eg. “–gpus all” to docker run.

However, I have a pretty rigid environment where I can’t simply pass it to docker run, so I need to make this behaviour as the default somehow. But I can’t find how in the docs.

So my question is how to make it work, how to use the gpus without specifying it for docker run?

Janos

1 Like

Hey did you end up finding a solution for this? I’m having the same issue

+1
I am having the same problem.
I need to run docker containers from gitlab-runner with executor docker. Are there any options for how to do this by default from docker engine ?

According to NVIDIA’s documents, we need to install Nvidia docker 2.0 even if it is not a recommended method. After the installing, you can set the Nvidia runtime as the default. Kubernetes cannot support the new command “–gpus all” currently.