[PR #3682] [GUI] Monitor: GPU load, VRAM, temperature, power and PCIe link for AMD cards on Windows (#1380) #4748

Open
opened 2026-11-07 15:38:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3682
Author: @JordanDWalters
Created: 10/22/2026
Status: 🔄 Open

Base: main ← Head: amd-win-telemetry


📝 Commits (4)

  • a13ac42 telemetry: GPU load, VRAM, temperature and power for AMD cards on Windows (#1380)
  • 1aa632f telemetry: board power on discrete Radeons, and close the Windows AMD reader (#1434 review)
  • db05b11 tests: the no-card telemetry test with #1587's registry fallback
  • f1a95ec telemetry: PCIe link for AMD cards on Windows: the OS values first, PMLog backup (#1380)

📊 Changes

4 files changed (+461 additions, -17 deletions)

View changed files

📝 docs/AMD_HIP.md (+6 -1)
📝 serve/telemetry.py (+310 -15)
📝 serve/test_server.py (+144 -0)
📝 serve/web/app.js (+1 -1)

📄 Description

Problem and result

On Windows with an AMD card the Monitor shows nothing for the GPU: serve/telemetry.py's AMD reader could only read the amdgpu driver's Linux sysfs files, so every GPU tile stayed empty ("–") on the released 0.2.2 (#1380, #1587). After this change the tiles are live on Windows too: load, VRAM used/total, temperature, power (board power where the card reports it, else ASIC power) and the PCIe link (generation, maximum generation, width). free_vram_mib(amd=True) also returns a value there again, so the free-VRAM admission check works on Windows. Verified on two Radeon AI PRO R9700 (details under Validation).

  • #1380 — the issue this resolves (closed with #1434/#1871 in the 0.2.0-beta tracker reset, "closed here does not mean rejected").
  • #1434 (gt50) — the base reader. This PR is its rebased continuation following the reset instructions: it carries gt50's reader and crkva's RX 7900 XTX review fixes from that thread (board power sensor 73 preferred, reader close() gives back the ADL/PDH handles), plus the no-card test updated for #1587's registry fallback. I cannot /reopen #1434 from this account, so this PR carries it forward.
  • #1871 (WeisTekEng) — the parallel reader attempt; its PMLog-vs-device-property link findings inform the link rule here.
  • #2614 — the community ADL report whose two link traps (a stale PMLog speed; a device property reporting wiring instead of the negotiated width) are the reason for the hybrid rule, and are covered by tests. #1733 — the Linux reader's "narrowest, slowest hop" rule this reuses. #1587 — the Windows registry name fallback.

Approach

ctypes against DLLs Windows or the Adrenalin driver already provide: no new dependency, no admin rights. The _Nvml reader interface is unchanged, the NVIDIA / Linux-AMD / macOS paths are untouched, anything that cannot be read stays None, and the #1380 gpu_note still says why (ADL did not answer, no amdgpu sysfs).

  • Load, temperature, power: ADL's PMLog sensors through atiadlxx.dll (activity 19; temperature 28/8/27/29 first supported; power 73/23/30, board power preferred where present).
  • VRAM: size from ADL MemoryInfo2; in use from the OS counter \GPU Adapter Memory(<luid>)\Dedicated Usage (pdh.dll), its adapter matched to ADL's card by PCI bus through D3DKMT (ADL's own usage call read 3,748,023 MB on a Strix Halo per #1434).
  • PCIe link (the new commit): read the card's own device properties — CM_Get_DevNode_PropertyW with DEVPKEY_PciDevice_CurrentLinkSpeed / _CurrentLinkWidth / _MaxLinkSpeed (pids 9/10/11, GUID verified against Get-PnpDeviceProperty) — on the devnode ADL names by its PnP instance string, so a disconnected phantom instance of the same card model cannot be picked. The OS values come first: #2614's RX 7900 XTX and our RDNA4 PC have both seen ADL's PMLog BUS_SPEED sit generations under the real link. ADL's PMLog 40/41 fill gaps only. A current speed above the card's own maximum is clamped to it. For the width the smaller of the device property and PMLog's lanes wins, following #1733's conservative rule, because #2614 saw a device property report the wiring (x16) over a real x4 link.
  • Docs: docs/AMD_HIP.md names the Windows sources.

Validation

Passed — all at this PR's head f1a95ecc, Windows 11, two Radeon AI PRO R9700 (device 7551, driver 32.0.32015.2008) on a Gigabyte B850 AI TOP (Ryzen 7 9850X3D), Python 3.12.10:

  • python -m unittest serve.test_server serve.test_monitor serve.test_frontend → Ran 393 tests ... OK (skipped=3). New tests: AmdWindowsTelemetry.test_link_choice (our Gen4-stale case, #2614's x4-slot case, PMLog-only fallback, clamp, out-of-range drop, nothing-at-all) and test_read_carries_the_link; faked sources, run on any OS.

  • Live reader, before this commit (branch head before it) vs after:

    before: {'util': 6, 'mem_used': 2947473408, 'mem_total': 34208743424, 'temp': 42.0, 'power': 38.0, 'power_limit': None}
    after:  {'util': 7, 'mem_used': 3104763904, 'mem_total': 34208743424, 'temp': 42.0, 'power': 38.0, 'power_limit': None,
             'pcie_gen': 5, 'pcie_gen_max': 5, 'pcie_width': 8}
    

    (both cards; VRAM in use follows the model: 27.6 GB on the card holding it, 3.1 GB on the other).

  • Link cross-check on this PC: PMLog reads Gen4 x8 (speed stale), the device property reads Gen5 x16 (the board's spec says the two full-length slots run x8/x8 when both are filled), and the shown value is Gen5 x8 — each source's known trap caught by the other.

  • Handles over 40 free_vram_mib(0, amd=True) calls: 196 → 196 (the cfgmgr32 reads keep nothing open; also re-checks #1434's review fix).

Failed: none observed.

Not run / not re-run here (kept separate per CONTRIBUTING):

  • APU (Radeon 8060S) and discrete RDNA3 numbers quoted in #1434 (incl. crkva's 7900 XTX validation) were measured on that thread's pre-rebase revisions, not on this head; I have no such hardware. The sensor- and link-choice logic is covered by the faked tests above.
  • Integrated + discrete numbering: this PC's iGPU is disabled, so card ordering by PCI bus is unverified against an iGPU pair here — unconfirmed static analysis, following #325's order as in #1434.
  • No engine builds were run: nothing under src/, include/, metal/ or sycl/ is touched — this PR changes serve/telemetry.py, serve/test_server.py and one doc line.
  • Continuous-hours soak: not run.

Limits

  • power_limit stays None on Windows AMD: sensor 47 reads 0 (= no limit set) on both our cards and the legacy Overdrive calls fail (-8) on RDNA4, so the power tile shows no "of … W limit" there.
  • PCIe throughput (MB/s) has no known source on Windows AMD (same conclusion as #1871 and #2614): the tile shows the link, no MB/s. pcie_own_gen / pcie_path (#1733) stay Linux-only.
  • In multi-GPU summaries the aggregate link keys come from the first card, as with NVIDIA; per-card values are in gpus.
  • Load/temperature/power need the Adrenalin driver (ADL); where ADL is absent, VRAM and the link still show.

🤖 Partly prepared with an AI assistant; the human contributor ran every command quoted and verified the claims.


🔄 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/3682 **Author:** [@JordanDWalters](https://github.com/JordanDWalters) **Created:** 10/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `amd-win-telemetry` --- ### 📝 Commits (4) - [`a13ac42`](https://github.com/Niko1221/Strata/commit/a13ac426f1feb74a8837fd30085d57d7570a83d6) telemetry: GPU load, VRAM, temperature and power for AMD cards on Windows (#1380) - [`1aa632f`](https://github.com/Niko1221/Strata/commit/1aa632f82d70feab626086f25357383e1fb357e2) telemetry: board power on discrete Radeons, and close the Windows AMD reader (#1434 review) - [`db05b11`](https://github.com/Niko1221/Strata/commit/db05b113fc1721b1d659e550d570bb51aafd7e81) tests: the no-card telemetry test with #1587's registry fallback - [`f1a95ec`](https://github.com/Niko1221/Strata/commit/f1a95ecce19f798e34422e090102ded1810aacfd) telemetry: PCIe link for AMD cards on Windows: the OS values first, PMLog backup (#1380) ### 📊 Changes **4 files changed** (+461 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `docs/AMD_HIP.md` (+6 -1) 📝 `serve/telemetry.py` (+310 -15) 📝 `serve/test_server.py` (+144 -0) 📝 `serve/web/app.js` (+1 -1) </details> ### 📄 Description ## Problem and result On Windows with an AMD card the Monitor shows nothing for the GPU: `serve/telemetry.py`'s AMD reader could only read the amdgpu driver's Linux sysfs files, so every GPU tile stayed empty ("–") on the released 0.2.2 (#1380, #1587). After this change the tiles are live on Windows too: load, VRAM used/total, temperature, power (board power where the card reports it, else ASIC power) and the PCIe link (generation, maximum generation, width). `free_vram_mib(amd=True)` also returns a value there again, so the free-VRAM admission check works on Windows. Verified on two Radeon AI PRO R9700 (details under Validation). ## Related discussion - #1380 — the issue this resolves (closed with #1434/#1871 in the 0.2.0-beta tracker reset, "closed here does not mean rejected"). - #1434 (gt50) — the base reader. This PR is its rebased continuation following the reset instructions: it carries gt50's reader and crkva's RX 7900 XTX review fixes from that thread (board power sensor 73 preferred, reader `close()` gives back the ADL/PDH handles), plus the no-card test updated for #1587's registry fallback. I cannot `/reopen` #1434 from this account, so this PR carries it forward. - #1871 (WeisTekEng) — the parallel reader attempt; its PMLog-vs-device-property link findings inform the link rule here. - #2614 — the community ADL report whose two link traps (a stale PMLog speed; a device property reporting wiring instead of the negotiated width) are the reason for the hybrid rule, and are covered by tests. #1733 — the Linux reader's "narrowest, slowest hop" rule this reuses. #1587 — the Windows registry name fallback. ## Approach ctypes against DLLs Windows or the Adrenalin driver already provide: no new dependency, no admin rights. The `_Nvml` reader interface is unchanged, the NVIDIA / Linux-AMD / macOS paths are untouched, anything that cannot be read stays `None`, and the #1380 `gpu_note` still says why (ADL did not answer, no amdgpu sysfs). - Load, temperature, power: ADL's PMLog sensors through `atiadlxx.dll` (activity 19; temperature 28/8/27/29 first supported; power 73/23/30, board power preferred where present). - VRAM: size from ADL `MemoryInfo2`; in use from the OS counter `\GPU Adapter Memory(<luid>)\Dedicated Usage` (`pdh.dll`), its adapter matched to ADL's card by PCI bus through D3DKMT (ADL's own usage call read 3,748,023 MB on a Strix Halo per #1434). - PCIe link (the new commit): read the card's own device properties — `CM_Get_DevNode_PropertyW` with `DEVPKEY_PciDevice_CurrentLinkSpeed` / `_CurrentLinkWidth` / `_MaxLinkSpeed` (pids 9/10/11, GUID verified against `Get-PnpDeviceProperty`) — on the devnode ADL names by its PnP instance string, so a disconnected phantom instance of the same card model cannot be picked. The OS values come first: #2614's RX 7900 XTX and our RDNA4 PC have both seen ADL's PMLog `BUS_SPEED` sit generations under the real link. ADL's PMLog 40/41 fill gaps only. A current speed above the card's own maximum is clamped to it. For the width the **smaller** of the device property and PMLog's lanes wins, following #1733's conservative rule, because #2614 saw a device property report the wiring (x16) over a real x4 link. - Docs: `docs/AMD_HIP.md` names the Windows sources. ## Validation **Passed** — all at this PR's head `f1a95ecc`, Windows 11, two Radeon AI PRO R9700 (device 7551, driver 32.0.32015.2008) on a Gigabyte B850 AI TOP (Ryzen 7 9850X3D), Python 3.12.10: - `python -m unittest serve.test_server serve.test_monitor serve.test_frontend` → `Ran 393 tests ... OK (skipped=3)`. New tests: `AmdWindowsTelemetry.test_link_choice` (our Gen4-stale case, #2614's x4-slot case, PMLog-only fallback, clamp, out-of-range drop, nothing-at-all) and `test_read_carries_the_link`; faked sources, run on any OS. - Live reader, before this commit (branch head before it) vs after: ```text before: {'util': 6, 'mem_used': 2947473408, 'mem_total': 34208743424, 'temp': 42.0, 'power': 38.0, 'power_limit': None} after: {'util': 7, 'mem_used': 3104763904, 'mem_total': 34208743424, 'temp': 42.0, 'power': 38.0, 'power_limit': None, 'pcie_gen': 5, 'pcie_gen_max': 5, 'pcie_width': 8} ``` (both cards; VRAM in use follows the model: 27.6 GB on the card holding it, 3.1 GB on the other). - Link cross-check on this PC: PMLog reads Gen4 x8 (speed stale), the device property reads Gen5 x16 (the board's spec says the two full-length slots run x8/x8 when both are filled), and the shown value is Gen5 x8 — each source's known trap caught by the other. - Handles over 40 `free_vram_mib(0, amd=True)` calls: 196 → 196 (the cfgmgr32 reads keep nothing open; also re-checks #1434's review fix). **Failed:** none observed. **Not run / not re-run here** (kept separate per CONTRIBUTING): - APU (Radeon 8060S) and discrete RDNA3 numbers quoted in #1434 (incl. crkva's 7900 XTX validation) were measured on that thread's pre-rebase revisions, not on this head; I have no such hardware. The sensor- and link-choice logic is covered by the faked tests above. - Integrated + discrete numbering: this PC's iGPU is disabled, so card ordering by PCI bus is unverified against an iGPU pair here — unconfirmed static analysis, following #325's order as in #1434. - No engine builds were run: nothing under `src/`, `include/`, `metal/` or `sycl/` is touched — this PR changes `serve/telemetry.py`, `serve/test_server.py` and one doc line. - Continuous-hours soak: not run. ## Limits - `power_limit` stays `None` on Windows AMD: sensor 47 reads 0 (= no limit set) on both our cards and the legacy Overdrive calls fail (-8) on RDNA4, so the power tile shows no "of … W limit" there. - PCIe throughput (MB/s) has no known source on Windows AMD (same conclusion as #1871 and #2614): the tile shows the link, no MB/s. `pcie_own_gen` / `pcie_path` (#1733) stay Linux-only. - In multi-GPU summaries the aggregate link keys come from the first card, as with NVIDIA; per-card values are in `gpus`. - Load/temperature/power need the Adrenalin driver (ADL); where ADL is absent, VRAM and the link still show. 🤖 Partly prepared with an AI assistant; the human contributor ran every command quoted and verified the claims. --- <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#4748
No description provided.