Skip to content

Fix/hardware card layout#20

Merged
niklasfrick merged 12 commits into
mainfrom
fix/hardware-card-layout
Apr 28, 2026
Merged

Fix/hardware card layout#20
niklasfrick merged 12 commits into
mainfrom
fix/hardware-card-layout

Conversation

@niklasfrick
Copy link
Copy Markdown
Owner

No description provided.

Charts pinned to the top of each hardware card with items-start, leaving
empty space below. Switching to items-center centers the gauge+chart row
within the card's available height.
The Memory card used a fixed py-1 wrapper, so the gauge sat near the top
while neighboring cards centered their content. Use the same flex-1 +
items-center pattern as the other hardware cards so the gauge aligns
visually across the row.
…d RX/TX series

Disk I/O previously showed only the read throughput line; Network showed only RX.
Render each as a 3-line chart: Total (sum of the two component series, aligned
by timestamp) plus the two components, with a small legend so each line is
identifiable in the cramped hardware tile.
`/proc/meminfo` MemTotal under-reports the marketed capacity on unified-
memory NVIDIA platforms because firmware/GPU carve-outs are subtracted
before Linux sees the pool (~6 GiB on a 128 GB GB10 box, ~8 GiB on a
64 GB Jetson Orin). NVML's `memory_info()` exposes the full hardware
total on some platforms but returns NotSupported on GB10, so neither
source alone covers the lineup.

Add a derived `MemoryMetrics.display_total_bytes` chosen by:
  1. NVML total when it reports >= MemTotal (full hardware pool);
  2. otherwise, when the GPU is on a known unified-memory family, round
     MemTotal up to the next power-of-two GiB (every shipping Spark/
     Grace/Jetson/DRIVE SKU is power-of-two, so 122 GiB -> 128 GiB);
  3. otherwise, the kernel-visible total.

`detect_unified_memory` now also matches GPU names against a curated
list of unified families (GB10/GB200/GB300/GH200/Grace/Spark/Jetson/
Tegra/Orin/Xavier/Thor/TX1/TX2/Nano/AGX/DRIVE), needed for GB10 where
the size-comparison heuristic can't fire without `memory_info()`.

`used`/`available` continue to come from the kernel so utilisation
percentages remain honest against what's actually addressable.
Emits kernel_total_bytes, nvml_total_bytes, display_total_bytes, and
is_unified at info level on the first metrics tick, so unified-memory
detection can be verified on a target host without parsing the
WebSocket stream. Diagnostic — safe to remove once we trust the
heuristic on Spark, Jetson, and discrete deployments.
…abels

formatBytes now divides by 1024 (KiB/MiB/GiB) under the conventional
"KB"/"MB"/"GB" labels — what every OS-level memory tool (free -h,
htop, macOS, Windows) shows. Previously it divided by 1000 under the
same label, so a 122 GiB system displayed "131 GB".

Adds formatGiB(bytes, decimals?) for the headline memory total, which
needs integer GiB rather than the auto-scaling formatBytes path.
Backend now ships a derived headline total that reflects the marketed
unified-memory pool on Spark/Grace/Jetson (kernel MemTotal under-
reports it by the firmware carve-out). Make the field optional on the
type so older snapshots and existing tests still typecheck.
MemoryCard subtitle and the Dashboard hardware-grid Memory tile now
render formatGiB(display_total_bytes ?? total_bytes) so a 128 GB DGX
Spark shows "128 GB Unified" instead of "131 GB" or "122 GB". The
gauge segments still divide against total_bytes (kernel-visible) so
utilisation percentages remain honest against what's addressable.

The discrete-GPU VRAM section also moves to formatGiB for consistency.

Test fixtures in MemoryCard.test.tsx switched from decimal-shaped
byte counts (multiples of 10^9) to true binary GiB so the displayed
"64 GB" / "24 GB" assertions match the new binary scaling.
Fixes CI 'cargo fmt --all -- --check' failure on fix/hardware-card-layout.
Pure whitespace: comment-column alignment in UNIFIED_FAMILIES and a single-line
form for select_display_total.
Codifies the pre-commit checklist (cargo fmt/clippy/test, frontend build/test)
and the metrics cross-stack contract so feature changes don't ship without
matching test updates on the other side.
@niklasfrick niklasfrick merged commit c7851bd into main Apr 28, 2026
5 checks passed
@niklasfrick niklasfrick deleted the fix/hardware-card-layout branch April 28, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant