[PR #5356] [GUI] xe sysfs reader in the shared telemetry so the SYCL container's Monitor shows temp, power and PCIe (#5353) #5400

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5356
Author: @james-martinez
Created: 11/5/2026
Status: 🔄 Open

Base: main ← Head: fix/5353-xe-monitor-in-container


📝 Commits (1)

  • 0a54826 serve/telemetry.py: an Intel Arc (xe) sysfs reader so the SYCL container's Monitor has temp and power (#5353)

📊 Changes

2 files changed (+283 additions, -7 deletions)

View changed files

📝 serve/telemetry.py (+125 -7)
➕ tests/terminal/test_xe_monitor_5353.py (+158 -0)

📄 Description

Problem and result

In the SYCL container the Monitor tab shows no GPU readings (#5353): the image ships no NVIDIA library, so serve/telemetry.py's gpu_reader fell back to the _Nvml stub and the GPU panel stayed empty. The readings exist in sycl/serve/xe_telemetry.py (the host install's Monitor plug), but the image cannot ship it: docker/build.sh stages only serve/, scripts/ and web/ into the build context, and its /run/gpustat.json sampler runs as a host systemd unit.

This folds the xe sysfs reader into the shared telemetry as _Xe, so any container or install that cannot load NVML gets the card from sysfs (the xe driver's files are world-readable): the pkg temperature, power as the delta of the hwmon energy counter (xe has no instantaneous power file), the power cap, and the PCIe link the card trained at (walking past the card's internal x1 switch, so the real Gen4 x16 shows instead of the internal x1). Load and VRAM still come from a root sampler's /run/gpustat.json when one runs - xe reports them only per client in /proc/*/fdinfo - and a stale reading (sampler died) is ignored so the sysfs fields keep answering. NVML still answers first everywhere it has a card, so NVIDIA hosts are untouched; the Intel card is picked by the 'tile0' folder the xe driver creates, not the vendor id, so an iGPU on i915 in front of the card cannot answer for it (the #2001 class of bug).

On my B70 machine's container this fills the whole panel, measured live through the patched reader on the running pod: Intel(R) Arc(TM) Pro B70 Graphics, temp 61 C, 45 W (cap 230 W, stable across two samples two seconds apart), VRAM 30.8 GiB of 32 GiB from the host's gpustat sampler, PCIe Gen3 x16 as the card trained.

#5353

Approach

  • serve/telemetry.py: new _Xe reader with _Nvml's interface; gpu_reader tries NVML first, then the xe reader on Linux before falling back to the NVML stub. Reads /run/gpustat.json (the sampler's schema is sycl/tools/gpustat.py's) for load/VRAM/power when fresh.
  • tests/terminal/test_xe_monitor_5353.py: a fake sysfs tree (iGPU before the Arc card, the internal-x1-switch layout, hwmon sensors) for the card pick, pkg-label sensor, energy-delta power, cap, link walk, fresh-vs-stale sampler handling, and the gpu_reader wiring order.
  • sycl/serve/xe_telemetry.py and sycl/tools/gpustat.py are unchanged: the host install keeps its richer reader (oneAPI name, per-client VRAM). The container shows temp/power/cap/link without any sampler at all; a host that runs the sampler also gets load and VRAM in the container.

Validation

Passed: tests.terminal.test_xe_monitor_5353 (10 tests) on the patched tree; the test_amd_four_card/test_monitor_bundle regression set has the same 6 pre-existing env import errors (missing textual etc.) on pristine main as on the patch - zero new failures. End-to-end on a live Arc Pro B70 container (kubectl exec, the pod's bundled interpreter): gpu_reader(0) returns the _Xe reader with name Intel(R) Arc(TM) Pro B70 Graphics, temp/power/cap/VRAM/PCIe populated from the real card, the energy-delta power consistent across two samples.

Failed: nothing.

Not run: the image rebuild (the fix is plain stdlib Python staged through the existing serve/ COPY - no Dockerfile change needed), and the browser UI check of the Monitor panel.

Limits

The container's power is a delta between telemetry polls (one per second), so the first reading after start is None until a second sample exists; PCIe rx/tx throughput has no xe sysfs counter and stays None (the panel hides those tiles). Load and VRAM need a sampler (sycl/tools/gpustat.py) whose JSON the reader consumes - with no sampler the panel shows temp/power/cap/link only, which is what the issue's screenshots lack.


🔄 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/5356 **Author:** [@james-martinez](https://github.com/james-martinez) **Created:** 11/5/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/5353-xe-monitor-in-container` --- ### 📝 Commits (1) - [`0a54826`](https://github.com/Niko1221/Strata/commit/0a54826a473e34fedc5102369520237eb0822e24) serve/telemetry.py: an Intel Arc (xe) sysfs reader so the SYCL container's Monitor has temp and power (#5353) ### 📊 Changes **2 files changed** (+283 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `serve/telemetry.py` (+125 -7) ➕ `tests/terminal/test_xe_monitor_5353.py` (+158 -0) </details> ### 📄 Description ## Problem and result In the SYCL container the Monitor tab shows no GPU readings (#5353): the image ships no NVIDIA library, so `serve/telemetry.py`'s `gpu_reader` fell back to the `_Nvml` stub and the GPU panel stayed empty. The readings exist in `sycl/serve/xe_telemetry.py` (the host install's Monitor plug), but the image cannot ship it: `docker/build.sh` stages only `serve/`, `scripts/` and `web/` into the build context, and its `/run/gpustat.json` sampler runs as a host systemd unit. This folds the xe sysfs reader into the shared telemetry as `_Xe`, so any container or install that cannot load NVML gets the card from sysfs (the xe driver's files are world-readable): the pkg temperature, power as the delta of the hwmon energy counter (xe has no instantaneous power file), the power cap, and the PCIe link the card trained at (walking past the card's internal x1 switch, so the real Gen4 x16 shows instead of the internal x1). Load and VRAM still come from a root sampler's `/run/gpustat.json` when one runs - xe reports them only per client in `/proc/*/fdinfo` - and a stale reading (sampler died) is ignored so the sysfs fields keep answering. NVML still answers first everywhere it has a card, so NVIDIA hosts are untouched; the Intel card is picked by the 'tile0' folder the xe driver creates, not the vendor id, so an iGPU on i915 in front of the card cannot answer for it (the #2001 class of bug). On my B70 machine's container this fills the whole panel, measured live through the patched reader on the running pod: `Intel(R) Arc(TM) Pro B70 Graphics`, temp 61 C, 45 W (cap 230 W, stable across two samples two seconds apart), VRAM 30.8 GiB of 32 GiB from the host's gpustat sampler, PCIe Gen3 x16 as the card trained. ## Related discussion #5353 ## Approach - `serve/telemetry.py`: new `_Xe` reader with `_Nvml`'s interface; `gpu_reader` tries NVML first, then the xe reader on Linux before falling back to the NVML stub. Reads `/run/gpustat.json` (the sampler's schema is `sycl/tools/gpustat.py`'s) for load/VRAM/power when fresh. - `tests/terminal/test_xe_monitor_5353.py`: a fake sysfs tree (iGPU before the Arc card, the internal-x1-switch layout, hwmon sensors) for the card pick, pkg-label sensor, energy-delta power, cap, link walk, fresh-vs-stale sampler handling, and the `gpu_reader` wiring order. - `sycl/serve/xe_telemetry.py` and `sycl/tools/gpustat.py` are unchanged: the host install keeps its richer reader (oneAPI name, per-client VRAM). The container shows temp/power/cap/link without any sampler at all; a host that runs the sampler also gets load and VRAM in the container. ## Validation **Passed:** `tests.terminal.test_xe_monitor_5353` (10 tests) on the patched tree; the `test_amd_four_card`/`test_monitor_bundle` regression set has the same 6 pre-existing env import errors (missing `textual` etc.) on pristine main as on the patch - zero new failures. End-to-end on a live Arc Pro B70 container (kubectl exec, the pod's bundled interpreter): `gpu_reader(0)` returns the `_Xe` reader with name `Intel(R) Arc(TM) Pro B70 Graphics`, temp/power/cap/VRAM/PCIe populated from the real card, the energy-delta power consistent across two samples. **Failed:** nothing. **Not run:** the image rebuild (the fix is plain stdlib Python staged through the existing `serve/` COPY - no Dockerfile change needed), and the browser UI check of the Monitor panel. ## Limits The container's power is a delta between telemetry polls (one per second), so the first reading after start is None until a second sample exists; PCIe rx/tx throughput has no xe sysfs counter and stays None (the panel hides those tiles). Load and VRAM need a sampler (`sycl/tools/gpustat.py`) whose JSON the reader consumes - with no sampler the panel shows temp/power/cap/link only, which is what the issue's screenshots lack. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5400
No description provided.