feat: per-GPU health gauges on NVLink/XGMI tabs and capacity-based bar colors#36
Merged
Conversation
Signed-off-by: chang-ning <spiderpower02@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a shared per-GPU “health” metric struct and wires NVML (NVLink) + amdsmi (XGMI) readers to populate it, then renders those metrics as a gauge strip and extra detail lines in the GPU tabs. It also updates throughput bar coloring to reflect saturation against link capacity (when known), rather than absolute Gbps.
Changes:
- Introduces
GpuMetrics(util/VRAM/temp/power/clock) and populates it from both NVML (NVIDIA) and amdsmi (AMD). - Renders per-GPU health gauges in the GPU tabs and adds a utilization sparkline (fixed 0–100 scale) in detail panes.
- Colors throughput bars by % of link capacity when available, with a fallback to the prior absolute-Gbps coloring.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/xgmi.rs |
Adds amdsmi FFI structs/entry points and captures per-GPU health metrics in XGMI snapshots. |
src/nvlink.rs |
Captures per-GPU health metrics via NVML and attaches them to NVLink snapshots. |
src/gpu.rs |
New shared GpuMetrics struct used by both GPU backends and the TUI. |
src/tui/ui.rs |
Adds gauge strip + detail rendering for GPU health; adds capacity-based color helpers and refactors bar rendering. |
src/tui/app.rs |
Threads metrics into TUI metadata and records utilization history for sparklines. |
src/tui/theme.rs |
Adds a good_dim color used in the new capacity gradient. |
src/main.rs |
Registers the new gpu module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: chang-ning <spiderpower02@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Adds simple GPU monitoring to the GPU tabs (inspired by all-smi/nv-monitor) and makes bar colors reflect link saturation.
Test Result
Checklist
cargo fmt --checkpassescargo clippy -- -D warningspassescargo testpasses