MesserLab / SLiM

SLiM is a genetically explicit forward simulation software package for population genetics and evolutionary biology. It is highly flexible, with a built-in scripting language, and has a cross-platform graphical modeling environment called SLiMgui.
https://messerlab.org/slim/
GNU General Public License v3.0
160 stars 30 forks source link

RHEL 8 cluster, SLiMgui Segmentation fault; QOpenGLWidget: Failed to make context current, QOpenGLShaderProgram: could not create shader program #411

Closed SomePersonSomeWhereInTheWorld closed 9 months ago

SomePersonSomeWhereInTheWorld commented 9 months ago

On RHEL 8 cluster compute node, using QMake version 3.1, Qt version 5.15.2 via a module load, this succeeds in creating the SLiMgui binary. However trying to start it with XQuartz on a Mac results in a seg fault. Does SLiMgui require a file to open? Compiled using: cmake -D CMAKE_PREFIX_PATH=/path/to/Qt/5.15.2/gcc_64 -D BUILD_SLIMGUI=ON ../SLiM

./SLiMgui
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/xxxxx', please create it with 0700 permissions.
MESA-LOADER: failed to open swrast (search paths /usr/lib64/dri)
libGL error: failed to load driver: swrast
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:46:59 : QOpenGLWidget: Failed to make context current
10:47:01 : QOpenGLWidget: Failed to make context current
10:47:01 : QOpenGLWidget: Failed to make context current
10:47:01 : QOpenGLWidget: Failed to make context current
10:47:01 : QOpenGLWidget: Failed to make context current
10:47:01 : QOpenGLWidget: Failed to make context current
10:47:01 : QOpenGLWidget: Failed to make context current
10:47:01 : QOpenGLShaderProgram: could not create shader program
10:47:01 : QOpenGLShader: could not create shader
10:47:01 : Could not link shader program:
 ""
Segmentation fault (core dumped)

Would the core dump help? Backtrace from it?

Core was generated by `./SLiMgui'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000155553355c27 in __memmove_avx_unaligned_erms () from /lib64/libc.so.6
(gdb) bt full
#0  0x0000155553355c27 in __memmove_avx_unaligned_erms () from /lib64/libc.so.6
No symbol table info available.
#1  0x0000155546473c1b in emit_element_none.isra () from /lib64/libGLX_system.so.0
No symbol table info available.
#2  0x0000155546473ed1 in emit_DrawArrays_none () from /lib64/libGLX_system.so.0
No symbol table info available.
#3  0x0000155554b7a800 in QOpenGLTextureBlitterPrivate::blit(unsigned int, QMatrix4x4 const&, QGenericMatrix<3, 3, float> const&) ()
   from /lib64/libQt5Gui.so.5
No symbol table info available.
#4  0x0000155554b0d3b6 in blitTextureForWidget(QPlatformTextureList const*, int, QWindow*, QRect const&, QOpenGLTextureBlitter*, QPoint const&, bool) ()
   from /lib64/libQt5Gui.so.5
No symbol table info available.
#5  0x0000155554b0dcf6 in QPlatformBackingStore::composeAndFlush(QWindow*, QRegion const&, QPoint const&, QPlatformTextureList*, bool) ()
   from /lib64/libQt5Gui.so.5
No symbol table info available.
#6  0x000015554abd9148 in QXcbBackingStore::composeAndFlush(QWindow*, QRegion const&, QPoint const&, QPlatformTextureList*, bool) ()
   from /lib64/libQt5XcbQpa.so.5
No symbol table info available.
#7  0x0000155554e1c6c3 in QWidgetBackingStore::qt_flush(QWidget*, QRegion const&, QBackingStore*, QWidget*, QPlatformTextureList*, QWidgetBackingStore*) ()
   from /lib64/libQt5Widgets.so.5
No symbol table info available.
#8  0x0000155554e1e158 in QWidgetBackingStore::flush(QWidget*) () from /lib64/libQt5Widgets.so.5
No symbol table info available.
#9  0x0000155554e1f787 in QWidgetBackingStore::doSync() () from /lib64/libQt5Widgets.so.5
No symbol table info available.
#10 0x0000155554e1f9a9 in QWidgetBackingStore::sync(QWidget*, QRegion const&) () from /lib64/libQt5Widgets.so.5
No symbol table info available.
#11 0x0000155554e6cb6c in QWidgetWindow::handleExposeEvent(QExposeEvent*) () from /lib64/libQt5Widgets.so.5
No symbol table info available.
#12 0x0000155554e6d62e in QWidgetWindow::event(QEvent*) () from /lib64/libQt5Widgets.so.5
No symbol table info available.
#13 0x0000155554e0f5f5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
No symbol table info available.
#14 0x0000155554e16b10 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
--Type <RET> for more, q to quit, c to continue without paging--No symbol table info available.
#15 0x0000155554232326 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
No symbol table info available.
#16 0x000015555489456e in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () from /lib64/libQt5Gui.so.5
No symbol table info available.
#17 0x00001555548947fd in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /lib64/libQt5Gui.so.5
No symbol table info available.
#18 0x000015555487176b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Gui.so.5
No symbol table info available.
#19 0x000015554abe645e in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5XcbQpa.so.5
No symbol table info available.
#20 0x000015554ede567d in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
No symbol table info available.
#21 0x000015554ede5a48 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
No symbol table info available.
#22 0x000015554ede5ae0 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
No symbol table info available.
#23 0x000015555428518b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
No symbol table info available.
#24 0x000015555423118b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
No symbol table info available.
#25 0x00001555542391a6 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
No symbol table info available.
#26 0x000000000056cbac in main ()
No symbol table info available.
bhaller commented 9 months ago

SLiMgui itself requires nothing external at runtime, but Qt probably does. It looks like the key lines are these:

QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/xxxxx', please create it with 0700 permissions.
MESA-LOADER: failed to open swrast (search paths /usr/lib64/dri)
libGL error: failed to load driver: swrast

I have no idea what that stuff is; I've never seen these errors before. They're being generated by Qt. I guess I'd recommend googling things like XDG_RUNTIME_DIR and swrast to see whether others have encountered this problem; it probably isn't SLiMgui-specific, but rather a general problem with Qt in some contexts. It may be that module load did an incorrect or incomplete installation of Qt on your platform, or perhaps it didn't install dependencies (swrast, whatever that is?) that it does in fact depend upon. Anyhow, if you figure out the cause, and a solution, please do repost here for posterity, and perhaps I can add a mention of it in the SLiM manual. In the meantime I'm going to close this issue, because it's a Qt issue not a SLiM issue, and I have no solution for it. (Note that Qt has their own bug database, which you could search and even log a bug in.) I'm not aware of anyone else having run SLiMgui remotely over X; you might also ask on slim-discuss to see whether someone else has experience with this. Good luck!

(By the way, just to let you know, your chosen username/profile is a bit annoying to me. When I'm providing support for SLiM, it's nice to know who I'm talking to. If you want to use that username, I would suggest that you introduce yourself properly when you start a conversation on GitHub like this, or put some actual information in your user profile. Just a suggestion. :->)

SomePersonSomeWhereInTheWorld commented 9 months ago

Some progress, MobaXterm works fine. So it's an OpenGL issue on Mac and XQuartz. There is a long standing issue mentioned here, and I've tried setting export LIBGL_ALWAYS_INDIRECT=1and defaults write org.xquartz.X11 enable_iglx -bool YES to no avail. I also tried downgrading XQuartz to 2.7.8, no difference.

As for my profile it's for anonymity, I'll email you directly to introduce myself.