[PR #1224] [CLOSED] serve: the Monitor's AMD GPU readings on Windows through ADLX (load, VRAM, temperature, power) #3321

Closed
opened 2026-11-07 14:40:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1224
Author: @tuandat3019
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: contrib-amd-windows-monitor


📝 Commits (2)

  • bf6f8ff serve: the Monitor's GPU readings on Windows through AMD's ADLX (load, VRAM, temperature, power)
  • c75e24c serve: match the ADLX GPU to the present-device walk by name alone

📊 Changes

1 file changed (+168 additions, -3 deletions)

View changed files

📝 serve/telemetry.py (+168 -3)

📄 Description

The Monitor tab (/metrics, serve/telemetry.py) reads NVIDIA through NVML and AMD on Linux through the
amdgpu sysfs files (#301). On Windows an AMD card read nothing - the load, VRAM, temperature and power
places stayed blank.

Reading them there needs ADLX, AMD's current library: the old ADL Overdrive calls answer not supported on
current Adrenalin (measured on 32.0.21045: ADL2_Overdrive6_Temperature_Get rc=-9 for every one of the 13
adapter entries of the two cards, ADL2_Overdrive6_CurrentPower_Get answers 0 W), and the raw ADLX entry
points are not something a ctypes reader can hold - the 1.4 runtime's vtables close over internal objects and
the public headers' layout alone does not survive calling them (the calls fault). AMD's supported client is
the ADLXPybind wheel, so this reads through it as an optional import, in the same style as psutil: without
the wheel the AMD cards keep reading nothing, exactly as before.

With the wheel present it reports load, VRAM used/total, edge temperature and board power (from the same
IADLXGPUMetrics object the fan, hotspot, clocks and shared memory are available; the Monitor's per-card
table uses the four above). free_vram_mib() - the server's admission check - answers for these cards too.

Two details it gets right on Windows:

  • Card numbering: the cards are ordered by PCI bus, ascending - the order HIP numbers them on Windows,
    which is what the engine's GPU numbering, gpu_indices and the Monitor's gpu_index refer to. (Verified
    against the engine's own "GPU 1: AMD Radeon RX 6800" line on a two-card PC: RX 6600 bus 3 = HIP 0, RX 6800
    bus 6 = HIP 1.) The ADLX GPU is matched to that walk by name - the ADLX list's own order is the reverse
    there - so a card the walk cannot name reports nothing rather than another card's numbers.
  • Present devices only: the adapter list is walked with SetupAPI's DIGCF_PRESENT; the registry's
    Enum\PCI also holds ghost instances of a re-seated card (the same name, a stale bus) and they must not
    enter the numbering.

Not included: the PCIe link. Windows' user-mode properties for it (DEVPKEY_PciDevice_Current/Max
LinkSpeed/LinkWidth) report the slot rather than the negotiated link - on this PC an x8 card reads x16,
against its own measured 13.6 GB/s host-to-device probe - and nothing else user-mode carries the link width
(the driver's registry keys, the GPU performance counters and ADLX all lack it). The Monitor's PCIe places
therefore stay empty for these cards, as they have been.

Verified live on that PC (ADLXPybind 1.4.6, RX 6800 + RX 6600): RX 6800 63 C / 178 W / 99 % / VRAM 16.0 of
16.4 GB while serving; RX 6600 53 C / 17 W; with the wheel uninstalled the readers report nothing and the
rest of the Monitor is unchanged.

Install: pip install adlxpybind (wheels for cp310-cp312, win_amd64).


🔄 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/1224 **Author:** [@tuandat3019](https://github.com/tuandat3019) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `contrib-amd-windows-monitor` --- ### 📝 Commits (2) - [`bf6f8ff`](https://github.com/Niko1221/Strata/commit/bf6f8ffe00439574a4b8482f8e8ac7f94f9378d1) serve: the Monitor's GPU readings on Windows through AMD's ADLX (load, VRAM, temperature, power) - [`c75e24c`](https://github.com/Niko1221/Strata/commit/c75e24c1fe94a1c20db734a94531bad9a69b396f) serve: match the ADLX GPU to the present-device walk by name alone ### 📊 Changes **1 file changed** (+168 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `serve/telemetry.py` (+168 -3) </details> ### 📄 Description The Monitor tab (`/metrics`, `serve/telemetry.py`) reads NVIDIA through NVML and AMD on Linux through the amdgpu sysfs files (#301). On Windows an AMD card read nothing - the load, VRAM, temperature and power places stayed blank. Reading them there needs ADLX, AMD's current library: the old ADL Overdrive calls answer *not supported* on current Adrenalin (measured on 32.0.21045: `ADL2_Overdrive6_Temperature_Get` rc=-9 for every one of the 13 adapter entries of the two cards, `ADL2_Overdrive6_CurrentPower_Get` answers 0 W), and the raw ADLX entry points are not something a ctypes reader can hold - the 1.4 runtime's vtables close over internal objects and the public headers' layout alone does not survive calling them (the calls fault). AMD's supported client is the ADLXPybind wheel, so this reads through it **as an optional import, in the same style as psutil**: without the wheel the AMD cards keep reading nothing, exactly as before. With the wheel present it reports load, VRAM used/total, edge temperature and board power (from the same `IADLXGPUMetrics` object the fan, hotspot, clocks and shared memory are available; the Monitor's per-card table uses the four above). `free_vram_mib()` - the server's admission check - answers for these cards too. Two details it gets right on Windows: - **Card numbering**: the cards are ordered by PCI bus, ascending - the order HIP numbers them on Windows, which is what the engine's GPU numbering, `gpu_indices` and the Monitor's `gpu_index` refer to. (Verified against the engine's own "GPU 1: AMD Radeon RX 6800" line on a two-card PC: RX 6600 bus 3 = HIP 0, RX 6800 bus 6 = HIP 1.) The ADLX GPU is matched to that walk by name - the ADLX list's own order is the reverse there - so a card the walk cannot name reports nothing rather than another card's numbers. - **Present devices only**: the adapter list is walked with SetupAPI's `DIGCF_PRESENT`; the registry's `Enum\PCI` also holds ghost instances of a re-seated card (the same name, a stale bus) and they must not enter the numbering. **Not included: the PCIe link.** Windows' user-mode properties for it (`DEVPKEY_PciDevice_Current/Max` `LinkSpeed`/`LinkWidth`) report the slot rather than the negotiated link - on this PC an x8 card reads x16, against its own measured 13.6 GB/s host-to-device probe - and nothing else user-mode carries the link width (the driver's registry keys, the GPU performance counters and ADLX all lack it). The Monitor's PCIe places therefore stay empty for these cards, as they have been. Verified live on that PC (ADLXPybind 1.4.6, RX 6800 + RX 6600): RX 6800 63 C / 178 W / 99 % / VRAM 16.0 of 16.4 GB while serving; RX 6600 53 C / 17 W; with the wheel uninstalled the readers report nothing and the rest of the Monitor is unchanged. Install: `pip install adlxpybind` (wheels for cp310-cp312, win_amd64). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:37 +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#3321
No description provided.