Can't start latest stable on ubuntu 20.04

Due to the issues we had with Centos 7 and latest stable, I just recently installed Ubuntu 20.04 on a spare machine. This is just a default install, and nothing more (or less). Latest stable doesn’t start with this error:

> maga@magalab-ubuntu:~/Downloads/Slicer-4.11.20200930-linux-amd64$ ./Slicer 
> qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
> This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
> 
>     Available platform plugins are: xcb.
> 
>     error: [/home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/bin/SlicerApp-real] exit abnormally - Report the problem.`
1 Like

OK. As per this thread, setting:
export QT_DEBUG_PLUGINS=1

revealed missing library libxcb-xinerama0. Installing it fixed the problem.

maga@magalab-ubuntu:~/Downloads/Slicer-4.11.20200930-linux-amd64$ export QT_DEBUG_PLUGINS=1
maga@magalab-ubuntu:~/Downloads/Slicer-4.11.20200930-linux-amd64$ ./Slicer 
QFactoryLoader::QFactoryLoader() ignoring "com.nokia.qt.QGuiPlatformPluginInterface" since plugins are disabled in static builds 
QFactoryLoader::QFactoryLoader() ignoring "com.trolltech.Qt.QStyleFactoryInterface" since plugins are disabled in static builds 
QFactoryLoader::QFactoryLoader() ignoring "com.trolltech.Qt.QInputContextFactoryInterface" since plugins are disabled in static builds 
QFactoryLoader::QFactoryLoader() ignoring "com.trolltech.Qt.QImageIOHandlerFactoryInterface" since plugins are disabled in static builds 
QFactoryLoader::QFactoryLoader() checking directory path "/home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/lib/QtPlugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/lib/QtPlugins/platforms/libqxcb.so"
Found metadata in lib /home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/lib/QtPlugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/bin/platforms" ...
Cannot load library /home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/lib/QtPlugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/lib/QtPlugins/platforms/libqxcb.so" : "Cannot load library /home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/lib/QtPlugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

error: [/home/maga/Downloads/Slicer-4.11.20200930-linux-amd64/bin/SlicerApp-real] exit abnormally - Report the problem.
1 Like

Thanks for the report :+1:

So we should add libxcb-xinerama0 to the install line here?

or is there a different package name?

1 Like

If you search for Qt an xinerama then you find lots of unhappy users complaining about this:

@jcfr @Sam_Horvath Could you try to build Qt with -no-xinerama option to see if it fixes the issue? (see https://doc.qt.io/qt-5/linux-deployment.html)

We can continue the discussion here, but I also added a ticket to make sure we implement a good solution before releasing Slicer5: https://github.com/Slicer/Slicer/issues/5251

Just wanted to report that I have encountered the exact error, latest stable and Ubuntu 16.04.

I wonder what is different about the latest stable in the way it is built. We still couldn’t figure out why open3d 0.8.0 that worked until the 9/25 version of Linux is now causing a crash in the current stable.

Open3d does not seem to be related to this problem and it is discussed here).

Requiring xinerama extension on linux seems to be a very widespread problem. Qt says it is not a bug, as they document what X11 extensions are required, but since Ubuntu does not come with xinerama installed by default (maybe earlier ir did), this causing users some pain. Development of xinerama stopped more than a decade ago, and it seems that is being weeded out from more and more places, but its removal from Qt is only scheduled for Qt6. Until then, we either need to build our Qt with xinerama disabled or add a note to the Slicer installation instructions.

Here is a pull request updating the build scripts: https://github.com/jcfr/qt-easy-build/pull/60

That said, we currently do not build Qt and instead rely on the official binary to include Qt in the docker image used to build the official installers. See here

Until then, we either need to build our Qt with xinerama disabled or add a note to the Slicer installation instructions.

An third approach could be to update the launcher so that it checks for requirements and provide a friendly message to the user.

In the meantime, updating the install instructions is a sensible solution.

1 Like