diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-12 19:07:10 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-12 19:07:10 +0100 |
| commit | 53c4a434a8587a531c288e98875ab76c180d376a (patch) | |
| tree | c194efd3ed824eb1f12aeac1f2dc364250897b8f /static/dashboard.js | |
| parent | cb2de728a3af8b35997e82796fcd45799b17ad47 (diff) | |
| download | deck-it-53c4a434a8587a531c288e98875ab76c180d376a.tar.gz deck-it-53c4a434a8587a531c288e98875ab76c180d376a.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'static/dashboard.js')
| -rw-r--r-- | static/dashboard.js | 16 |
1 files changed, 11 insertions, 5 deletions
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 = ` <div class="chip c-cpu"><svg viewBox="0 0 120 100" preserveAspectRatio="none"><path class="hy"/></svg> <i class="nf ic">${G.cpu}</i><span class="col"><span class="n"></span><span class="v num"></span></span><span class="s"></span></div> <div class="chip c-mem"><i class="fill"></i><i class="nf ic">${G.mem}</i><span class="v num"></span><span class="s"></span></div> - <div class="chip c-gpu"><i class="fill"></i> + <div class="chip c-gpu"><svg viewBox="0 0 120 100" preserveAspectRatio="none"><path class="hy"/></svg> <i class="nf ic">${G.gpu}</i><span class="col"><span class="n"></span><span class="v num"></span></span><span class="s"></span></div> <div class="chip c-net"><svg viewBox="0 0 120 100" preserveAspectRatio="none"><path class="hy"/><path class="up"/></svg> <i class="nf ic">${G.net}</i><span class="v num"></span></div> @@ -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"); |
