On 05/02/2026 18:58, Alex Deucher wrote:
Has anyone given any thought on how to support something like top for
accelerators or GPUs? We have fdinfo, but using fdinfo requires extra
privileges (CAP_SYS_PTRACE) and there is not a particularly efficient
way to even discover what processes are using the GPU. There is the
clients list in debugfs, but that is also admin only. Tools like ps
and top use /proc/<pid>/stat and statm. Do you think there would be
an appetite for something like /proc/<pid>/drm/stat, statm, etc.?
This would duplicate much of what is in fdinfo, but would be available
to regular users.
In short yes, the inefficiency of the client discovery bugged me since
the start of fdinfo and it was discussed a few times how to improve it.
AFAIR in those discussions a lists of clients outside of debugfs was
mentioned, since that would allow the cost of discovery to not scale by
the number of irrelevant processes. Something in proc was also mentioned
but I guess for both no one had a strong enough drive to actually do it.
Challenge will be finding the threads to see if there were any
interesting conclusions... The only one I can remember at the moment was
this:
https://lore.kernel.org/dri-devel/[email protected]/
It looks this attempt died out due proposing a binary interface in sysfs.
In any case, I'd say it makes sense to do something.
Regards,
Tvrtko
P.S.
Just in a case you did not see it, a generic tool exists as gputop in
IGT but as you say, you can only see data for processes the user running
the tool can read fdinfo stats of. And there some nicer tools feeding of
the same data.