mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4999] [TUI] read AMD GPU utilization, VRAM, temp, and PCIe link on Windows #5282
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#5282
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/4999
Author: @YuukiReina2023
Created: 11/2/2026
Status: 🔄 Open
Base:
main← Head:win-amd-telemetry📝 Commits (1)
795bbc8[TUI] read AMD GPU utilization, VRAM, temp, and PCIe link on Windows📊 Changes
3 files changed (+526 additions, -20 deletions)
View changed files
📝
serve/telemetry.py(+242 -5)📝
strata_cli/client.py(+64 -9)📝
strata_cli/overview.py(+220 -6)📄 Description
Problem and result
On Windows with AMD Radeon GPUs (HIP backend), the TUI Overview and Web Dashboard (
http://127.0.0.1:8080) previously reported0 %or--for AMD telemetry:0 %with an empty/flat sparkline track (_______________) even while the GPU was actively processing prompts or generating tokens.-- / 32 GBor incomplete capacity without real-time usage.-- °Cwithout edge or junction/hotspot readings.-- Wwith no board power consumption figures.—(dash) due to missinggpu_pcie_*telemetry fields in/metrics; the TUI displayedPCIe to GPU --or idle-downclockedGen2 x16without exposing the bus capability (Gen4 x16).After this change:
The server and TUI read AMD GPU telemetry on Windows directly via the AMD Display Library (ADL:
atiadlxx.dll), Windows Performance Data Helper (PDH:pdh.dll), and Windows Configuration Manager (PnP:cfgmgr32.dll):30.7 / 32 GB) matched against total adapter memory from the Windows display registry.52 °C) with junction hotspot subtitle (hotspot 53 °C) and a dynamically scaled thermal sparkline.41 W/ up to200+ Wunder load) with rolling power sparkline.Gen4 x16) displayed across both the Web dashboard and TUI Overview without dropping into null or idle-downgrade.Related discussion
Approach
Windows AMD GPU Reader (
serve/telemetry.py):_AmdWin(_Amd)using standardctypesbindings toatiadlxx.dllandpdh.dll.PMLOG_INFO_ACTIVITY_GFX) / Sensor 20 (PMLOG_INFO_ACTIVITY_MEM): Compute activity percentage.PMLOG_TEMPERATURE_EDGE) & Sensor 27 (PMLOG_TEMPERATURE_HOTSPOT): Edge and junction temperatures.PMLOG_ASIC_POWER): Total ASIC power consumption in Watts.ADL_PMLOG_BUS_SPEED) & Sensor 41 (ADL_PMLOG_BUS_LANES): Current PCIe link speed and width.cfgmgr32.dll):_windows_pci_link()queriesDEVPKEY_PciDevice_MaxLinkSpeedandDEVPKEY_PciDevice_CurrentLinkWidthfor the active display adapter. This exposespcie_gen_max(e.g. Gen 4) so both Web and TUI properly display the hardware capability (Gen4 x16) even when ASPM drops the idle link to Gen 2.HardwareInformation.qwMemorySize).\GPU Local Adapter Memory(*)\Local Usage.\GPU Engine(*)\Utilization Percentageprovides fallback GPU engine activity._AmdWininherits from_Amdand delegates tosuper()wheneverself.devexists or in mock unit tests (SYSFS != "/sys").TUI Overview & Sparkline Animation (
strata_cli/overview.py):_WinPdhsampler in the CLI to poll ADL/PDH metrics for live local rendering.all(x in (None, 0.0) for x in g["util_hist"])allows active local samples to immediately animate the sparkline instead of locking into a flat empty track.pcie_gen_maxover idle link downclock so PCIe displaysGen4 x16.t_lo,t_hi) to prevent temperature sparklines from flattening.Client Telemetry Normalization (
strata_cli/client.py):mem_used,mem_total,util,temp,powerfordevicesrows on Windows, ensuring multi-GPU card strips and device views do not display--.Validation
Tested on revision commit
795bbc88(branchwin-amd-telemetryrebased onmain), Windows 11 (build 26100), AMD Radeon PRO W6800 (32 GB, Navi 21 / RDNA2), Driver 32.0.21045.1000, modelqwen3.8-flash-next-iq3_xxs256K context:Passed:
http://127.0.0.1:8080:Observed
/metricsresponse containsgpu_name: "AMD Radeon PRO W6800",gpu_mem_used: 32945180672,gpu_mem_total: 34342961152,gpu_util: 22.0,gpu_temp: 52.0,gpu_temp_hotspot: 53.0,gpu_power: 41.0,gpu_pcie_gen: 2,gpu_pcie_gen_max: 4,gpu_pcie_width: 16, and 60 rolling samples inhistory.gpu_util. The Web UI displays 22% GPU load with green wavy activity graph, 30.7 / 32 GB VRAM, 52 °C temp graph, 41 W power graph, andGen4 x16PCIe link.strata monitor --url http://127.0.0.1:8080):GPU load tile displays
22 %with animated sparkline▁▂▂▂▂▃▂▂▁▁▃▂▁▁▁▁▁▆▂▁, PCIe tile displaysGen4 x16withto GPU --, VRAM displays30.7 / 32 GB(3,435 experts cached), GPU temp displays52 °C(hotspot 53 °C), Power displays41 W.serve.test_server.AmdTelemetry:python -m unittest serve.test_server.AmdTelemetry -v-> 3/3 passed (verifies sysfs parsing, free VRAM calculation, and PCIe link hop selection).tests.terminal.test_tuiqa_monitor:python -m unittest tests.terminal.test_tuiqa_monitor -v-> 18/18 passed (verifies all monitor views, tab navigation, and themes).tools/test_windows_amd_gpu.py:python tools/test_windows_amd_gpu.py-> 5/5 passed (verifies ADL initialization, PDH queries, display adapter registry parsing, and fallback handling).Failed:
Not run:
Limits
pcie_rx_mb,pcie_tx_mb) is only exposed by NVIDIA NVML counters; on AMD GPUs (both Windows and Linux sysfs), throughput is not exposed by the driver and defaults to--. Link generation and width (Gen4 x16) are fully supported.atiadlxx.dll, present on all standard AMD driver installations).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.