Issues / #3342

#3342 [Engine] run the Intel GPU sampler without root on a single-user host

open · @beyondcr · 0 commentaires · Sur GitHub

Setup & installServer & API

Description

### Area

[Engine]

### What do you want to do?

Let the Intel GPU sampler run without root on a machine that has one user.

`sycl/tools/gpustat.py` takes VRAM and load from `/proc/<pid>/fdinfo`, and the install notes require
a root service writing `/run/gpustat.json`. That is right for a shared host: another user's
`/proc/<pid>/fdinfo` needs `CAP_SYS_PTRACE`, so the sampler has to be privileged to account for
processes it does not own.

On a single-user workstation every process that touches the card already belongs to that user, so
the sampler needs no privilege at all. Requiring root there means a second service running as root
on a desktop where nothing is shared, which is a permission and a dependency that buys nothing. It
also means the Monitor tab shows no load or VRAM at all until someone installs it.

What I would like, for the single-user case only: the sampler writes to the session runtime
directory when `/run` is not writable, the reader looks in both places and still uses the entry that
names its own card, and the install notes describe both. A shared host keeps the root service
exactly as it is today.

Notes:

- Related but separate: #3117 fixes the readings themselves on a host with two Intel cards. This is
  only about which path the document is written to and read from, and it does not depend on that
  pull request landing first.
- I already have both pieces working locally and am happy to open a pull request if this is the
  direction you want. If it is not wanted, say so and it stays local. The change is small: the
  sampler picks a writable path, the reader tries the system path and then the session path, and it
  keeps using the entry that names its own card.
- Written with AI assistance, then measured and reviewed by hand on a machine with an Arc Pro B70
  and an Arc A770. Every claim here was checked against the source or against command output.

### What do you do today instead?

On this machine I run the sampler as a systemd user unit writing `$XDG_RUNTIME_DIR/gpustat.json`,
with a locally patched reader that also checks that path. It works and has run for hours without
trouble, but it is a local patch rather than something the notes describe, so anyone else has to
work it out again.

Sur le site

Liens install, modèles, releases.