apitrace icon indicating copy to clipboard operation
apitrace copied to clipboard

glretrace: Add possibility to check for a lost context

Open gerddie opened this issue 3 years ago • 9 comments

Add a command line option to create an EGL context that supports lost context notification, and check with each rendered frame whether the context was lost. In that case abort replaying and return an error code -2.

Closes: https://github.com/apitrace/apitrace/issues/787

Signed-off-by: Gert Wollny [email protected]

gerddie avatar May 20 '22 14:05 gerddie

Completely untested ...

gerddie avatar May 20 '22 14:05 gerddie

@okias, do you have a trace that triggers GPU resets? If so, please see if this works/helps.

jrfonseca avatar May 23 '22 11:05 jrfonseca

@okias, do you have a trace that triggers GPU resets? If so, please see if this works/helps.

I have on Mesa3D CI, but since it involve lot of work, I'm looking for a way how to kill my TGL GPU in laptop first :)

okias avatar May 24 '22 09:05 okias

ok, with ./apitrace retrace --notify-lost-context -w /home/projects/collabora/traces-db/unvanquished/unvanquished-ultra.trace it runs the trace, but seems to doesn't trigger warning -> running in background:

while true; do sudo ./i915_hangman --run-subtest error-state-basic; sleep 1; done

from xorg-intel-gpu-tools on TGL.

And it does nothing when running

 time ./apitrace retrace --notify-lost-context /home/projects/collabora/traces-db/unvanquished/unvanquished-ultra.trace
./apitrace retrace --notify-lost-context   0.02s user 0.02s system 101% cpu 0.039 total

okias avatar May 24 '22 20:05 okias

I tried iterate whole ./i915_hangman from https://github.com/freedesktop/xorg-intel-gpu-tools with looped apitrace, but no luck.

okias avatar May 24 '22 20:05 okias

@okias what backend is used to create the context when running the trace?

gerddie avatar May 25 '22 07:05 gerddie

@okias what backend is used to create the context when running the trace?

my bad, it's GLX. I thought I have at least something traced in EGL, but I don't see any trace with EGL.

okias avatar May 25 '22 08:05 okias

❯ cd piglit/bin
❯ apitrace trace -o egl.trace ./egl-gl-colorspace 
❯ ./apitrace replay --notify-lost-context -w egl.trace
/home/projects/collabora/piglit/bin/egl-gl-colorspace
renderableType = 1
53: message: api performance issue 1: memory mapping a busy "miptree" BO stalled and took 0.839 ms.
55: message: api performance issue 1: memory mapping a busy "miptree" BO stalled and took 0.230 ms.
56: message: major api error 2: GL_INVALID_OPERATION in unsupported function called (unsupported extension or deprecated function?)
Rendered 1 frames in 0.0256996 secs, average of 38.9111 fps

for a regular run without crashing it. Without notify-lost-context, there is no GL_INVAL_OP

okias avatar May 25 '22 08:05 okias

I tried error-state-basic, hangcheck-unterminated with traces made with glx, but no luck getting fail report from apitrace.

okias avatar Jun 01 '22 04:06 okias