[Intel-gfx] Design of a GPU profiling debug interface

Eric Anholt eric at anholt.net
Tue Nov 9 23:27:43 CET 2010


On Sat, 30 Oct 2010 14:04:11 +0100, Peter Clifton <pcjc2 at cam.ac.uk> wrote:
> I think I'll need some help with this. I'm by no means a kernel
> programmer, so I'm feeling my way in the dark with this.
> 
> I want to design an interface so I can synchronise my GPU idle flags
> polling with batchbuffer execution. I'm imagining at a high level, doing
> something like this in my application (or mesa). (Hand-wavey-pseudocode)

Here's a thought.  It ties in a little with something Arjan was asking
for.  Have trace events around batchbuffer submit that report the
timestamp before and after -- you can do this on G45+ at least using
PIPE_CONTROL writes to a temporary BO that the kernel makes for the job.
The idle-bit tracing daemon would ask for those events, then run
(CPU-side) doing the capture of INSTDONEs and the TIMESTAMP register,
and also collecting the perf events.  It could throw out reg captures
that aren't within start/end of batchbuffers once perf events beyond
those points arrive so you don't spew irrelevant data to disk.  I think
we've got pids of requester in the trace events, so you could correlate
the records with which app did the rendering.

The tricky part would be that the kernel needs to collect the
PIPE_CONTROL-written timestamp values out "some time later" after the
GPU is done with them and generate the events at that point -- so if you
enabled lots of tracking, you'd see a tracing stream that looks
something like:

i915_gem_request_submit
i915_gem_request_retire
i915_gem_request_started # the new gpu-side timestamp event
i915_gem_request_finished # the new gpu-side timestamp event
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20101109/1c581a61/attachment.sig>


More information about the Intel-gfx mailing list