# Systemd USER unit: gpu-exporter (both Dankclaw and Dankserver). # # Install path: ~/.config/systemd/user/gpu-exporter.service # Installed and enabled by deploy_gpu_exporter in scripts/deploy-remote.sh. # # Per-GPU metrics (utilization / VRAM / temperature / power) for the mixed # AMD + NVIDIA fleet, scraped by Prometheus. Like signal-relay it is a plain # user unit, not a quadlet: it runs python3 straight from the checkout (a pull # updates it with no copy step), a hand-written user unit can be enabled where # the podman v1 generator's units cannot, and with Linger=yes for dank it starts # at boot. It reads the host's own cgroup/drm sysfs and shells to nvidia-smi, so # it must run on the host — a container would need GPU/DRM passthrough for # nothing gained. # # BINDING. The base unit serves loopback only. deploy_gpu_exporter writes a # drop-in adding THIS host's LAN address (the same two-address posture # node-exporter and cadvisor use), so the endpoint is never a wildcard. It is # unauthenticated metrics on the LAN, identical to node-exporter :9100 and # cadvisor :8080 — Prometheus reaches same-host via host.containers.internal and # the Dankserver instance over the LAN from Dankclaw. [Unit] Description=GPU metrics exporter (amdgpu sysfs + nvidia-smi) After=network-online.target Wants=network-online.target [Service] # Loopback by default; the deploy drop-in appends the host LAN address. Environment=GPU_EXPORTER_BINDS=127.0.0.1 ExecStart=/usr/bin/python3 /home/dank/serverAppConfigs/scripts/gpu-exporter.py --serve Restart=always RestartSec=5 [Install] WantedBy=default.target