From 53c4a434a8587a531c288e98875ab76c180d376a Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 12 Nov 2026 19:07:10 +0100 Subject: feat(stats): show GPU usage on the dashboard chip xe reports no busy percentage, but its DRM fdinfo carries per-engine cycle counters. The 2s fdinfo pass that sums VRAM now also sums drm-cycles-rcs/ccs per client, and gpu.util is the busier of render (games) and compute (local LLMs) between two passes; a sum could pass 100% with both running. The GPU chip now matches the CPU chip: usage on a trend, temperature on the small line. VRAM and fan move to keystone's performance page. Without usage the temperature keeps the big value. Co-Authored-By: Claude Opus 5.5 --- static/dashboard.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'static/dashboard.js') diff --git a/static/dashboard.js b/static/dashboard.js index 70fdd6c..adf690e 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -117,7 +117,7 @@ const SKELETON = `
${G.cpu}
${G.mem}
-
+
${G.gpu}
${G.net}
@@ -162,7 +162,7 @@ export default { $(".c-bat").hidden = $(".c-wifi").hidden = !on.has("tablet"); $(".dash-music").hidden = !on.has("music"); - const hist = { cpu: [], down: [], up: [] }; + const hist = { cpu: [], gpu: [], down: [], up: [] }; if (on.has("stats")) poll("stats", 1, (st) => { $(".logo").textContent = DISTRO[st.os?.id] ?? G.tux; $(".os").textContent = st.os?.name ?? ""; @@ -182,9 +182,15 @@ export default { $(".c-gpu").hidden = !g; if (g) { $(".c-gpu .n").textContent = g.name ?? ""; - chip(".c-gpu", g.temp != null ? `${g.temp}°C` : "—", - g.memTotal ? `${gib(g.memUsed)} / ${Math.round(g.memTotal / 2 ** 30)} GiB` : `${gib(g.memUsed)} GiB`, - g.memTotal ? (100 * g.memUsed) / g.memTotal : 0, g.temp >= 85); + // Like the CPU chip: usage on a trend, temperature beside it. VRAM + // and fan are on keystone's performance page. Without usage (an + // older kernel) the temperature takes the big value. + if (g.util != null) { + push(hist.gpu, g.util); + $(".c-gpu path").setAttribute("d", area(hist.gpu, Math.max(25, ...hist.gpu))); + } + const t = g.temp != null ? `${g.temp}°C` : "—"; + chip(".c-gpu", g.util != null ? `${g.util}%` : t, g.util != null ? t : "", null, g.temp >= 85); } const max = Math.max(1, ...hist.down, ...hist.up); const [down, up] = $(".c-net").querySelectorAll("path"); -- cgit v1.2.3