Skip to content

Display PCIe utilization on chart - #497

Open
destenson wants to merge 3 commits into
Syllo:masterfrom
destenson:pcie-bandwidth-overlay
Open

Display PCIe utilization on chart#497
destenson wants to merge 3 commits into
Syllo:masterfrom
destenson:pcie-bandwidth-overlay

Conversation

@destenson

Copy link
Copy Markdown

This adds the ability to display PCIe utilization history with a bar chart in the background of the regular utilization chart.

Copilot AI lite review requested due to automatic review settings August 6, 2026 00:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/interface.c
Comment thread src/interface.c Outdated
Comment thread src/plot.c Outdated
@destenson
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
destenson force-pushed the pcie-bandwidth-overlay branch from 91ea34b to 567ad9a Compare August 6, 2026 02:11
@destenson
destenson marked this pull request as ready for review August 6, 2026 02:11
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.

2 participants