[PR #4713] [GUI] Monitor: an impossible PCIe traffic reading is no reading #5145

Open
opened 2026-11-07 16:33:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4713
Author: @ruibeikaa
Created: 10/30/2026
Status: 🔄 Open

Base: main ← Head: monitor-pcie-wrap


📝 Commits (3)

  • 85e3b12 [GUI] Monitor: an impossible PCIe traffic reading is no reading
  • b6b1af4 [GUI] Monitor: the desktop app drops the same impossible PCIe readings
  • 9c312ce [GUI] Monitor: a wrapped PCIe counter is read again before it is dropped

📊 Changes

4 files changed (+45 additions, -5 deletions)

View changed files

📝 apps/host/server/device-probes.mjs (+3 -1)
📝 apps/host/tests/monitor-dashboard.test.mjs (+2 -0)
📝 serve/telemetry.py (+11 -4)
📝 serve/test_server.py (+29 -0)

📄 Description

Problem and result

On a GP100 the Monitor shows PCIe traffic no link can carry. About one read in six of nvmlDeviceGetPcieThroughput comes back just under 200 GiB/s, even on an idle card. The web Monitor passes that on and the server adds the cards up, so with four dies the tile jumps between about 0 and 204,800 or 409,600 MB/s, and the spike sets the sparkline's scale. The desktop app has the same problem on its own path: while a model runs it reads nvidia-smi dmon, which prints the same numbers.

With this change the web Monitor reads a wrapped counter again, so the impossible values go and no second loses its reading. Its sampler went from 33 of 60 impossible values to 0 of 60, with none missing. The desktop app drops the value instead: real dmon output went from 8 of 96 impossible values to 0 of 96.

none. #2272 (closed, not merged) worked on the same tile, for cards with no traffic counter, and left NVML's numbers alone.

Approach

The bad values sit below 209,715,200 KB/s, which is 2^22 KB in NVML's documented 20 ms window: a few MB/s below it at idle, up to 6.4 GB/s below it with a request running. That reads like the counter stepping back and wrapping. This is my inference from the numbers, not something from NVIDIA.

The wrap does not last. Reading again at once gave a possible value 420 times out of 420, so _Nvml in serve/telemetry.py reads once more when a value is above 150 GiB/s, and treats it as unreadable only if the second read is above it too. It is the same call on the same counter, about 30 ms later, in the sampler's thread. 150 GiB/s is above PCIe 6.0 x16 (under 120 GiB/s) and far from the wrap point. Readings below it are unchanged.

parsePcieThroughput in apps/host/server/device-probes.mjs only sees one dmon output, so it drops the value. The AMD and Mac readers are not touched, and no engine code changes.

Validation

Main 870aedd9e against this branch, Windows 11, driver 581.80, 2x PH402 SKU 200 (four GP100 dies) and 2x RTX 3090 Ti, with a model loaded on the GP100s.

Passed:

  • _Nvml(i).read(), 240 rounds, rx and tx. Main, idle: 334 of 1,920 values impossible on the GP100s, peak 204,800 MB/s, and 0 of 960 on the RTX 3090 Ti. This branch, with a request running on the GP100s: 0 impossible and 0 None on both.
  • Telemetry(gpu_indices=[2, 3, 4, 5]), 30 s, the summed rx and tx. Main, idle: 33 of 60 impossible, peak 409,598 MB/s. This branch, with a request running: 0 of 60, 0 None, peak 1,586 MB/s.
  • Telemetry(gpu_index=2), one die alone, 30 s: 0 None in 28 points.
  • The re-read is not biased. With a request running, the read after a wrapped read had a median of 14.4 MB/s and a mean of 66.9 MB/s (221 reads). The control, the read after a good read, had 15.9 and 76.5 MB/s (813 reads).
  • The limit stays clear of both sides. With a request running, the lowest wrapped value was about 193.7 GiB/s and the highest real reading 4,047 MB/s.
  • The same _pcie_mb on an older local serve tree, read from the Monitor's data and the page: 0 to 0.3 MB/s idle, then a median of 199 and a peak of 4,275 MB/s while reading a 200K-token prompt, with no impossible value and no gap.
  • parsePcieThroughput on real nvidia-smi dmon -i 2,3,4,5 -s t -c 1 output, 24 rounds, four dies: 8 of 96 impossible with a peak of 209,673 MB/s on main; on this branch 0 impossible, 18 dropped, highest kept 38 MB/s.
  • python -m unittest serve.test_server serve.test_monitor serve.test_prometheus on this head, Python 3.13.5: 378 tests, OK, 3 skipped.
  • node --test on monitor-dashboard, monitor-host-sensors, native-monitor-projection and sensor-pace in apps/host, Node 22.22.3: 30 tests pass, on the commit before this head; this head only changes serve/. I copied in esbuild 0.28.1 for this, where the lockfile has 0.25.12.
  • The new checks fail without the fix: the two re-read tests in NvmlPcieTraffic against the reader without the re-read, and the new parsePcieThroughput assertions against main's parser.

Failed: none observed.

Not run:

  • CUDA, HIP, SYCL and Metal builds: no engine code changed.
  • The rest of the apps/host suite: its dependencies are not installed here.
  • This branch's web page and the desktop app on screen.
  • A calibration of NVML against a known transfer.
  • Other Pascal cards, Linux and other drivers: I have no such setup, so I do not know whether they do this too.

Limits

  • These are still NVML's 20 ms samples, one a second: a live trend, not the second's average. The numbers are the right size, but not calibrated: the engine's own probe measured 3.3 GB/s host to device per die, and single samples here reached 4,047 MB/s.
  • In the desktop app the tile adds up the cards that did report and names them, but the chart needs every card, so that point goes empty. In the 24 dmon rounds above, 12 lost at least one die.
  • This only catches the wrap. A wrong reading below 150 GiB/s still passes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4713 **Author:** [@ruibeikaa](https://github.com/ruibeikaa) **Created:** 10/30/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `monitor-pcie-wrap` --- ### 📝 Commits (3) - [`85e3b12`](https://github.com/Niko1221/Strata/commit/85e3b1290e84e9405ac7a715433cb93ef27597d6) [GUI] Monitor: an impossible PCIe traffic reading is no reading - [`b6b1af4`](https://github.com/Niko1221/Strata/commit/b6b1af4870312832e9c330e814de1d7c0899692d) [GUI] Monitor: the desktop app drops the same impossible PCIe readings - [`9c312ce`](https://github.com/Niko1221/Strata/commit/9c312cee75bd2cd79d8e5911df441eb5b8ba1289) [GUI] Monitor: a wrapped PCIe counter is read again before it is dropped ### 📊 Changes **4 files changed** (+45 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/server/device-probes.mjs` (+3 -1) 📝 `apps/host/tests/monitor-dashboard.test.mjs` (+2 -0) 📝 `serve/telemetry.py` (+11 -4) 📝 `serve/test_server.py` (+29 -0) </details> ### 📄 Description ## Problem and result On a GP100 the Monitor shows PCIe traffic no link can carry. About one read in six of `nvmlDeviceGetPcieThroughput` comes back just under 200 GiB/s, even on an idle card. The web Monitor passes that on and the server adds the cards up, so with four dies the tile jumps between about 0 and 204,800 or 409,600 MB/s, and the spike sets the sparkline's scale. The desktop app has the same problem on its own path: while a model runs it reads `nvidia-smi dmon`, which prints the same numbers. With this change the web Monitor reads a wrapped counter again, so the impossible values go and no second loses its reading. Its sampler went from 33 of 60 impossible values to 0 of 60, with none missing. The desktop app drops the value instead: real `dmon` output went from 8 of 96 impossible values to 0 of 96. ## Related discussion none. #2272 (closed, not merged) worked on the same tile, for cards with no traffic counter, and left NVML's numbers alone. ## Approach The bad values sit below 209,715,200 KB/s, which is 2^22 KB in NVML's documented 20 ms window: a few MB/s below it at idle, up to 6.4 GB/s below it with a request running. That reads like the counter stepping back and wrapping. This is my inference from the numbers, not something from NVIDIA. The wrap does not last. Reading again at once gave a possible value 420 times out of 420, so `_Nvml` in `serve/telemetry.py` reads once more when a value is above 150 GiB/s, and treats it as unreadable only if the second read is above it too. It is the same call on the same counter, about 30 ms later, in the sampler's thread. 150 GiB/s is above PCIe 6.0 x16 (under 120 GiB/s) and far from the wrap point. Readings below it are unchanged. `parsePcieThroughput` in `apps/host/server/device-probes.mjs` only sees one `dmon` output, so it drops the value. The AMD and Mac readers are not touched, and no engine code changes. ## Validation Main 870aedd9e against this branch, Windows 11, driver 581.80, 2x PH402 SKU 200 (four GP100 dies) and 2x RTX 3090 Ti, with a model loaded on the GP100s. **Passed:** - `_Nvml(i).read()`, 240 rounds, rx and tx. Main, idle: 334 of 1,920 values impossible on the GP100s, peak 204,800 MB/s, and 0 of 960 on the RTX 3090 Ti. This branch, with a request running on the GP100s: 0 impossible and 0 `None` on both. - `Telemetry(gpu_indices=[2, 3, 4, 5])`, 30 s, the summed rx and tx. Main, idle: 33 of 60 impossible, peak 409,598 MB/s. This branch, with a request running: 0 of 60, 0 `None`, peak 1,586 MB/s. - `Telemetry(gpu_index=2)`, one die alone, 30 s: 0 `None` in 28 points. - The re-read is not biased. With a request running, the read after a wrapped read had a median of 14.4 MB/s and a mean of 66.9 MB/s (221 reads). The control, the read after a good read, had 15.9 and 76.5 MB/s (813 reads). - The limit stays clear of both sides. With a request running, the lowest wrapped value was about 193.7 GiB/s and the highest real reading 4,047 MB/s. - The same `_pcie_mb` on an older local serve tree, read from the Monitor's data and the page: 0 to 0.3 MB/s idle, then a median of 199 and a peak of 4,275 MB/s while reading a 200K-token prompt, with no impossible value and no gap. - `parsePcieThroughput` on real `nvidia-smi dmon -i 2,3,4,5 -s t -c 1` output, 24 rounds, four dies: 8 of 96 impossible with a peak of 209,673 MB/s on main; on this branch 0 impossible, 18 dropped, highest kept 38 MB/s. - `python -m unittest serve.test_server serve.test_monitor serve.test_prometheus` on this head, Python 3.13.5: 378 tests, OK, 3 skipped. - `node --test` on `monitor-dashboard`, `monitor-host-sensors`, `native-monitor-projection` and `sensor-pace` in `apps/host`, Node 22.22.3: 30 tests pass, on the commit before this head; this head only changes `serve/`. I copied in esbuild 0.28.1 for this, where the lockfile has 0.25.12. - The new checks fail without the fix: the two re-read tests in `NvmlPcieTraffic` against the reader without the re-read, and the new `parsePcieThroughput` assertions against main's parser. **Failed:** none observed. **Not run:** - CUDA, HIP, SYCL and Metal builds: no engine code changed. - The rest of the `apps/host` suite: its dependencies are not installed here. - This branch's web page and the desktop app on screen. - A calibration of NVML against a known transfer. - Other Pascal cards, Linux and other drivers: I have no such setup, so I do not know whether they do this too. ## Limits - These are still NVML's 20 ms samples, one a second: a live trend, not the second's average. The numbers are the right size, but not calibrated: the engine's own probe measured 3.3 GB/s host to device per die, and single samples here reached 4,047 MB/s. - In the desktop app the tile adds up the cards that did report and names them, but the chart needs every card, so that point goes empty. In the 24 `dmon` rounds above, 12 lost at least one die. - This only catches the wrap. A wrong reading below 150 GiB/s still passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5145
No description provided.