Trouble Installing 3D Slicer on Ubuntu 22.04.4

Hey everyone,

I’m trying to install 3D Slicer and I am encountering an issue where I’m unable to launch the application due to what seems to be like a graphical rendering error. Here are the details of the problem and steps I’ve already taken:

  • I am installing 3D Slicer on a GPU cluster and hence I am connected to it via SSH with the -X option (for graphics display)

    • Operating System: Ubuntu 2.04.4 LTS (Jammy Jellyfish)
  • 3D Slicer Version: 5.6.2

  • GPU: NVIDIA GeForce RTX 3090

  • CUDA Version: 12.2

  • When I try to launch 3D Slicer (./Slicer), the GUI layout popup but the inside is blank and I receive the following error message:

Error #1 while writing setting "Modules/AdditionalPaths"
Error #1 while writing setting "Modules/IgnoreModules"
Error #1 while writing setting "Extensions/ManagerEnabled"
Error #1 while writing setting "Extensions/ServerUrl"
Error #1 while writing setting "Extensions/FrontendServerUrl"
Error #1 while writing setting "Extensions/InstallPath"
Switch to module:  "Welcome"
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
Ignore argument received via command-line (not a valid URL or existing local file):  "--debug-output"
composeAndFlush: QOpenGLContext creation failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed

The composeAndFlush: makeCurrent() failed continues recursively until I terminate the process.

  • I already tried manually setting the following variables: LD_LIBRARY_PATH, QT_QPA_PLATFORM_PLUGIN_PATH, LIBGL_ALWAYS_INDIRECT=1, LIBGL_ALWAYS_SOFTWARE=1, LIBGL_ALWAYS_INDIRECT=1, QT_XCB_GL_INTEGRATION=xcb_egl
    → None of it helps

  • I tried checking for any missing libraries with ldd ./Slicer:

linux-vdso.so.1 (0x00007ffcf774d000)
	libSM.so.6 => /lib/x86_64-linux-gnu/libSM.so.6 (0x00007f94986b5000)
	libICE.so.6 => /lib/x86_64-linux-gnu/libICE.so.6 (0x00007f9498698000)
	libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f949868b000)
	libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007f9498676000)
	libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f9498536000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9498518000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9498513000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f949850e000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9498509000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f94982dd000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f94981f6000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f94981d4000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9497fab000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f94986cf000)
	libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f9497fa2000)
	libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f9497f8a000)
	libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f9497f60000)
	libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f9497f51000)
	libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f9497f4b000)
	libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f9497f43000)

→ it seems to be fine

Any help would be highly appreciated. Please let me know if any additional information would be useful.

What about trying this?

cd SlicerDirectory
XDG_SESSION_TYPE=wayland ./Slicer

Hope it helps

Thank you for your reply. I tried your solution but ended up getting the same error message with the same behaviour.

XDG_SESSION_TYPE=wayland ./Slicer
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Error #1 while writing setting "Modules/AdditionalPaths"
Error #1 while writing setting "Modules/IgnoreModules"
Error #1 while writing setting "Extensions/ManagerEnabled"
Error #1 while writing setting "Extensions/ServerUrl"
Error #1 while writing setting "Extensions/FrontendServerUrl"
Error #1 while writing setting "Extensions/InstallPath"
Switch to module:  "Welcome"
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
QOpenGLWidget: Failed to create context
composeAndFlush: QOpenGLContext creation failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed

Would you have any idea as to why this does happen?

Thank you in advance

In my experience 3D GUI applications like Slicer rarely work if you are using the traditional X window forwarding approach, which I believe is what you are doing.

Instead of trying to troubleshoot this, ask admins of the GPU cluster if it is possible to run VNC on the cluster and install the VirtualGL library (https://virtualgl.org/).

That way you can connect through VNC and use the rather solid VirtualGL (vgl) library to do remote rendering on the GPU (with the traditional X forwarding rendering is actually happening on your own computer’s X server and that’s probably where all that OpenGL errors are coming from).

If fully contained VNC is not possibility, you should be able to do X forwarding with ssh tunneling through virtualGL and still be able to do remote 3D rendering. See https://virtualgl.org/vgldoc/2_2_1/#hd007003

1 Like

Thank you a lot for your answer. I will probably go for this solution as my problem doesn’t seem to have any viable fix.

Your use case is why virtualGL is developed in the first place. if you can get the admins install and configure with EGL backend, you should be able to do what you need to do.