Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GPU with rootless Docker

Tags:

docker

gpu

I do not want my users to have the opportunity to run their containers in privileged mode. Recently, in Docker 19.03 they introduced a rootless experimental mode. It works great, however I do not know how to combine it with a nvidia-docker extension. When I run the image with --gpus all flag it results in an error:

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled 

Is it possible to run rootless Docker with GPU?

like image 697
piko Avatar asked Sep 13 '25 10:09

piko


1 Answers

In /etc/nvidia-container-runtime/config.toml under the line

[nvidia-container-cli]

add the following line:

no-cgroups = true

More Information: https://github.com/containers/libpod/issues/3659#issuecomment-543912380

like image 50
Tom Dörr Avatar answered Sep 15 '25 02:09

Tom Dörr