mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4623] [GUI] Monitor: each GPU tile gets its own PCIe readings on a two-card PC #5117
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5117
Loading…
Add table
Add a link
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/Niko1221/Strata/pull/4623
Author: @lamboJw
Created: 10/29/2026
Status: 🔄 Open
Base:
main← Head:fix/monitor-pcie-per-gpu📝 Commits (1)
333e1f1serve telemetry: each card's PCIe link and traffic in "gpus"; the machine's link is the narrowest card's📊 Changes
2 files changed (+31 additions, -2 deletions)
View changed files
📝
serve/telemetry.py(+14 -2)📝
serve/test_server.py(+17 -0)📄 Description
Problem and result
On a PC with two graphics cards, every PCIe tile in the Monitor is empty. Each GPU tile is built from that card's own record in
/metrics, and the two-cardgpuslist carried onlyutil,mem_used,mem_total,tempandpower— nopcie_gen,pcie_width,pcie_rx_mb,pcie_tx_mb. The app reads those keys (apps/host/server/monitor-dashboard.mjs,apps/host/src/lib/native-monitor.ts), so the tiles fell back to-/ "unavailable" and the caption dropped to the transfer totals. The link generation and width are only shown when a single card is selected, because there the app can fall back to the machine-widegpu_pcie_*totals; a second card makes that fallback disappear.After the change each card carries its own link and its own traffic, so both tiles show their readings. This PC (RTX 4060 Ti + RTX 4070 SUPER, both behind a x8 hop) before and after, from
serve/telemetry.pyunchanged / changed:The machine-wide link figures are now the narrowest card's instead of the first card's:
gpu_pcie_gen,gpu_pcie_gen_maxandgpu_pcie_widthused to come fromreads[0], which reads high whenever a Gen4 card is plugged into a Gen3 slot or a x8 card sits next to a x16 one. A link is not a sum, so it is the only kind of reading that cannot be totalled; here both cards happen to read Gen3 x8, so the totals are the same either way on this PC — the difference is covered by the new check, where the two fake cards are Gen4 x16 and Gen3 x8.Related discussion
none. I searched the open and closed issues and pull requests first: #1734 (the PCIe tile asking for
pcie_rx_mbwhere amdgpu only exposes a total), #3157 (GPU tiles silently showing-when a Linux HIP config lacksbackend: hip) and #4496 (per-card PCIe in the Prometheus export) are related but cover other backends or the export, not this gap.Approach
sample()already reads every card's full record, including its link — the reader producespcie_gen,pcie_gen_max,pcie_width,pcie_rx_mbandpcie_tx_mb(_Nvml.read,_Amd.read). Only the aggregategdict kept them; the per-cardgpuslist dropped them when it was built. Restoring them there is a producer-side fix, so no app-side change is needed and single-card machines behave exactly as before (their readings already came from thegpu_*totals).One compatibility note:
gpu_pcie_gen,gpu_pcie_gen_maxandgpu_pcie_widthchange for a two-card machine where the cards differ. If a single narrow card is present, the value is the same as before; a machine with mixed links now reports the conservative one.gpu_pcie_rx_mb/gpu_pcie_tx_mbkeep being sums. The AMD reader'spcie_own_genandpcie_pathare still aggregate-only (from the first card) — I left them out of the per-card list because no app reads them, and I did not want to widen the change; see Limits.Validation
Revision:
origin/main@46c152a1with the single commit of this branch (333e1f1a). Environment: Windows 11 x64, RTX 4060 Ti 16 GB + RTX 4070 SUPER 12 GB (both on a Gen3 x8 hop), Python 3.13.14 in the repo's.venv, no GPU build involved (no C/C++ file touched).Passed:
python -m unittest serve.test_server.AmdTelemetry -v→Ran 4 tests … OK(includes the newtest_each_card_has_its_own_link_in_gpus: the two fake cards report(0, 4, 4, 16)and(1, 3, 3, 8), the machine figures report(3, 3, 8)).python C:\...\probe_gpu_pcie.pyagainst the changedserve/telemetry.pywithTelemetry(gpu_index=0, gpu_indices=[0, 1])on the PC above → the numbers quoted above: each card has its ownpcie_gen3 /pcie_width8 and its own rx/tx (card 1 reads 0.0 while card 0 reads 7.06 MB/s instead of sharing the first card's figures).serve/telemetry.pyin the same checkout → thegpusrecords have no PCIe keys at all (the "before" output above), which is what the Monitor tiles had nothing to read from.Failed:
serve/telemetry.pychange stashed (git stash push -- serve/telemetry.py, then the same unittest command) →FAILED (errors=1):KeyError: 'pcie_gen'on the per-card record. This is the check failing without the fix, not a failure of the submitted code.Not run:
_Metal) reader and the Windows AMD path: no Mac and no AMD card here. The AMD per-card link readings are exercised only through the fake amdgpu sysfs tree in the new check, which establishes the aggregation, not driver correctness.serve/test_server.pyin full (it is a 6.3k-line file) and the app'snpm testsuite: neither touches these keys, and running them here would be evidence for a revision I did not change. Say which of them a reviewer wants and I will run them.Limits
/metricsand the app's dashboard are separate producers of the same tiles; only the Python sampler is changed here. A released Control has to be rebuilt to pick this up (the packagedserve/telemetry.pyin an installed app is a copy of this file).pcie_genis NVML's current link, which drops to a power-saving generation while the card is idle, so a tile can read Gen3 at an idle desktop and Gen4 while the model runs.pcie_gen_maxis the card's own maximum;pcie_widthis the current width. The existing AMDlink()reports the narrowest hop on its own path, which is a different figure.gpu_pcie_own_genandgpu_pcie_pathremain the first card's readings for a two-card machine; they are not per-card in this PR.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.