Display PCIe utilization on chart - #497
Open
destenson wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional PCIe RX/TX utilization history overlay to nvtop’s plot windows by recording PCIe throughput over time and rendering it as a shaded background bar chart behind the existing utilization line plots.
Changes:
- Introduces PCIe link capacity estimation and a curses-based background shading overlay renderer for RX/TX utilization.
- Records PCIe RX/TX throughput in a dedicated ring buffer and tracks per-device max link characteristics for scaling.
- Adds a new UI/config option (
show_pcie_overlay) to toggle and persist the overlay.
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/plot.c | Adds PCIe link capacity helper and background bar overlay rendering over existing plots. |
| src/interface.c | Records PCIe throughput history, tracks max link characteristics, and draws overlay/legend during plot rendering. |
| src/interface_setup_win.c | Adds setup menu toggle for PCIe overlay. |
| src/interface_options.c | Persists the new overlay option in the config file (read/write). |
| include/nvtop/plot.h | Exposes overlay APIs and defines direction count constant. |
| include/nvtop/interface_options.h | Adds show_pcie_overlay to interface options struct. |
| include/nvtop/interface_internal_common.h | Extends interface state with PCIe ring buffer and scaling fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
destenson
marked this pull request as draft
August 6, 2026 01:33
- sample pcie_rx and pcie_tx into a dedicated ring buffer every update, independent of the selected plot lines - latch the highest link generation and width observed per device and use it as the overlay scale - shade the plot background from the bottom of each column, rx in green and tx in magenta, taller direction painted first - print the latched link and the mean utilization of the visible window below the plot legend
- replace the combined PCIe legend line with one entry per direction, each drawn in the color of its shading - drop the link generation and width from the legend, the header bar already carries them - track the overlay's generation and width from the negotiated (dynamic) link, falling back to the static device/slot capability only when a backend never reports a dynamic reading - show the current utilization in the legend instead of the mean over the visible window, matching the top-of-screen RX/TX readout
- Add show_pcie_overlay option, defaulting to false - Gate draw_pcie_overlay on the option - Add a chart-section setup-window row to flip it - Persist the option under [ChartOption] as PcieOverlay
destenson
force-pushed
the
pcie-bandwidth-overlay
branch
from
August 6, 2026 02:11
91ea34b to
567ad9a
Compare
destenson
marked this pull request as ready for review
August 6, 2026 02:11
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.
This adds the ability to display PCIe utilization history with a bar chart in the background of the regular utilization chart.