apitrace / apitrace

Tools for tracing OpenGL, Direct3D, and other graphics APIs

Home Page:https://apitrace.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tellusim StarWars 20221109 demo tracing crashes

okias opened this issue · comments

When it's running outside apitrace it's extremely slow, but does work.

apitrace trace ./ts_executor.x64 -name starwars -gl
apitrace: loaded into /home/okias/Downloads/StarWars_20221109/ts_executor.x64
apitrace: redirecting dlopen("libGL.so", 0x9) from ./libTellusim_x64.so
apitrace: tracing to /home/okias/Downloads/StarWars_20221109/ts_executor.x64.trace
apitrace: warning: unknown function "glViewportSwizzleNV"
apitrace: warning: unknown function "glDrawMeshTasksNV"
apitrace: warning: unknown function "glDrawMeshTasksIndirectNV"
apitrace: warning: unknown function "glMultiDrawMeshTasksIndirectNV"
apitrace: warning: unknown function "glMultiDrawMeshTasksIndirectCountNV"
apitrace: warning: hiding program binary formats (https://git.io/JOM0m)
M:      0 us: Platform: OpenGL
M:    465 us: Device: Mesa Intel(R) Xe Graphics (TGL GT2) (4.6 (Core Profile) Mesa 22.2.3)
M:    479 us: Build: version=20221109; release; fusion; vk=1; gl=45; gles=32; cu=1; hip=1
M:    567 us: Features: DLSS, Auxiliary, Motion
M:   6.33 ms: Creating SceneManager
M: 412.38 ms: Creating RenderManager
M: 710.23 ms: Executor 1.01 is Ready
M: 710.96 ms: Loading Scene "starwars.scenex"
V:   1.478 s: Done 767.10 ms
M:   1.602 s: RotationScript::RotationScript(): 0x4e24b40
M:   1.602 s: RotationScript::setRotationSpeed(): 0x4e24b40 23.700001
M:   1.602 s: RotationScript::RotationScript(): 0x4e55df0
M:   1.602 s: RotationScript::setRotationSpeed(): 0x4e55df0 68.529999
M:   1.602 s: RotationScript::RotationScript(): 0x46ee4a0
M:   1.602 s: RotationScript::setRotationSpeed(): 0x46ee4a0 54.560001
M:   1.602 s: RotationScript::RotationScript(): 0x4dd8ed0
M:   1.602 s: RotationScript::setRotationSpeed(): 0x4dd8ed0 62.200001
M:   1.602 s: AnimationScript::AnimationScript(): 0x4e3b0b0
apitrace: warning: caught signal 6
apitrace: flushing trace
/home/projects/collabora/apitrace/build/wrappers/glxtrace.so: signalHandler+0x20dfa0: /home/okias/projects/collabora/apitrace/lib/os/os_posix.cpp:321
/home/projects/collabora/apitrace/build/wrappers/glxtrace.so: signalHandler+0x20dfa0: /home/okias/projects/collabora/apitrace/lib/os/os_posix.cpp:299
/lib/x86_64-linux-gnu/libc.so.6+0x3bf8f: ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
/lib/x86_64-linux-gnu/libc.so.6: __pthread_kill_implementation+0x8accc: ./nptl/pthread_kill.c:44
/lib/x86_64-linux-gnu/libc.so.6: __GI_raise+0x11: ../sysdeps/posix/raise.c:26
/lib/x86_64-linux-gnu/libc.so.6: __GI_abort+0xd2: ./stdlib/abort.c:79
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: _iris_batch_flush+0x9b259: ../src/gallium/drivers/iris/iris_batch.c:1121
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: iris_indirect_draw_vbo+0x106a94c: ../src/gallium/drivers/iris/iris_draw.c:214
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: iris_draw_vbo+0x106a94c: ../src/gallium/drivers/iris/iris_draw.c:313
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: tc_call_draw_indirect+0x6078d3: ../src/gallium/auxiliary/util/u_threaded_context.c:3259
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: tc_batch_execute+0x602210: ../src/gallium/auxiliary/util/u_threaded_context.c:211
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: _tc_sync+0x603035: ../src/gallium/auxiliary/util/u_threaded_context.c:362
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: tc_flush+0x608b97: ../src/gallium/auxiliary/util/u_threaded_context.c:3085
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: st_context_flush+0x1852d5: ../src/mesa/state_tracker/st_manager.c:808
/usr/lib/x86_64-linux-gnu/dri/iris_dri.so: dri_flush+0xb19c9: ../src/gallium/frontends/dri/dri_drawable.c:522
/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x4fe2d
/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x42ac0
/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x321fa
/home/projects/collabora/apitrace/build/wrappers/glxtrace.so: glXSwapBuffers+0x6f: /home/okias/projects/collabora/apitrace/build/wrappers/glxtrace.cpp:15495
./libTellusim_x64.so+0x6794e9
./ts_executor.x64+0x1f552
./ts_executor.x64+0x20188
./ts_executor.x64+0x1067c
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_call_main+0x27189: ../sysdeps/nptl/libc_start_call_main.h:58
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main_impl+0x84: ../csu/libc-start.c:381
./ts_executor.x64+0x101b9
?

So Intel driver is aborting here.

Per the comments here, it seems the GPU is hanging.

It's hard to imagine why using apitrace would cause this.

The only smoking gun I see is the warning "hiding program binary formats (https://git.io/JOM0m)". Perhaps this causes the game to use different shader representation, which in turn triggers Intel GPU hangs.

See if the following patch for disabling ARB_get_program_binary suppression helps:

diff --git a/wrappers/glcaps.cpp b/wrappers/glcaps.cpp
index 41900b03..58a5cdf6 100644
--- a/wrappers/glcaps.cpp
+++ b/wrappers/glcaps.cpp
@@ -201,6 +201,7 @@ static void
 getInteger(const configuration *config,
            GLenum pname, GLint *params)
 {
+#if 0
     // Disable ARB_get_program_binary
     switch (pname) {
     case GL_NUM_PROGRAM_BINARY_FORMATS:
@@ -218,6 +219,7 @@ getInteger(const configuration *config,
         // GL_NUM_PROGRAM_BINARY_FORMATS.
         return;
     }
+#endif
 
     if (params) {
         *params = getConfigInteger(config, pname);
diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py
index 5acc2d05..54cc854e 100644
--- a/wrappers/gltrace.py
+++ b/wrappers/gltrace.py
@@ -254,8 +254,8 @@ class GlTracer(Tracer):
         print('_gl_param_size(GLenum pname) {')
         print('    switch (pname) {')
         for function, type, count, name in glparams.parameters:
-            if name == 'GL_PROGRAM_BINARY_FORMATS':
-                count = 0
+            #if name == 'GL_PROGRAM_BINARY_FORMATS':
+            #    count = 0
             if type is not None:
                 print('    case %s: return %s;' % (name, count))
         print('    default:')
@@ -850,7 +850,7 @@ class GlTracer(Tracer):
 
         # Force glProgramBinary to fail.  Per ARB_get_program_binary this
         # should signal the app that it needs to recompile.
-        if function.name in ('glProgramBinary', 'glProgramBinaryOES'):
+        if function.name in ('glProgramBinary', 'glProgramBinaryOES') and False:
             print(r'   binaryFormat = 0xDEADDEAD;')
             print(r'   binary = &binaryFormat;')
             print(r'   length = sizeof binaryFormat;')

Not sure if it's the cause here, but indeed apitrace should be improved so that instead of filtering out all binary formats, it should filter out vendor specific formats, and leave vendor agnostic formats such as GL_SHADER_BINARY_FORMAT_SPIR_V_ARB.

Nevermind, GL_SHADER_BINARY_FORMAT_SPIR_V_ARB is about glShaderBinary, not glProgramBinary, and it's not being suppressed by apitrace anyway, so can't be related.