admin管理员组文章数量:1122832
I have a few docker services that use my graphics card as hardware acceleration (jellyfin, immich). When I comment-out the device mapping, the containers restart normally after reboot, but when I set the devices mappings, the containers won't restart after a (daemon) restart. The devices mappings look like this:
...
deploy:
resources:
reservations:
devices:
- driver: cdi
device_ids:
- nvidia/gpu=all
capabilities: [gpu]
...
and this:
...
devices:
- nvidia/gpu=all
...
Both do not restart. The services themself work perfectly once started manually and the device mappings also work as I have access to the graphics card.
I tried commenting out the devices and then everything worked (except the devices obv.). I was expecting that the containers restart normally as with the other containers. I assumed there was a problem with the deploy keyword as it is used for swarm mode, but even without the deploy keyword and using devices directly, the containers still don't restart automatically.
I also tried setting
...
deploy:
restart_policy:
condition: any
resources:
reservations:
devices:
- driver: cdi
device_ids:
- nvidia/gpu=all
capabilities: [gpu]
...
but this also didn't work.
One solution that worked was using environment: nvidia
and removing the other configurations. But this works only with a deprecated setting on my distribution (NixOS) and the current one recommends the one mentioned above.
本文标签: Docker Compose restartalways not working when using devicesStack Overflow
版权声明:本文标题:Docker Compose restart:always not working when using devices - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283821a1927092.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论