glretrace: Add possibility to check for a lost context
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]
Completely untested ...
@okias, do you have a trace that triggers GPU resets? If so, please see if this works/helps.
@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 :)
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
I tried iterate whole ./i915_hangman from https://github.com/freedesktop/xorg-intel-gpu-tools with looped apitrace, but no luck.
@okias what backend is used to create the context when running the trace?
@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.
❯ 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
I tried error-state-basic, hangcheck-unterminated with traces made with glx, but no luck getting fail report from apitrace.