[PR #4980] [CLOSED] [TUI] read AMD GPU utilization, VRAM, temp, and power on Windows #5275

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

📋 Pull Request Information

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

Base: main ← Head: win-amd-telemetry


📝 Commits (1)

  • 7754f81 [TUI] read AMD GPU utilization, VRAM, temp, and power on Windows

📊 Changes

3 files changed (+354 additions, -13 deletions)

View changed files

📝 serve/telemetry.py (+126 -4)
📝 strata_cli/client.py (+64 -9)
📝 strata_cli/overview.py (+164 -0)

📄 Description

Problem and result

On Windows, when running Strata with an AMD graphics card (HIP backend), the Overview dashboard tiles for GPU load, VRAM, GPU temp, and Power (as well as strata status) display --. This happens because _Amd in serve/telemetry.py only implements Linux sysfs (/sys/class/drm/) readings, leaving gpu_reader(..., amd=True) returning unreadable on Windows (noted in #1380 / #1587).

With this change, Windows AMD cards report active VRAM usage and compute/3D engine load via Windows PDH performance counters, and temperature and ASIC power via AMD's ADL library (atiadlxx.dll). The Overview dashboard tiles and strata status render live readings and sparkline histories instead of --.

References the existing TODO notes in serve/telemetry.py lines 555-574 (#1380, #1587). Otherwise none.

Approach

  1. Hardware Telemetry (serve/telemetry.py):
    • Added _AmdWin as the Windows reader for gpu_reader(index, amd=True).
    • Uses AMD ADL2 PMLog API (atiadlxx.dll, available with standard AMD Windows drivers) to read edge/hotspot temperature (PMLOG_TEMPERATURE_EDGE/HOTSPOT) and current board power (PMLOG_ASIC_POWER).
    • Uses Windows native PDH counters (\GPU Local Adapter Memory(*)\Local Usage and \GPU Engine(*)\Utilization Percentage) to read dedicated video memory and compute load without external Python package dependencies.
    • Preserves existing registry lookup in windows_amd_cards() for adapter names and total capacity.
  2. Dashboard & Client Fallbacks (strata_cli/overview.py, strata_cli/client.py):
    • In overview.py, added _get_windows_gpu_sample to feed VRAM, load, temp, and power into history deques (temp_hist, power_hist), enabling dynamic sparkline rendering.
    • In client.py, filled in device normalization fallbacks so strata status and the Hardware pane reflect active metrics.
    • Zero changes to non-Windows or non-AMD code paths.

Validation

Passed:

  • python -c "from serve import telemetry; g = telemetry.gpu_reader(0, amd=True); print(g.ok(), g.read())"
    Environment: Windows 11 / AMD Radeon PRO W6800 (32 GB) / Python 3.10
    Result: True {'temp': 32.0, 'power': 12.0, 'mem_used': 33034072064, 'util': 0.0}
  • python -c "from strata_cli import overview; ...; print(overview.render(model, 100, 30))"
    Result: Rendered Overview panel successfully, displaying 31 °C, 12 W, and 30.8 / 32 GB VRAM tiles with valid sparkline characters.
  • python -c "from strata_cli import client; print(client.sanitize_telemetry(raw)['devices'])"
    Result: Correctly sanitized device list with populated mem_used, temp, and power.
  • python -m unittest serve/test_prometheus.py
    Result: Ran 6 tests in 2.293s - OK

Failed:
none observed

Not run:

  • Multi-card AMD setup on Windows (tested on a single Radeon PRO W6800 card; multiple discrete cards remain unverified).
  • Linux amdgpu sysfs paths (untouched by this PR).

Limits

  • PCIe RX/TX throughput for AMD cards on Windows remains -- (not exposed by the queried PDH counters or basic PMLog).
  • Power limit cap (power_limit) is not parsed for Overdrive 8 on Windows yet; the tile displays current wattage without the limit subtitle.

🔄 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/4980 **Author:** [@YuukiReina2023](https://github.com/YuukiReina2023) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `win-amd-telemetry` --- ### 📝 Commits (1) - [`7754f81`](https://github.com/Niko1221/Strata/commit/7754f814a6a4acaf4e193501b4f416b7b2047de1) [TUI] read AMD GPU utilization, VRAM, temp, and power on Windows ### 📊 Changes **3 files changed** (+354 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `serve/telemetry.py` (+126 -4) 📝 `strata_cli/client.py` (+64 -9) 📝 `strata_cli/overview.py` (+164 -0) </details> ### 📄 Description ## Problem and result On Windows, when running Strata with an AMD graphics card (HIP backend), the Overview dashboard tiles for `GPU load`, `VRAM`, `GPU temp`, and `Power` (as well as `strata status`) display `--`. This happens because `_Amd` in `serve/telemetry.py` only implements Linux `sysfs` (`/sys/class/drm/`) readings, leaving `gpu_reader(..., amd=True)` returning unreadable on Windows (noted in #1380 / #1587). With this change, Windows AMD cards report active VRAM usage and compute/3D engine load via Windows PDH performance counters, and temperature and ASIC power via AMD's ADL library (`atiadlxx.dll`). The Overview dashboard tiles and `strata status` render live readings and sparkline histories instead of `--`. ## Related discussion References the existing TODO notes in `serve/telemetry.py` lines 555-574 (`#1380`, `#1587`). Otherwise none. ## Approach 1. **Hardware Telemetry (`serve/telemetry.py`)**: - Added `_AmdWin` as the Windows reader for `gpu_reader(index, amd=True)`. - Uses AMD ADL2 PMLog API (`atiadlxx.dll`, available with standard AMD Windows drivers) to read edge/hotspot temperature (`PMLOG_TEMPERATURE_EDGE`/`HOTSPOT`) and current board power (`PMLOG_ASIC_POWER`). - Uses Windows native PDH counters (`\GPU Local Adapter Memory(*)\Local Usage` and `\GPU Engine(*)\Utilization Percentage`) to read dedicated video memory and compute load without external Python package dependencies. - Preserves existing registry lookup in `windows_amd_cards()` for adapter names and total capacity. 2. **Dashboard & Client Fallbacks (`strata_cli/overview.py`, `strata_cli/client.py`)**: - In `overview.py`, added `_get_windows_gpu_sample` to feed VRAM, load, temp, and power into history deques (`temp_hist`, `power_hist`), enabling dynamic sparkline rendering. - In `client.py`, filled in device normalization fallbacks so `strata status` and the Hardware pane reflect active metrics. - Zero changes to non-Windows or non-AMD code paths. ## Validation **Passed:** - `python -c "from serve import telemetry; g = telemetry.gpu_reader(0, amd=True); print(g.ok(), g.read())"` Environment: Windows 11 / AMD Radeon PRO W6800 (32 GB) / Python 3.10 Result: `True {'temp': 32.0, 'power': 12.0, 'mem_used': 33034072064, 'util': 0.0}` - `python -c "from strata_cli import overview; ...; print(overview.render(model, 100, 30))"` Result: Rendered Overview panel successfully, displaying `31 °C`, `12 W`, and `30.8 / 32 GB` VRAM tiles with valid sparkline characters. - `python -c "from strata_cli import client; print(client.sanitize_telemetry(raw)['devices'])"` Result: Correctly sanitized device list with populated `mem_used`, `temp`, and `power`. - `python -m unittest serve/test_prometheus.py` Result: `Ran 6 tests in 2.293s - OK` **Failed:** none observed **Not run:** - Multi-card AMD setup on Windows (tested on a single Radeon PRO W6800 card; multiple discrete cards remain unverified). - Linux amdgpu sysfs paths (untouched by this PR). ## Limits - PCIe RX/TX throughput for AMD cards on Windows remains `--` (not exposed by the queried PDH counters or basic PMLog). - Power limit cap (`power_limit`) is not parsed for Overdrive 8 on Windows yet; the tile displays current wattage without the limit subtitle. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:33:59 +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#5275
No description provided.