public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [OA][RFC] Exposing low-resolution engine business via sysfs
@ 2023-01-12  7:50 FlightlessMango
  2023-01-12  8:55 ` Tvrtko Ursulin
  0 siblings, 1 reply; 2+ messages in thread
From: FlightlessMango @ 2023-01-12  7:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Martin Peres

Hi,

I am the developer of MangoHud[1], a Vulkan and OpenGL overlay for 
monitoring FPS / temperatures / CPU/GPU load and more.

I would like to add support for i915 (and xe in the future) but I am 
currently unable to do this easily because not everything I need is 
exposed directly to non-root users. Namely:

  * Engine business (RCS)
  * CPU, iGPU and dGPU power usage
  * IMC bandwith (nice to have but not mandatory)

This is a problem because it would require us to ship a setuid binary to 
poll these metrics for the overlay (we can't run games as root).

For your information, this is Intel-specific as AMD and NVIDIA are 
exposing these values directly. I understand the security concerns, but 
we are not asking for super precise information (1% accuracy is perfect).

Can we work together on this, what are your thoughts?

Thanks for your consideration.

//Simon Hallsten

[1] https://github.com/flightlessmango/MangoHud




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Intel-gfx] [OA][RFC] Exposing low-resolution engine business via sysfs
  2023-01-12  7:50 [Intel-gfx] [OA][RFC] Exposing low-resolution engine business via sysfs FlightlessMango
@ 2023-01-12  8:55 ` Tvrtko Ursulin
  0 siblings, 0 replies; 2+ messages in thread
From: Tvrtko Ursulin @ 2023-01-12  8:55 UTC (permalink / raw)
  To: FlightlessMango, intel-gfx; +Cc: Rodrigo Vivi, Martin Peres


Hi,

On 12/01/2023 07:50, FlightlessMango wrote:
> Hi,
> 
> I am the developer of MangoHud[1], a Vulkan and OpenGL overlay for 
> monitoring FPS / temperatures / CPU/GPU load and more.
> 
> I would like to add support for i915 (and xe in the future) but I am 
> currently unable to do this easily because not everything I need is 
> exposed directly to non-root users. Namely:
> 
>   * Engine business (RCS)
>   * CPU, iGPU and dGPU power usage
>   * IMC bandwith (nice to have but not mandatory)
> 
> This is a problem because it would require us to ship a setuid binary to 
> poll these metrics for the overlay (we can't run games as root).
> 
> For your information, this is Intel-specific as AMD and NVIDIA are 
> exposing these values directly. I understand the security concerns, but 
> we are not asking for super precise information (1% accuracy is perfect).
> 
> Can we work together on this, what are your thoughts?

A few angles here. First of all, last time you raised it I think we 
didn't have per client engine busyness in fdinfo. So *if* you are 
satisfied with reading client's own busyness you can do it unprivileged 
via /proc/<pid>|self/fdinfo/<fd>.

Secondly, i915 internal stats, iGPU power usage and IMC are exposed via 
three separate perf/PMU drivers, of which this team (this mailing) is 
really responsible for only i915. The access controls for all though are 
common and provided by the core kernel. See 
/proc/sys/kernel/perf_event_paranoid and corresponding docs.

Long(-ish) time ago we have proposed making the latter a per PMU driver 
but that did not get any traction in the kernel.

Once you move to dGPU then for power you will get to use hwmon and for 
that one I am currently not familiar how access control works.

And finally for the new Xe driver I not aware how it will expose it so I 
am copying Rodrigo in case he knows.

In summary I personally see these options for what i915 stats are concerned:

1. You go with fdinfo and get what you can.

2. We try to propose per PMU access controls once more.

And then maybe the point below becomes less controversial, unlikely though.

3. You instruct users to configure /proc/sys/kernel/perf_event_paranoid, 
or convince the distros to setuid your tool, or something along those lines.

Regards,

Tvrtko

> 
> Thanks for your consideration.
> 
> //Simon Hallsten
> 
> [1] https://github.com/flightlessmango/MangoHud
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-12  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-12  7:50 [Intel-gfx] [OA][RFC] Exposing low-resolution engine business via sysfs FlightlessMango
2023-01-12  8:55 ` Tvrtko Ursulin

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