QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
-
So, nobody knows specifically what that message means? Is there a function
call openGL->enableGLX(true);
that has not been called?
Perhaps it was not necessary in a previous version of the surrounding libraries, but it is necessary now?
Or to ask it another way: Who wrote QXcbIntegration? Are they still around?
-
[ The forum won't let me post more often than every ten minutes. I guess to make sure I don't fill up the channel. ]
Ah. Red Hat Enterprise Linux. Release 8.7.
I hadn't even considered that. Does RedHat distribute Qt as part of their system? An rpm, or something?
Yes, it is QT 5 (Qt 5.11.1) Yes, it is Visual Studio (MSVC 2015, 32 bit)
@Rick_Hedin said in QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled:
[ The forum won't let me post more often than every ten minutes. I guess to make sure I don't fill up the channel. ]
Ah. Red Hat Enterprise Linux. Release 8.7.
I hadn't even considered that. Does RedHat distribute Qt as part of their system? An rpm, or something?
Almost certainly, yes. It won't be a commercially licensed version.
A dnf search for qt5- should return a list of related packages.Yes, it is QT 5 (Qt 5.11.1) Yes, it is Visual Studio (MSVC 2015, 32 bit)
This answer is inconsistent with running on Linux. If the Qt SDK is installed for the system in question, run the
qtdiag
program. It should be in <Qt Installation>/<Qt version>/<platform>/bin/This will report a lot of information. Probably too much for a reasonable forum post. Look for information about the Qt version, OpenGL configuration, and host platform. Eg:
Qt 5.15.14 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6)) on "xcb" OS: Fedora Linux 37 (Thirty Seven) [linux version 6.3.5-100.fc37.x86_64] [...] LibGL Vendor: Mesa Renderer: llvmpipe (LLVM 15.0.7, 256 bits) Version: 4.5 (Compatibility Profile) Mesa 23.0.3 Shading language: 4.50 Format: Version: 4.5 Profile: 2 Swap behavior: 0 Buffer size (RGB): 8,8,8 Profile: None (QOpenGLFunctions_4_5), Core (QOpenGLFunctions_4_5_Core), Compatibility (QOpenGLFunctions_4_5_Compatibility) Unable to create a Vulkan instance, error code is0 Qt Rendering Hardware Interface supported backends: OpenGL (with default QSurfaceFormat): [...]
At runtime for a program, additional information can be printed by setting a few environment variables.
https://doc.qt.io/qt-6/debug.htmlQT_DEBUG_PLUGINS=1
andQT_LOGGING_RULES=*.*=true
are a useful start.Turning on all logging rules will probably be too much. See https://doc.qt.io/qt-6/qloggingcategory.html for information on configuring a reduced set.
@Rick_Hedin said in QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled:
So, nobody knows specifically what that message means? [...]
Or to ask it another way: Who wrote QXcbIntegration? Are they still around?Keep in mind that this is a user forum. Most people posting here don't work for The Qt Company, and are likely doing it for fun or personal fulfillment.
-
Hi, Jeremy. That's great information. RedHat probably has a version of Qt that they've "blessed" and that I can install. There are techniques that can be used to find out what's going on with Qt. Thank you.
Can I have more than one version of Qt installed on a system? {Meaning RedHat) And I can run either QtCreator4.7 or QtCreator10.0?
-
Hi, Jeremy. That's great information. RedHat probably has a version of Qt that they've "blessed" and that I can install. There are techniques that can be used to find out what's going on with Qt. Thank you.
Can I have more than one version of Qt installed on a system? {Meaning RedHat) And I can run either QtCreator4.7 or QtCreator10.0?
@Rick_Hedin said in QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled:
Can I have more than one version of Qt installed on a system? {Meaning RedHat) And I can run either QtCreator4.7 or QtCreator10.0?
By default, different Qt 5 RPM package versions will overwrite each other. This behavior is the same for most RPM packages. There are tricks such as using docker containers, different install roots, manually unpacking, or telling rpm to ignore the database.
The Creator version should not matter. Use whatever is available, a different IDE, or the command line if you prefer.
-
Just a minor correction, you can have several versions of Qt installed: the official from your distribution that lives in the system folders that you should not touch or try to override and then the ones you can install using the online installer or that you build yourself which will live somewhere else in the system such as your home directory or the /opt directory. Doing so will avoid having them interfere with your system.
-
Just a minor correction, you can have several versions of Qt installed: the official from your distribution that lives in the system folders that you should not touch or try to override and then the ones you can install using the online installer or that you build yourself which will live somewhere else in the system such as your home directory or the /opt directory. Doing so will avoid having them interfere with your system.
@SGaist said in QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled:
Just a minor correction, you can have several versions of Qt installed: the official from your distribution that lives in the system folders that you should not touch or try to override and then the ones you can install using the online installer or that you build yourself which will live somewhere else in the system such as your home directory or the /opt directory. Doing so will avoid having them interfere with your system.
I had presumed, given the enthusiasm for a Red Hat provided package, that the question was limited to those packages. Using the Qt Company's online installer, the number of installations is effectively infinite.
-
@SGaist said in QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled:
Just a minor correction, you can have several versions of Qt installed: the official from your distribution that lives in the system folders that you should not touch or try to override and then the ones you can install using the online installer or that you build yourself which will live somewhere else in the system such as your home directory or the /opt directory. Doing so will avoid having them interfere with your system.
I had presumed, given the enthusiasm for a Red Hat provided package, that the question was limited to those packages. Using the Qt Company's online installer, the number of installations is effectively infinite.
-
The error I get related to Qapplication/
, I am using conda env and error i get is
"QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
qt.qpa.backingstore: composeAndFlush: makeCurrent() failed
QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled"distribution running on my machine
PRETTY_NAME="Ubuntu 24.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.3 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
For Qt
Python 3.8.20 (default, Oct 3 2024, 15:24:27)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.from PyQt5.QtCore import QLibraryInfo print("Qt version:", QLibraryInfo.version().toString()) Qt version: 5.15.2 print("Prefix path:", QLibraryInfo.location(QLibraryInfo.PrefixPath)) Prefix path: /home/rmunusamy/miniconda3/envs/hpe print("Library path:", QLibraryInfo.location(QLibraryInfo.LibrariesPath)) Library path: /home/rmunusamy/miniconda3/envs/hpe/lib
I am running on wayland
echo $XDG_SESSION_TYPE
waylandSo , prepended env variable QT_QPA_PLATFORM=wayland then, the script. i get this warning
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
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, minimal, minimalegl, offscreen, vnc, webgl, xcb.
-
The Qt 5.15.2 libraries that the application is running with do not have a Wayland plugin (as the error message states). You need to add the Wayland platform plugins using the Qt online installer, your distribution package manager, or by building Qt again depending on how your Qt libraries originated.
If you are using the Ubuntu-supplied Qt5 then the package would be qtwayland5 (probably not the case given the Qt version number)
BTW: Why hijack a two-year-old thread for a new problem?