Cannot launch GUI due to Qt error

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
saintlyknighted
Posts: 16
Joined: Sun Aug 06, 2023 3:40 am

Cannot launch GUI due to Qt error

Post by saintlyknighted »

Hello, I've installed Code_Saturne v7.0.6 but I'm unable to open the GUI, it gives me the error attached below. I understand this (probably) isn't a Code_Saturne-specific issue and has more to do with PyQt5, but I've tried a variety of solutions found on the internet without success, including uninstalling and reinstalling PyQt5, so I figured I'd ask here if anyone knows about this problem. Not exactly sure why this is happening either as I can run Code_Saturne on my laptop with no issues. Any help would be appreciated!

If it helps, I am running Code_Saturne on Windows Subsystem for Linux. My laptop also uses WSL.

Code: Select all

qt.qpa.xcb: could not connect to display
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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted
The version of PyQt5 that I have is 5.15.9, to the best of my knowledge.

Code: Select all

Requirement already satisfied: pyqt5 in /home/bryan/.local/lib/python3.9/site-packages (5.15.9)
Requirement already satisfied: PyQt5-Qt5>=5.15.2 in /home/bryan/.local/lib/python3.9/site-packages (from pyqt5) (5.15.2)
Requirement already satisfied: PyQt5-sip<13,>=12.11 in /home/bryan/.local/lib/python3.9/site-packages (from pyqt5) (12.13.0)
Yvan Fournier
Posts: 4145
Joined: Mon Feb 20, 2012 3:25 pm

Re: Cannot launch GUI due to Qt error

Post by Yvan Fournier »

Hello,

Since info on running under WSL is a bit "spread out", I suggest a check list :

- First, did you export your display (and run an X11 server) ?
Running
export DISPLAY=:0
in the terminal from whihc you launch code_saturne should be enough, if you do have an X-server running. Otherwise, that would explain the firs error message.
Under WSL2, this might not be necessary, but I have never checked. Under WSL 1, it is necessary.

- The procedure described here https://github.com/code-saturne/code_sa ... -for-linux might help, but since it does not match tour error message, I do not think it is relevant here.

I have also seen the same or a very similar XCB plugin error message on a pure Linux machine some months ago, but do not remember the exact workaround (some library was present but not compatible, and the issue was a bit subtle).

Best regards,

Yvan
saintlyknighted
Posts: 16
Joined: Sun Aug 06, 2023 3:40 am

Re: Cannot launch GUI due to Qt error

Post by saintlyknighted »

My display is already set to :0, and if it matters I am just trying to run Code_Saturne on a local machine and not through SSH. I also have WSL2 installed. Have also tried the procedure in the link but it didn't work - as you have said it probably wasn't the same issue anyway.

Oh and I have also forgotten to mention, I'm also trying to run Code_Saturne on another pure Linux machine but it gives me the same error.

Since I'm running a dual boot machine I might try to run it on pure Linux instead, but I might still run into the same issue (as with the other machine mentioned above). Will give an update here when I see what happens. In the meantime, please let me know if you have any other idea on how to attempt to handle this.
Yvan Fournier
Posts: 4145
Joined: Mon Feb 20, 2012 3:25 pm

Re: Cannot launch GUI due to Qt error

Post by Yvan Fournier »

Hello,

Running on a pure Linux machine should not change anything, and this seems to be a Qt install or version issue.

Some forums recommend running with "QT_DEBUG_PLUGINS=1 " to get more debug info.
Looking at those forums, causes for this issue vary, but a frequent cause is when multiple Qt versions are installed, and the run and compile environment use different ones.

Best regards,

Yvan
saintlyknighted
Posts: 16
Joined: Sun Aug 06, 2023 3:40 am

Re: Cannot launch GUI due to Qt error

Post by saintlyknighted »

Hi Yvan, sorry for the long delay. I've gotten the debug info and printed it below, maybe you'd like to have a look at it in case the issue somehow lies with something Code_Saturne related, though I very much doubt it.

Code: Select all

QFactoryLoader::QFactoryLoader() checking directory path "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqeglfs.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqeglfs.so, metadata={
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "eglfs"
        ]
    },
    "archreq": 0,
    "className": "QEglFSIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqlinuxfb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "linuxfb"
        ]
    },
    "archreq": 0,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqminimal.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqminimal.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimal"
        ]
    },
    "archreq": 0,
    "className": "QMinimalIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqminimalegl.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqminimalegl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimalegl"
        ]
    },
    "archreq": 0,
    "className": "QMinimalEglIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqvnc.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqvnc.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "vnc"
        ]
    },
    "archreq": 0,
    "className": "QVncIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-egl.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland-egl")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-generic.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-generic.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland"
        ]
    },
    "archreq": 0,
    "className": "QWaylandIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-egl.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland-xcomposite-egl")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-glx.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-glx.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-glx"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland-xcomposite-glx")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwebgl.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqwebgl.so, metadata={
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "webgl"
        ]
    },
    "archreq": 0,
    "className": "QWebGLIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() looking at "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so"
Found metadata in lib /home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/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 "/opt/hpds/miniconda/bin/platforms" ...
loaded library "/home/bryan/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so"
qt.qpa.xcb: could not connect to display 172.31.80.1:0.0
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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted
Yvan Fournier
Posts: 4145
Joined: Mon Feb 20, 2012 3:25 pm

Re: Cannot launch GUI due to Qt error

Post by Yvan Fournier »

Hello,

I had not previously noticed that your Qt5 install seems to be local to your home directory, so not from the base Linux distro, but from some other packaging or install system (pip or Conda I assume ?).

Which version of Qt was detected at install (this is why logs are mentioned in the forum usage recommendations for the "installation issues) ?

Also, I have often seen code_saturne installation issues for users using Conda. I do not know why (I suspect some inconsistencies between the packages detected at configure time and at run time, though I do not know why).

Are user modules implemented on your system (through a "module load" type of syntax) ? We try to detect those at install time, to kept the same environment, but a variant system with similar syntax could cause issues. In this case, adding "--with-modules=no" to the code_saturne configure line to tell it to ignore those may help.

In any case, we have no/less issues with natively installed Python and PyQt, so usually recommend those. And code_saturne works fine with additional Python packages or seperately packaged PyQt if the environement is consistent (we have the experience with ou in-house SALOME builds).

Best regards,

Yvan
saintlyknighted
Posts: 16
Joined: Sun Aug 06, 2023 3:40 am

Re: Cannot launch GUI due to Qt error

Post by saintlyknighted »

Hi Yvan,

Sorry it's been a long time, but I had more pressing work to attend to and I was able to run everything on my laptop in the meantime. For some reason I tried running the GUI recently (and also cgnsview) and it somehow works now, without me doing anything. Perhaps some update happened in the background? Regardless, many thanks for the help and the advice you have given me! Fingers crossed, hopefully PyQt does not break again, otherwise I might be back here. :lol:

Cheers,
Bryan
Post Reply