Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Forum Updated to NodeBB v4.3 + New Features

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

Scheduled Pinned Locked Moved Unsolved General and Desktop
qxcbintegrationglxeglx-11opengl
19 Posts 5 Posters 4.7k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rick_Hedin
    wrote on last edited by
    #10

    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?

    1 Reply Last reply
    0
    • R Rick_Hedin

      [ 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)

      jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by jeremy_k
      #11

      @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.html

      QT_DEBUG_PLUGINS=1 and QT_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.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      1
      • R Offline
        R Offline
        Rick_Hedin
        wrote on last edited by
        #12

        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?

        jeremy_kJ 1 Reply Last reply
        0
        • R Rick_Hedin

          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?

          jeremy_kJ Offline
          jeremy_kJ Offline
          jeremy_k
          wrote on last edited by
          #13

          @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.

          Asking a question about code? http://eel.is/iso-c++/testcase/

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #14

            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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            jeremy_kJ 1 Reply Last reply
            0
            • SGaistS SGaist

              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.

              jeremy_kJ Offline
              jeremy_kJ Offline
              jeremy_k
              wrote on last edited by
              #15

              @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.

              Asking a question about code? http://eel.is/iso-c++/testcase/

              R 1 Reply Last reply
              0
              • jeremy_kJ jeremy_k

                @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.

                R Offline
                R Offline
                Rick_Hedin
                wrote on last edited by
                #16

                @jeremy_k @SGaist Gotcha. So I should leave the one RedHat installed alone. But I can have different Qt and Qt Creator installations installed at different locations, and they won't fight.

                They won't even fight over the system libraries on /usr/lib or some such?

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  rambo1993
                  wrote last edited by
                  #17

                  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
                  wayland

                  So , 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.

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    ChrisW67
                    wrote last edited by
                    #18

                    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?

                    1 Reply Last reply
                    2
                    • R Offline
                      R Offline
                      rambo1993
                      wrote last edited by
                      #19

                      Thanks for the insights, by the way I ain't using Ubuntu-supplied Qt5 , i installed separately but not from link. I will try to add wayland plugins and see it works.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved