mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-10-23 08:07:34 -06:00
[PR #231] [MERGED] feat(examples): add a Rich Live GPU monitor #229
Labels
No labels
api
bug
bug
cli / tui
dependencies
documentation
documentation
documentation
duplicate
enhancement
exporter
invalid
pull-request
pynvml
question
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github-starred/nvitop#229
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/XuehaiPan/nvitop/pull/231
Author: @XuehaiPan
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @XuehaiPan
Base:
main← Head:feat/rich-monitor📝 Commits (3)
8928706feat(examples): add a Rich Live GPU monitor2486849fix(examples): allow optional Rich imports during linting02a2b26docs(changelog): note the Rich Live GPU monitor example📊 Changes
5 files changed (+471 additions, -0 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
examples/README.md(+2 -0)➕
examples/monitor-rich/README.md(+44 -0)➕
examples/monitor-rich/monitor_rich.py(+422 -0)➕
examples/monitor-rich/requirements.txt(+2 -0)📄 Description
Issue Type
Description
Add a standalone Rich Live dashboard that displays host CPU, memory, swap, load averages, physical GPUs, MIG instances, and GPU processes using the public
nvitopAPI.Tables adapt to terminal width, prioritize memory utilization bars, and align percentage values. The monitor redraws on resize, restores the terminal on exit, and supports
--interval,--once, and redirected output. Device and MIG instances are discovered once at startup and reused during refreshes.Closes #230
Motivation and Context
Implements the standalone Rich example suggested in PR #230, providing an adaptable dashboard built on the public API.
Testing
python3 -m pre_commit run --all-filespassed, including mypy and pylint.100.0%memory usage.0.4%/26.9%rows previously ended in different columns; the corrected rendering aligns values and headers across widths 60–120.MIG validation used synthetic snapshots. One-shot process CPU percentages use the initial sample and may report zero before a useful sampling interval has elapsed.
Images / Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.