From fda4e7847bb5dc985404269c81400eead52b0181 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 12 Nov 2026 19:07:18 +0100 Subject: feat(perf): show GPU render and compute load xe exposes no busy percentage, but its DRM fdinfo carries per-engine cycle counters. vram.sh becomes gpu.sh: the same scan also sums drm-cycles-rcs/ccs per client and prints them with the GPU's cycle counter, and Perf.js turns two scans into a percentage per engine. The GPU card's headline is now the busier engine, with render (games) and compute (local LLMs) as bars, then VRAM, temperature and fan. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/perf/Perf.qml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'desktop/modules/perf/Perf.qml') diff --git a/desktop/modules/perf/Perf.qml b/desktop/modules/perf/Perf.qml index 5fcf0ab..33b5cbc 100644 --- a/desktop/modules/perf/Perf.qml +++ b/desktop/modules/perf/Perf.qml @@ -56,6 +56,9 @@ Singleton { property var temps: [] // [{label, value, warn, crit}], value null if unread property var disks: [] // Perf.js df rows property var vram: null // bytes + property var gpu: null // gpuSample, the last scan + property var gpuRender: null // percent, rcs + property var gpuCompute: null // percent, ccs property var fan: null // rpm property var rx: [] // bytes/s, newest last property var tx: [] @@ -181,18 +184,27 @@ Singleton { root.temps = t; if (fanView.path) { fanView.reload(); root.fan = root.num(fanView); } - if (!vramProc.running) vramProc.running = true; + if (!gpuProc.running) gpuProc.running = true; } } // ponytail: a shell glob over every fd on the system, ~14ms every 2s, // always; gate it on the panel again if that shows up. Only the user's own processes are readable, so a // system service's GPU use is not counted, as in conky. - // Summed in vram.sh, so JS gets one number, never the scan itself. + // Summed in gpu.sh, so JS gets five numbers, never the scan itself. Process { - id: vramProc - command: ["sh", `${Quickshell.shellDir}/modules/perf/vram.sh`] - stdout: StdioCollector { onStreamFinished: root.vram = text.trim() === "" ? null : Number(text) } + id: gpuProc + command: ["sh", `${Quickshell.shellDir}/modules/perf/gpu.sh`] + stdout: StdioCollector { + onStreamFinished: { + const cur = P.gpuSample(text); + const l = P.gpuLoad(root.gpu, cur); + root.vram = cur ? cur[0] : null; + root.gpuRender = l.render; + root.gpuCompute = l.compute; + root.gpu = cur; + } + } } // --- network ------------------------------------------------------------ -- cgit v1.2.3