mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: On kernel interfaces for a GPU top
       [not found] <SA1PR12MB8144E40D472D0255813AF4B8EF77A@SA1PR12MB8144.namprd12.prod.outlook.com>
@ 2026-02-24 14:53 ` Tvrtko Ursulin
  0 siblings, 0 replies; only message in thread
From: Tvrtko Ursulin @ 2026-02-24 14:53 UTC (permalink / raw)
  To: Francis, David, list DRI developers Maling
  Cc: Simona Vetter, Airlie Dave, linux-kernel


On 23/02/2026 19:19, Francis, David wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
> 
> We would like to have a GPU equivalent of top; some program that can 
> efficiently get a list of processes using the GPU (or other drm driver) 
> and some basic usage statistics for those processes.
> We would like this program to be usable by processes with no particular 
> privileges, in particular processes without ptrace permissions on the 
> other processes using the GPU (which are needed for fdinfo).
> There are two main problems
> 1: There's no way for an unprivileged process to get this kind of data. 
> There's fdinfo and debugfs, which can contain process-specific data, but 
> aren't accessible without privileges. There's drm sysfs, which can be 
> accessed by anyone (at least parially) but can't contain process- 
> specific data.

Just my 2c.

I think a fair number of interested parties wants this but so far no one 
proposed exactly what and where to put it. It would be interesting to 
hear what proposal you have in mind.

> 2: There's no efficient way for any process to easily get a list of 
> which processes are using the GPU. This information is available by 
> looking through the fdinfo entries for every process, but that's slow. 
> drm drivers can track which process created a fd on the device file, and 

Lets call this 2a). Yep, this too is a long standing issue. It would be 
nice to tie 1+2a) into a solution.

> which process last called an ioctl on an fd, but the process that 
> actually holds the fd might be neither of those. (e.g. X server opens a 
> drm driver, starts some queues, then forks, handing the fd to a child 
> process that then submits to the queues but never does any more ioctls)

This is 2b) right?

What do you mean by "actually _holds_"? The actual most recent ioctl 
user? This is already tracked in the DRM core. See drm_file_update_pid() 
and it's caller. Used from debugfs, error logging, error capture from at 
least some drivers. So those one will already have the "real" fd user 
info displayed correctly.

How to tie that with the new 1+2a) interface is the question.

Regards,

Tvrtko

> As a solution for problem 1, we have as a possible idea making some 
> fdinfo entries accessible without ptrace priviliges; I would like to 
> know if there are any immediate objections to that.
> 
> As for problem 2, I really don't know what kind of interface would be 
> accessible and am open to ideas.
> 
> Thanks,
> David Francis


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-24 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <SA1PR12MB8144E40D472D0255813AF4B8EF77A@SA1PR12MB8144.namprd12.prod.outlook.com>
2026-02-24 14:53 ` On kernel interfaces for a GPU top Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®