From a29dd3d5cf5fb33e65c0318053cfab7ef82c05b6 Mon Sep 17 00:00:00 2001 From: Basavaraja Mattihalli <10070421+Basavaraja-MS@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:15:53 +0530 Subject: [PATCH] Show peak PCIe RX/TX throughput in the device header Track the maximum PCIe receive and transmit throughput observed since launch and display it next to the instantaneous values, e.g. "RX: 1.2 GiB/s (max 57.5 GiB/s)". This makes transient transfer peaks visible at a glance when diagnosing bus bottlenecks. The PCIe header field is widened to fit the additional value. The peak is reset only when nvtop restarts. Co-authored-by: Cursor --- include/nvtop/interface_internal_common.h | 2 + src/interface.c | 45 +++++++++++++++-------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/include/nvtop/interface_internal_common.h b/include/nvtop/interface_internal_common.h index aec93d3..77cd5a9 100644 --- a/include/nvtop/interface_internal_common.h +++ b/include/nvtop/interface_internal_common.h @@ -73,6 +73,8 @@ struct device_window { WINDOW *shader_cores; WINDOW *l2_cache_size; WINDOW *exec_engines; + unsigned pcie_rx_peak; // Peak PCIe RX throughput observed since launch (KB/s) + unsigned pcie_tx_peak; // Peak PCIe TX throughput observed since launch (KB/s) bool enc_was_visible; bool dec_was_visible; nvtop_time last_decode_seen; diff --git a/src/interface.c b/src/interface.c index ae23199..d638429 100644 --- a/src/interface.c +++ b/src/interface.c @@ -44,7 +44,7 @@ static unsigned int sizeof_device_field[device_field_count] = { [device_name] = 11, [device_fan_speed] = 11, [device_temperature] = 10, [device_power] = 15, - [device_clock] = 11, [device_mem_clock] = 12, [device_pcie] = 46, [device_shadercores] = 7, + [device_clock] = 11, [device_mem_clock] = 12, [device_pcie] = 88, [device_shadercores] = 7, [device_l2features] = 11, [device_execengines] = 11, }; @@ -575,6 +575,29 @@ static void print_pcie_at_scale(WINDOW *win, unsigned int value) { wprintw(win, " %sB/s", memory_prefix[prefix_off]); } +// Print a labelled PCIe throughput field as "