mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2273] [CLOSED] serve: an AMD card's load, VRAM, temperature and power on Windows #3957
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#3957
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/2273
Author: @unimo-chan
Created: 10/13/2026
Status: ❌ Closed
Base:
main← Head:windows-amd-telemetry📝 Commits (1)
c9f919aserve: an AMD card's load, VRAM, temperature and power on Windows (#1380)📊 Changes
2 files changed (+332 additions, -8 deletions)
View changed files
📝
serve/telemetry.py(+331 -7)📝
serve/test_server.py(+1 -1)📄 Description
What this changes
On Windows an AMD card has no NVML and no amdgpu sysfs, so
serve/telemetry.pyhad nothing to read and thedashboard said "no GPU load or VRAM readings for AMD cards on Windows yet" (the
gpu_notebelow, from #1380).This adds a reader built from what the machine does have — all of it through
ctypes, no package:CreateDXGIFactory1→EnumAdapters1→GetDesc1): the card's name, its dedicated memory total,and its LUID. The card is the one whose vendor ID is 0x1002, so an NVIDIA display card in the same PC is not
mistaken for the card the engine runs on.
PdhAddEnglishCounterW, English counter names, instances picked by that LUID) — thesame counters Task Manager's GPU column reads:
\GPU Adapter Memory(luid_…)\Dedicated Usagefor the VRAM inuse,
\GPU Engine(*luid_…*)\Utilization Percentagefor load (the busiest engine, which is what Task Managershows; measured on this machine: 93% on the compute engine where the
Running Timecounter beside it computed94% over the same window). DXGI's own
QueryVideoMemoryInfois per-process and reported 0 while the engineheld 19 GiB, so it is not used.
amdadlx64.dll, installed with the Adrenalin driver) for temperature and power: the ADLX servicesreached through their vtable slots (ADLX interfaces are plain C++ vtables, not COM), the GPU found through the
ADL mapping and matched to the name DXGI reported. On this driver plain
ADLXInitializeanswers an empty GPUlist, so
ADLXInitializeWithIncompatibleDriver2is the entry that works;GPUPoweranswers NOT_SUPPORTED, sopower falls back to
GPUTotalBoardPower. Initialization is once per process (a secondGetPerformanceMonitoringServiceshangs, measured).gpu_reader(amd=True)returns this on Windows when there is no amdgpu sysfs; the Linux path and the NVIDIApath are untouched, and a card none of the three reaches still gets a word why instead of empty tiles.
Enumeration, counters and property reads only — no device, no context: it takes no VRAM from the engine and
cannot stall it.
What it leaves alone
inside an RX 7000 (measured: Gen4 x16 reported by the endpoint while the card sits in a Gen3 x8 slot on a
B450), and the three devices above it report nothing, so the host-facing link is one Windows cannot name; the
tile stays blank there rather than showing the card's own capability (#1734, #2137). For the traffic: PDH has
no PCIe counter set and ADLX 1.5's headers name no bus metric — that half is the engine's own byte counter, in #2272.
adlxpybindships cp310–cp313win_amd64wheels and no sdist, so apip installfailson any other Python;
ctypesneeds nothing and the file already uses it for NVML.Where this overlaps
#1871 (dashboard readings for AMD cards), #1152 (Windows AMD telemetry, with an Arabic UI), #1224 (ADLX through
adlxpybind) and #1434 are all open in this area, and I read them before writing this. This one is thectypes-only route: no install step, and it is the ADLX fallback chain (
GPUPower→GPUTotalBoardPower) andthe LUID-picked performance counters that make the numbers appear on a driver where the direct calls answer
NOT_SUPPORTED. If any of those PRs lands first, this should be rebased on it rather than shipped beside it.
How I checked
RX 7900 XT, driver 32.0.23033.1002, ADLX 1.5.0.124, Windows 11, Python 3.12.10, with the engine holding the
model:
atiadlxx) enumerates the card butanswers −1/−5 for every sensor call, and no performance counter or WMI class reports them.
python -m unittest serve.test_server.AmdTelemetry serve.test_server.TelemetryNoDisks serve.test_server.SharingTheGpu serve.test_server.DesktopVramNote serve.test_server.WebApp serve.test_server.PrometheusMetrics serve.test_server.LiveRate: 42 tests, OK (Python 3.12.10, on main ata0116b2). Fullserve.test_serveron this branch: 308 tests, OK in 101 s (Windows 11, Python 3.12.10), nothing skipped.adlxpybind1.4.6 wheel, unpacked rather thaninstalled: it answers the same 43.0 °C and the same 19248 MiB, and the same
GPUPower0.0 withGPUTotalBoardPower64.0. The temperature and VRAM figures are not an artifact of reading the vtable by hand.One existing test changed: the sysfs link test built its reader with
gpu_reader(0, amd=True), which on Windowsis now the DXGI reader; it constructs
telemetry._Amd(0)directly instead. Its assertions are unchanged.Not tested: an RX 6000 or an older driver, a machine without
amdadlx64.dll(the reader returns nothing and theexisting note is shown), and a second card.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.