-
feat(perf): gpu-mode switch — the real dGPU-off lever + cockpit surfacing · 44263086
The last unclaimed thermal lever. Our 2026-07-24 finding: on this Plasma-Wayland box Xwayland pins the RTX 2060 'active' regardless of runtime-PM (control=auto, --rtd3), so the dGPU never actually suspends live and keeps drawing ~4-5 W + idle heat. The ONLY real off is EnvyControl's 'integrated' mode (blacklist nvidia) — but that's a persistent config change that needs a re-login, categorically unlike the instant perf.sh modes (governor/EPP/RAPL). So it gets its own tool, not a perf-mode. gpu-mode.sh (new, at repo root beside perf.sh) ---------------------------------------------- A guarded EnvyControl front-end: `query` (default — manager mode + live dGPU runtime state, with the right advice per mode), `integrated` (dGPU off; warns you lose CUDA/NVENC for demucs/audio-ML until you switch back), `hybrid` (restore with aggressive --rtd3 3 = D3cold-when-idle). Every switch confirms (skip with -y), runs `sudo envycontrol ...` (prompts for your password), then prints the exact re-login step (reboot safest; verify with `./gpu-mode.sh query` + `nvidia-smi`). Deliberately NOT added to the passwordless perf-audio sudoers whitelist: this is a rare, considered, re-login-required switch — the web Bridge and tray must never be able to power-cycle the GPU config unattended. Runs by hand only. Cockpit surfacing (Bridge + tray) --------------------------------- - perf.py: gpu_manager_mode() reads `envycontrol --query`, cached 300s (the mode is static within a login session; a re-login restarts this --user service and refreshes the cache), defensive → None if envycontrol absent. Added to snapshot() as `gpu_manager`. - Bridge UI: the `gpu` chip folds it in — shows `off↻` when integrated-but-pending- re-login (dot green: this is the quiet goal), and in hybrid its title now names the manager mode and points at `./gpu-mode.sh integrated` for a real off. - Tray tooltip mirrors it (`gpu awake·hybrid`, or `off↻` when armed). Validation: 24 perf tests pass (2 new — parse+cache, and absent→None; snapshot-shape now asserts dgpu/gpu_manager/thermald). Live: `./gpu-mode.sh query` reads hybrid + active(0000:01:00.0) and fires the Xwayland warning; Bridge /api/perf serves gpu_manager=hybrid; both services restarted clean.
PLN (Algolia) authored44263086
×