Does nvidia-container-runtime interfere with containers that don't need to run on the gpu?

Viewed 202

Docker daemon.json change the default runtime to nvidia and add the following.

{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
},
}

This will include gpu information in the docker that is started by default.

Will this approach interfere with dockers that don't need to run with gpu?

Will gpu information be saved when a docker that does not require gpu runs?

1 Answers

What nvidia-container-runtime does to a container depends on environment variables set in that container. The list of affecting environment variables and their values can be found here but I want to mention this one specifically:

NVIDIA_VISIBLE_DEVICES

Possible values

  • void or empty or unset: nvidia-container-runtime will have the same behavior as runc.

So if your container has no NVIDIA_VISIBLE_DEVICES environment variable, nvidia-container-runtime should work as runc (the standard way for Docker to launch containers).

Related