Add data fails in linux (wayland).

The data loading module fails after the first time and results in a blank window. Only way to fix it is to restart Slicer.

My platform is Fedora 36 (linux) with wayland.
Slicer version - Slicer-5.3.0-2023-01-28
I’m attaching the terminal output along with the slicer log to help solve this issue.

[usr@usr ~]$ ~/Software/Slicer-5.3.0-2023-01-28-linux-amd64/Slicer 
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/usr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/lib/Python/lib/python3.9/imp.py", line 169, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 613, in _exec
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/usr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewer.py", line 23, in <module>
    from MONAILabelReviewerLib.ImageData import ImageData
  File "/home/usr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewerLib/__init__.py", line 14, in <module>
    from .ImageDataController import ImageDataController
  File "/home/usr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewerLib/ImageDataController.py", line 19, in <module>
    from MONAILabelReviewerLib.ImageDataStatistics import ImageDataStatistics
ModuleNotFoundError: No module named 'MONAILabelReviewerLib.ImageDataStatistics'
loadSourceAsModule - Failed to load file "/home/usr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewer.py"  as module "MONAILabelReviewer" !
Fail to instantiate module  "MONAILabelReviewer"
The following modules failed to be instantiated:
   MONAILabelReviewer
Switch to module:  "Welcome"
QXcbConnection: XCB error: 8 (BadMatch), sequence: 2117, resource id: 20971620, major code: 130 (Unknown), minor code: 3
QXcbConnection: XCB error: 8 (BadMatch), sequence: 2120, resource id: 20971620, major code: 130 (Unknown), minor code: 3
QXcbConnection: XCB error: 8 (BadMatch), sequence: 2136, resource id: 20971620, major code: 130 (Unknown), minor code: 3
QXcbConnection: XCB error: 8 (BadMatch), sequence: 2137, resource id: 20971620, major code: 130 (Unknown), minor code: 3
QXcbConnection: XCB error: 8 (BadMatch), sequence: 2166, resource id: 20971620, major code: 130 (Unknown), minor code: 3
QXcbConnection: XCB error: 8 (BadMatch), sequence: 2174, resource id: 20971620, major code: 130 (Unknown), minor code: 3

Slicer log

[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Session start time .......: 2023-01-31 09:34:49
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Slicer version ...........: 5.3.0-2023-01-28 (revision 31553 / 0f25e18) linux-amd64 - installed release
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Operating system .........: Linux / 5.17.13-300.fc36.x86_64 / #1 SMP PREEMPT Mon Jun 6 14:29:43 UTC 2022 / UTF-8 - 64-bit
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Memory ...................: 15365 MB physical, 8191 MB virtual
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - CPU ......................: AuthenticAMD AMD Ryzen 7 4800HS with Radeon Graphics, 8 cores, 16 logical processors
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - VTK configuration ........: OpenGL2 rendering, Sequential threading
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Qt configuration .........: version 5.15.2, with SSL, requested OpenGL 3.2 (core profile)
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Internationalization .....: disabled, language=
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Developer mode ...........: disabled
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Application path .........: /home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/bin
[DEBUG][Qt] 31.01.2023 09:34:49 [] (unknown:0) - Additional module paths ..: NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "<string>", line 1, in <module>
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "/home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/lib/Python/lib/python3.9/imp.py", line 169, in load_source
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -     module = _exec(spec, sys.modules[name])
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "<frozen importlib._bootstrap>", line 613, in _exec
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "/home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewer.py", line 23, in <module>
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -     from MONAILabelReviewerLib.ImageData import ImageData
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "/home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewerLib/__init__.py", line 14, in <module>
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -     from .ImageDataController import ImageDataController
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -   File "/home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewerLib/ImageDataController.py", line 19, in <module>
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) -     from MONAILabelReviewerLib.ImageDataStatistics import ImageDataStatistics
[CRITICAL][Stream] 31.01.2023 09:34:54 [] (unknown:0) - ModuleNotFoundError: No module named 'MONAILabelReviewerLib.ImageDataStatistics'
[CRITICAL][Qt] 31.01.2023 09:34:54 [] (unknown:0) - loadSourceAsModule - Failed to load file "/home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/NA-MIC/Extensions-31553/MONAILabel/lib/Slicer-5.3/qt-scripted-modules/MONAILabelReviewer.py"  as module "MONAILabelReviewer" !
[CRITICAL][Qt] 31.01.2023 09:34:54 [] (unknown:0) - Fail to instantiate module  "MONAILabelReviewer"
[CRITICAL][Qt] 31.01.2023 09:34:54 [] (unknown:0) - The following modules failed to be instantiated:
[CRITICAL][Qt] 31.01.2023 09:34:54 [] (unknown:0) -    MONAILabelReviewer
[DEBUG][Python] 31.01.2023 09:34:57 [Python] (/home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/lib/Slicer-5.3/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentEditor
[DEBUG][Python] 31.01.2023 09:34:57 [Python] (/home/uusr/Software/Slicer-5.3.0-2023-01-28-linux-amd64/lib/Slicer-5.3/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentStatistics
[DEBUG][Qt] 31.01.2023 09:34:57 [] (unknown:0) - Switch to module:  "Welcome"
[WARNING][Qt] 31.01.2023 09:35:07 [] (unknown:0) - QXcbConnection: XCB error: 8 (BadMatch), sequence: 2117, resource id: 20971620, major code: 130 (Unknown), minor code: 3
[WARNING][Qt] 31.01.2023 09:35:07 [] (unknown:0) - QXcbConnection: XCB error: 8 (BadMatch), sequence: 2120, resource id: 20971620, major code: 130 (Unknown), minor code: 3
[WARNING][Qt] 31.01.2023 09:35:07 [] (unknown:0) - QXcbConnection: XCB error: 8 (BadMatch), sequence: 2136, resource id: 20971620, major code: 130 (Unknown), minor code: 3
[WARNING][Qt] 31.01.2023 09:35:07 [] (unknown:0) - QXcbConnection: XCB error: 8 (BadMatch), sequence: 2137, resource id: 20971620, major code: 130 (Unknown), minor code: 3
[WARNING][Qt] 31.01.2023 09:35:07 [] (unknown:0) - QXcbConnection: XCB error: 8 (BadMatch), sequence: 2166, resource id: 20971620, major code: 130 (Unknown), minor code: 3
[WARNING][Qt] 31.01.2023 09:35:07 [] (unknown:0) - QXcbConnection: XCB error: 8 (BadMatch), sequence: 2174, resource id: 20971620, major code: 130 (Unknown), minor code: 3

Thanks in advance!

@umgpy Did the observed behavior change after building Slicer from source? I saw that you mentioned this over on the GitHub issue.

Hello @jamesobutler not yet, I’ll try to build it this week. Shall report back soon!

I can build slicer on Debian 12 using wayland.

I use the following startup script

#!/bin/bash

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia QT_XCB_GL_INTEGRATION=xcb_egl QT_WAYLAND_SHELL_INTEGRATION=ivi-shell QT_WAYLAND_CLIENT_BUFFER_INTEGRATION=wayland-egl $@ -platform wayland

The first entries I use because I work on a laptop using hybrid graphics. Sometimes my entire computer freezes. I needed to install a different version for SSL to make it work.

Interesting - maybe that should go in slicer’s readthedocs somewhere.