Fix glances GPU access using deploy resources syntax

The runtime:nvidia field wasn't being applied. Switch to deploy
resources reservations syntax (matching plex config) and add
NVIDIA_DRIVER_CAPABILITIES for NVML library access.
This commit is contained in:
2026-01-31 20:04:59 +00:00
parent 947f5fd348
commit 58f513b420
+8 -3
View File
@@ -1,21 +1,26 @@
version: '3'
services: services:
glances: glances:
container_name: glances container_name: glances
image: 'nicolargo/glances:latest-full' image: 'nicolargo/glances:latest-full'
restart: unless-stopped restart: unless-stopped
privileged: true privileged: true
runtime: nvidia
ports: ports:
- 61208-61209:61208-61209 - 61208-61209:61208-61209
environment: environment:
- TZ=${TZ} - TZ=${TZ}
- NVIDIA_VISIBLE_DEVICES=all - NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- "GLANCES_OPT=-C /glances/conf/glances.conf -w" - "GLANCES_OPT=-C /glances/conf/glances.conf -w"
volumes: volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro' - '/var/run/docker.sock:/var/run/docker.sock:ro'
- '/run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro' - '/run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro'
- /srv/glances/glances.conf:/glances/conf/glances.conf - /srv/glances/glances.conf:/glances/conf/glances.conf
pid: host pid: host
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]