[PR #4884] [Other] Telemetry: Windows AMD ADL2 readings, per-card tiles, PCIe link #5231

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4884
Author: @lwYeo
Created: 11/1/2026
Status: 🔄 Open

Base: main ← Head: feature/amd-telemetry


📝 Commits (2)

  • 05febdd telemetry: Windows AMD ADL2 readings, per-card tiles, PCIe link
  • d0b8db9 telemetry: no console window for the Device Manager query, off the first-read path

📊 Changes

11 files changed (+966 additions, -140 deletions)

View changed files

📝 docs/DETAILS.md (+11 -0)
📝 serve/prometheus.py (+17 -0)
📝 serve/server.py (+95 -10)
📝 serve/telemetry.py (+427 -22)
📝 serve/test_monitor.py (+56 -0)
📝 serve/test_prometheus.py (+19 -0)
📝 serve/test_server.py (+55 -93)
➕ serve/test_telemetry_adl.py (+186 -0)
📝 serve/web/app.css (+5 -1)
📝 serve/web/app.js (+76 -13)
📝 serve/web/index.html (+19 -1)

📄 Description

[Other] Telemetry: Windows AMD ADL2 readings, per-card tiles, PCIe link

Problem and result

On Windows the Web Monitor showed no AMD readings: the GPU tile said "no reading" and the PCIe line was blank, and a model split across two cards got one tile, not one per card.

After: the Monitor reads AMD cards on Windows through the driver's own AMD Display Library (ADL2 PMLog, atiadlxx.dll) — the same interface HWInfo and LibreHardwareMonitor use, so no ROCm and no pip package — and shows one tile per card on a split, each with load, VRAM, temperature, power and the slot's PCIe generation and width. A reading the driver does not report is blank, never guessed.

#2704 — this is the telemetry part of the split agreed there (the Windows multi-GPU setup part is a separate PR).

Approach

Ported from the telemetry part of #2704 (commits d0dcf489 — the AMD telemetry on Windows, on the closed PR's branch D4ve0s:feature/windows-amd-vision-telemetry — and 3c615f4b — release every ADL2 handle a reader takes), squashed and hand-adapted to current main:

  • serve/telemetry.py: the ADL2 ctypes bindings (structs built once, every call guarded — the ABI varies by Adrenalin version) and an _AmdWin reader with the same interface as _Nvml: util, mem_used, mem_total, temp, power, power_limit, and best-effort pcie_gen_max / pcie_width from the card's Plug-and-Play record (ADL PMLog's BUS_SPEED reports the root complex, not the slot). The PMLog stream starts at setup and a stalled stream is restarted. gpu_reader builds it only on Windows with the AMD backend; the Linux sysfs and macOS IOKit paths are main's, untouched.
  • serve/server.py: the payload hunks only (image-encoder card, the "reading N pictures" live line, per-request encoder stats, the Windows AMD vram-reserve floor, closing throwaway AMD reader handles), on top of main's server.py, so main's newer features (answer_room, model-card sampling, scrape-window gauges, kept prompts, chunk fields) stay. Service.__init__ gets answer_room=True (main set it only in main(), so a Service built by hand — the Monitor tests, embedding — crashed on it).
  • serve/test_server.py loses the AmdTelemetry class (it tested the reader code this commit replaces); serve/test_telemetry_adl.py is its replacement. MacTelemetry stays.
  • Docs: the Monitor's PCIe-tile paragraph (DETAILS.md).

Review follow-up (d0b8db9b): the Device Manager query flashed a console window on a server started without one (desktop app, tray helper, pythonw) — creationflags=CREATE_NO_WINDOW stops it. Its first query (~4.5 s measured) ran on the first read(), which can be the free-VRAM admission check before a model load — it now runs in a daemon thread, the first read returns {} and the tiles fill a few seconds later. A failed query is retried at most every 60 s, not on every 1-second sample.

Compatibility: Windows AMD only; NVIDIA, Linux AMD and macOS readers unchanged. Everything is best-effort — a missing driver or sensor leaves the tile blank and nothing here can stop the server.

Validation

Branch feature/amd-telemetry @ d0b8db9b on main 146df3c4. Environment: Windows 11, Gigabyte X870E, AMD RX 6800 XT (gfx1030) + AI PRO R9700 (gfx1201), 48 GB RAM.

Passed:

  • .venv\Scripts\python.exe -m unittest serve.test_telemetry_adl serve.test_prometheus serve.test_monitor serve.test_server → Ran 404 tests, OK (skipped=3) on this PC (head d0b8db9b on main 146df3c4).
  • The ADL2 sampler on live cards: the same code has been serving the Monitor on this PC (the 6800 XT + R9700 split) from the source branch, with per-card tiles and the PCIe link observed (HWInfo cross-check on this Gigabyte X870E board: RX 9070 XT Gen5 x8, AI PRO R9700 Gen5 x4; now: 6800 XT Gen4 x8, R9700 Gen5 x8).
  • Reviewer hardware validation (see the thread): RX 7900 XTX (gfx1100), 386 passed, 30 samples under real load agreeing with a second ADL reader, handle delta 0.

Failed: none observed.

Not run:

  • The Linux sysfs and macOS IOKit telemetry paths (not modified; no Linux/macOS environment here).
  • ADL2 on machines with other Adrenalin driver versions — every call is guarded, but only this PC's and the reviewer's driver are exercised.

Limits

  • ADL2 needs the AMD driver installed; sensors the driver does not report stay blank.
  • pcie_width from the PnP record is the slot's maximum; the lanes the card runs at can be lower (motherboard bifurcation), as the code comment states.
  • The power-limit reading is absent on cards the driver does not expose it for.

🔄 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/4884 **Author:** [@lwYeo](https://github.com/lwYeo) **Created:** 11/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/amd-telemetry` --- ### 📝 Commits (2) - [`05febdd`](https://github.com/Niko1221/Strata/commit/05febddcb1c5453999deb5fe4f67464a38fc777e) telemetry: Windows AMD ADL2 readings, per-card tiles, PCIe link - [`d0b8db9`](https://github.com/Niko1221/Strata/commit/d0b8db9bedf0ffbf93fe682ded569a5cd9552fe4) telemetry: no console window for the Device Manager query, off the first-read path ### 📊 Changes **11 files changed** (+966 additions, -140 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+11 -0) 📝 `serve/prometheus.py` (+17 -0) 📝 `serve/server.py` (+95 -10) 📝 `serve/telemetry.py` (+427 -22) 📝 `serve/test_monitor.py` (+56 -0) 📝 `serve/test_prometheus.py` (+19 -0) 📝 `serve/test_server.py` (+55 -93) ➕ `serve/test_telemetry_adl.py` (+186 -0) 📝 `serve/web/app.css` (+5 -1) 📝 `serve/web/app.js` (+76 -13) 📝 `serve/web/index.html` (+19 -1) </details> ### 📄 Description [Other] Telemetry: Windows AMD ADL2 readings, per-card tiles, PCIe link ## Problem and result On Windows the Web Monitor showed no AMD readings: the GPU tile said "no reading" and the PCIe line was blank, and a model split across two cards got one tile, not one per card. After: the Monitor reads AMD cards on Windows through the driver's own AMD Display Library (ADL2 PMLog, `atiadlxx.dll`) — the same interface HWInfo and LibreHardwareMonitor use, so no ROCm and no pip package — and shows one tile per card on a split, each with load, VRAM, temperature, power and the slot's PCIe generation and width. A reading the driver does not report is blank, never guessed. ## Related discussion #2704 — this is the telemetry part of the split agreed there (the Windows multi-GPU setup part is a separate PR). ## Approach Ported from the telemetry part of #2704 (commits `d0dcf489` — the AMD telemetry on Windows, on the closed PR's branch `D4ve0s:feature/windows-amd-vision-telemetry` — and `3c615f4b` — release every ADL2 handle a reader takes), squashed and hand-adapted to current main: - `serve/telemetry.py`: the ADL2 ctypes bindings (structs built once, every call guarded — the ABI varies by Adrenalin version) and an `_AmdWin` reader with the same interface as `_Nvml`: util, mem_used, mem_total, temp, power, power_limit, and best-effort `pcie_gen_max` / `pcie_width` from the card's Plug-and-Play record (ADL PMLog's BUS_SPEED reports the root complex, not the slot). The PMLog stream starts at setup and a stalled stream is restarted. `gpu_reader` builds it only on Windows with the AMD backend; the Linux sysfs and macOS IOKit paths are main's, untouched. - `serve/server.py`: the payload hunks only (image-encoder card, the "reading N pictures" live line, per-request encoder stats, the Windows AMD vram-reserve floor, closing throwaway AMD reader handles), on top of main's server.py, so main's newer features (answer_room, model-card sampling, scrape-window gauges, kept prompts, chunk fields) stay. `Service.__init__` gets `answer_room=True` (main set it only in `main()`, so a Service built by hand — the Monitor tests, embedding — crashed on it). - `serve/test_server.py` loses the `AmdTelemetry` class (it tested the reader code this commit replaces); `serve/test_telemetry_adl.py` is its replacement. `MacTelemetry` stays. - Docs: the Monitor's PCIe-tile paragraph (DETAILS.md). **Review follow-up (`d0b8db9b`):** the Device Manager query flashed a console window on a server started without one (desktop app, tray helper, `pythonw`) — `creationflags=CREATE_NO_WINDOW` stops it. Its first query (~4.5 s measured) ran on the first `read()`, which can be the free-VRAM admission check before a model load — it now runs in a daemon thread, the first read returns `{}` and the tiles fill a few seconds later. A failed query is retried at most every 60 s, not on every 1-second sample. Compatibility: Windows AMD only; NVIDIA, Linux AMD and macOS readers unchanged. Everything is best-effort — a missing driver or sensor leaves the tile blank and nothing here can stop the server. ## Validation Branch `feature/amd-telemetry` @ `d0b8db9b` on main `146df3c4`. Environment: Windows 11, Gigabyte X870E, AMD RX 6800 XT (gfx1030) + AI PRO R9700 (gfx1201), 48 GB RAM. **Passed:** - `.venv\Scripts\python.exe -m unittest serve.test_telemetry_adl serve.test_prometheus serve.test_monitor serve.test_server` → **Ran 404 tests, OK (skipped=3)** on this PC (head `d0b8db9b` on main `146df3c4`). - The ADL2 sampler on live cards: the same code has been serving the Monitor on this PC (the 6800 XT + R9700 split) from the source branch, with per-card tiles and the PCIe link observed (HWInfo cross-check on this Gigabyte X870E board: RX 9070 XT Gen5 x8, AI PRO R9700 Gen5 x4; now: 6800 XT Gen4 x8, R9700 Gen5 x8). - Reviewer hardware validation (see the thread): RX 7900 XTX (gfx1100), 386 passed, 30 samples under real load agreeing with a second ADL reader, handle delta 0. **Failed:** none observed. **Not run:** - The Linux sysfs and macOS IOKit telemetry paths (not modified; no Linux/macOS environment here). - ADL2 on machines with other Adrenalin driver versions — every call is guarded, but only this PC's and the reviewer's driver are exercised. ## Limits - ADL2 needs the AMD driver installed; sensors the driver does not report stay blank. - `pcie_width` from the PnP record is the slot's maximum; the lanes the card runs at can be lower (motherboard bifurcation), as the code comment states. - The power-limit reading is absent on cards the driver does not expose it for. --- <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#5231
No description provided.