[PR #4998] [CLOSED] [TUI] read AMD GPU utilization, VRAM, temp, and PCIe link on Windows #5281

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4998
Author: @YuukiReina2023
Created: 11/2/2026
Status: ❌ Closed

Base: main ← Head: win-amd-telemetry


📝 Commits (1)

  • f49b206 [TUI] read AMD GPU utilization, VRAM, temp, and PCIe link on Windows

📊 Changes

3 files changed (+416 additions, -17 deletions)

View changed files

📝 serve/telemetry.py (+155 -5)
📝 strata_cli/client.py (+64 -9)
📝 strata_cli/overview.py (+197 -3)

📄 Description

Problem and result

On Windows, Strata running with the AMD HIP backend displayed -- or 0 % across the Overview dashboard tiles (GPU load, VRAM, GPU temp, Power, PCIe). Direct3D engine counters in Windows PDH do not track ROCm/HIP compute execution, AMD Linux sysfs paths do not exist on Windows, and the temp sparkline with fixed bounds lo=20, hi=100 rendered as an unbroken solid block in the console glyph set.

After this change, the Overview TUI on Windows AMD correctly displays live GPU compute utilization (e.g. 74–99% under prompt evaluation and generation), VRAM usage and capacity (e.g. 30.9 / 32 GB), edge temperature and hotspot junction temperature with adaptive history scaling, ASIC power draw in watts, and the negotiated PCIe generation and link width (e.g. Gen4 x16 / Gen2 x16).

none

Approach

  • Add _AmdWin subclassing _Amd in serve/telemetry.py:
    • Queries AMD Display Library (atiadlxx.dll) via ADL2_New_QueryPMLogData_Get:
      • Sensor 19 (PMLOG_INFO_ACTIVITY_GFX) for hardware compute/graphics utilization (falls back to Sensor 20 memory activity or PDH).
      • Sensor 8 (PMLOG_TEMPERATURE_EDGE) for edge temperature and Sensor 27 (PMLOG_TEMPERATURE_HOTSPOT) for hotspot junction temperature.
      • Sensor 23 (PMLOG_ASIC_POWER) for live ASIC power draw in watts.
      • Sensor 40 (PMLOG_BUS_SPEED) and Sensor 41 (PMLOG_BUS_LANES) for PCIe link generation and lane width.
    • Reads adapter VRAM total from the Windows Display Adapter registry class and live local usage via Windows PDH \GPU Local Adapter Memory(*)\Local Usage.
    • Preserves existing _Amd sysfs logic whenever self.dev is set or when tests mock SYSFS != "/sys", ensuring no regressions in Linux/CI test fixtures.
  • In strata_cli/overview.py:
    • Mirrors ADL telemetry fallback in _WinPdh for client-side monitoring against uninstrumented servers.
    • Updates _tile("GPU temp", ...) to display hotspot junction temperature in the subtitle and scales the sparkline dynamically across recent temperature history to reveal thermal rise and fall.
    • Displays negotiated PCIe link generation and width (e.g. Gen4 x16) in _tile("PCIe", ...).
  • In strata_cli/client.py:
    • Adds Windows device telemetry fallback in sanitize_telemetry and normalize_legacy to ensure single-GPU and multi-card devices retain valid memory and sensor properties.

Validation

Passed:

  • python -m unittest serve.test_server.AmdTelemetry -v on Windows 11 (3/3 passed).
  • python tools/test_windows_amd_gpu.py (5/5 passed).
  • python -m unittest tests.terminal.test_tuiqa_monitor -v (18/18 passed).
  • Live execution on AMD Radeon PRO W6800 (Windows 11, Driver 32.0.21045.1000):
    Launched qwen3.8-flash-next-iq3_xxs on HIP backend. Verified live Overview rendering:
    • GPU load: 99% during prompt evaluation
    • VRAM: 30.9 / 32 GB
    • GPU temp: 56 °C, subtitle hotspot 62 °C with visible thermal curve
    • Power: 62 W
    • PCIe: Gen2 x16 at idle, Gen4 x16 under load

Failed:
none observed

Not run:
Physical hardware runs on macOS Metal and Linux ROCm (code path is guarded by os.name == "nt"; sysfs mock tests passed).

Limits

AMD does not expose an instantaneous PCIe bandwidth throughput counter (MB/s) through ADL PMLog or Windows PDH without kernel-mode ETW profiling; pcie_rx therefore displays -- while generation and width (GenX xY) are fully resolved.


🔄 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/4998 **Author:** [@YuukiReina2023](https://github.com/YuukiReina2023) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `win-amd-telemetry` --- ### 📝 Commits (1) - [`f49b206`](https://github.com/Niko1221/Strata/commit/f49b20615f6112ac9571d368034d1cf0091520e2) [TUI] read AMD GPU utilization, VRAM, temp, and PCIe link on Windows ### 📊 Changes **3 files changed** (+416 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `serve/telemetry.py` (+155 -5) 📝 `strata_cli/client.py` (+64 -9) 📝 `strata_cli/overview.py` (+197 -3) </details> ### 📄 Description ## Problem and result On Windows, Strata running with the AMD HIP backend displayed `--` or `0 %` across the Overview dashboard tiles (GPU load, VRAM, GPU temp, Power, PCIe). Direct3D engine counters in Windows PDH do not track ROCm/HIP compute execution, AMD Linux sysfs paths do not exist on Windows, and the temp sparkline with fixed bounds `lo=20, hi=100` rendered as an unbroken solid block in the console glyph set. After this change, the Overview TUI on Windows AMD correctly displays live GPU compute utilization (e.g. 74–99% under prompt evaluation and generation), VRAM usage and capacity (e.g. 30.9 / 32 GB), edge temperature and hotspot junction temperature with adaptive history scaling, ASIC power draw in watts, and the negotiated PCIe generation and link width (e.g. `Gen4 x16` / `Gen2 x16`). ## Related discussion none ## Approach - Add `_AmdWin` subclassing `_Amd` in `serve/telemetry.py`: - Queries AMD Display Library (`atiadlxx.dll`) via `ADL2_New_QueryPMLogData_Get`: - `Sensor 19 (PMLOG_INFO_ACTIVITY_GFX)` for hardware compute/graphics utilization (falls back to Sensor 20 memory activity or PDH). - `Sensor 8 (PMLOG_TEMPERATURE_EDGE)` for edge temperature and `Sensor 27 (PMLOG_TEMPERATURE_HOTSPOT)` for hotspot junction temperature. - `Sensor 23 (PMLOG_ASIC_POWER)` for live ASIC power draw in watts. - `Sensor 40 (PMLOG_BUS_SPEED)` and `Sensor 41 (PMLOG_BUS_LANES)` for PCIe link generation and lane width. - Reads adapter VRAM total from the Windows Display Adapter registry class and live local usage via Windows PDH `\GPU Local Adapter Memory(*)\Local Usage`. - Preserves existing `_Amd` sysfs logic whenever `self.dev` is set or when tests mock `SYSFS != "/sys"`, ensuring no regressions in Linux/CI test fixtures. - In `strata_cli/overview.py`: - Mirrors ADL telemetry fallback in `_WinPdh` for client-side monitoring against uninstrumented servers. - Updates `_tile("GPU temp", ...)` to display hotspot junction temperature in the subtitle and scales the sparkline dynamically across recent temperature history to reveal thermal rise and fall. - Displays negotiated PCIe link generation and width (e.g. `Gen4 x16`) in `_tile("PCIe", ...)`. - In `strata_cli/client.py`: - Adds Windows device telemetry fallback in `sanitize_telemetry` and `normalize_legacy` to ensure single-GPU and multi-card devices retain valid memory and sensor properties. ## Validation **Passed:** - `python -m unittest serve.test_server.AmdTelemetry -v` on Windows 11 (3/3 passed). - `python tools/test_windows_amd_gpu.py` (5/5 passed). - `python -m unittest tests.terminal.test_tuiqa_monitor -v` (18/18 passed). - Live execution on AMD Radeon PRO W6800 (Windows 11, Driver 32.0.21045.1000): Launched `qwen3.8-flash-next-iq3_xxs` on HIP backend. Verified live Overview rendering: - `GPU load`: 99% during prompt evaluation - `VRAM`: 30.9 / 32 GB - `GPU temp`: 56 °C, subtitle `hotspot 62 °C` with visible thermal curve - `Power`: 62 W - `PCIe`: `Gen2 x16` at idle, `Gen4 x16` under load **Failed:** none observed **Not run:** Physical hardware runs on macOS Metal and Linux ROCm (code path is guarded by `os.name == "nt"`; sysfs mock tests passed). ## Limits AMD does not expose an instantaneous PCIe bandwidth throughput counter (MB/s) through ADL PMLog or Windows PDH without kernel-mode ETW profiling; `pcie_rx` therefore displays `--` while generation and width (`GenX xY`) are fully resolved. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:34:02 +07:00
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#5281
No description provided.