stevenlovegrove / Pangolin

Pangolin is a lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input.
MIT License
2.33k stars 844 forks source link

Failed to run examples/SimplePlot in ubuntu20.04 #782

Closed bereze closed 3 months ago

bereze commented 2 years ago

When I run examples/SimplePlot in ubuntu20.04, I got errors and the program seems to be stuck:

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

But I can run other examples successfully, which confused me..

stevenlovegrove commented 2 years ago

I would need more info to be able to help. Compiling in debug and providing a stack-trace would be a good way to understand what's going on. Is there no further text output on the console? Presumably your graphics driver doesn't like one of the opengl calls used in the plotter application and Pangolin is asserting a GL error, perhaps?

bereze commented 2 years ago

Thank you for your reply. I followed your request, compiled the example in debug and used gdb to print the stack-trace which looks like:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7621859 in __GI_abort () at abort.c:79
#2  0x00007ffff4a2d498 in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#3  0x00007ffff5719ac8 in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#4  0x00007ffff4a9acbd in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#5  0x00007ffff4a3e61f in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#6  0x00007ffff6756d27 in glPrimitiveBoundingBox () from /lib/x86_64-linux-gnu/libGLX_mesa.so.0
#7  0x00007ffff6749615 in ?? () from /lib/x86_64-linux-gnu/libGLX_mesa.so.0
#8  0x00007ffff74a8136 in pangolin::X11Window::SwapBuffers (this=0x5555556049f0) at /home/arc/Thirdparty/Pangolin/components/pango_windowing/src/display_x11.cpp:480
#9  0x00007ffff7e89200 in pangolin::PangolinGl::FinishFrame (this=0x555555578880) at /home/arc/Thirdparty/Pangolin/components/pango_display/src/pangolin_gl.cpp:74
#10 0x00007ffff7e5131c in pangolin::FinishFrame () at /home/arc/Thirdparty/Pangolin/components/pango_display/src/display.cpp:255
#11 0x000055555555be66 in main () at /home/arc/Thirdparty/Pangolin/examples/SimplePlot/main.cpp:43
#12 0x00007ffff7623083 in __libc_start_main (main=0x55555555b829 <main()>, argc=1, argv=0x7fffffffe438, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe428) at ../csu/libc-start.c:308
#13 0x000055555555b76e in _start ()

I used Clion to debug the program, and the program stops here:

void X11Window::SwapBuffers() {
    glXSwapBuffers(display->display, win);  // Stucked
}

My gpu is Mesa Intel® Graphics (RKL GT1). Is there anything incompatible here?

stevenlovegrove commented 2 years ago

Interesting - googling, I've found a few references to similar issues (such as https://github.com/yuzu-emu/yuzu/issues/7738#issuecomment-1016393296), though they don't seem to have great solutions. I'm inclined to think it is a graphics driver issue since it seems to occur with intel graphics in a few different projects. I can't think how this might manifest as a result of a bug in Pangolin, but maybe...

The two workarounds I might suggest trying are 1) See if you can upgrade or switch graphics drivers (is there an update for mesa, or alternative; gallium vs i965?) 2) Try using Pangolins EGL windowing instead of X11. @christian-rauch has a PR open to replace it you could try (https://github.com/stevenlovegrove/Pangolin/pull/389)

bereze commented 2 years ago

I have tried compiling Pangolin x11_egl from @christian-rauch, and it works!!! Tested all examples and worked well.