# Trouble Installing 3D Slicer on Ubuntu 22.04.4

**URL:** <https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402>\
**Category:** Support\
**Created:** [July 16, 2024, 2:05pm UTC](https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402 "2024-07-16T14:05:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dat-rohit](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dat-rohit/32/77325_2.png) [@dat-rohit](https://discourse.slicer.org/u/dat-rohit)\
**Post date:** [July 16, 2024, 2:05pm UTC](https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402/1 "2024-07-16T14:05:36Z")

</div>

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:

```auto
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`:

```auto
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.

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [July 16, 2024, 2:45pm UTC](https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402/2 "2024-07-16T14:45:15Z")

</div>

What about trying this?

```auto
cd SlicerDirectory
XDG_SESSION_TYPE=wayland ./Slicer

```

Hope it helps

---

<div class="post-metadata">

**Author:** ![dat-rohit](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dat-rohit/32/77325_2.png) [@dat-rohit](https://discourse.slicer.org/u/dat-rohit)\
**Post date:** [July 17, 2024, 12:45am UTC](https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402/3 "2024-07-17T00:45:32Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [July 17, 2024, 4:51am UTC](https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402/4 "2024-07-17T04:51:15Z")

</div>

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/](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](https://virtualgl.org/vgldoc/2_2_1/#hd007003)

---

<div class="post-metadata">

**Author:** ![dat-rohit](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dat-rohit/32/77325_2.png) [@dat-rohit](https://discourse.slicer.org/u/dat-rohit)\
**Post date:** [July 18, 2024, 1:41am UTC](https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402/5 "2024-07-18T01:41:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [July 18, 2024, 5:17am UTC](https://discourse.slicer.org/t/trouble-installing-3d-slicer-on-ubuntu-22-04-4/37402/6 "2024-07-18T05:17:09Z")

</div>

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.
