Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Strange issue with QXcbIntegration: Cannot create platform OpenGL context, neither GLX or EGL are enabled
QtWS25 Last Chance

Strange issue with QXcbIntegration: Cannot create platform OpenGL context, neither GLX or EGL are enabled

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
openglraspberrypicross compileqt512.11qt quick
13 Posts 2 Posters 11.8k Views
  • 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.
  • A Offline
    A Offline
    andy0206
    wrote on last edited by andy0206
    #1

    Hi,

    I have a QT Quick application running on a Raspberry Pi Zero (Buster), QT5.12.11 cross compiled on a Ubuntu 20.04 VM using the well published tutorials. All is OK when I launch the application from QT Creator or via a remote terminal console, e.g. Putty. I DO NOT get any issues, and the 3D graphics render OK (e.g. my transparency elements on widgets are all rendering OK). However when I start the application locally on the RPi I get:

    QXcbIntegration: Cannot create platform OpenGL context, neither GLX or EGL are enabled failed to acquire GL context to resolve capabilities, using defaults..
    

    And all of the widgets with any transparency do not render correctly, either completely transparent or a white overlay.

    When I set up the toolchain I used this configuration:

    ./configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -skip qtwebengine -no-icu -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm
    

    Note: I am not using Webkit - so I skipped the compilation because I got a warning which I could not resolve for RPI zero.

    "WARNING: Thumb instruction set is required to build ffmpeg for QtWebEngine"

    and this was the output:

    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C standard ....................... C11
      Using C++ standard ..................... C++11
      Using ccache ........................... no
      Using gold linker ...................... no
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
        NEON ................................. no
      Build parts ............................ libs
    Qt modules and options:
      Qt Concurrent .......................... yes
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... yes
      Qt Gui ................................. yes
      Qt Network ............................. yes
      Qt Sql ................................. yes
      Qt Testlib ............................. yes
      Qt Widgets ............................. yes
      Qt Xml ................................. yes
    Support enabled for:
      Using pkg-config ....................... yes
      udev ................................... yes
      Using system zlib ...................... yes
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ yes
      GLib ................................... yes
      iconv .................................. yes
      ICU .................................... no
      Tracing backend ........................ <none>
      Logging backends:
        journald ............................. no
        syslog ............................... no
        slog2 ................................ no
      Using system PCRE2 ..................... yes
    Qt Network:
      getifaddrs() ........................... yes
      IPv6 ifname ............................ yes
      libproxy ............................... no
      Linux AF_NETLINK ....................... yes
      OpenSSL ................................ yes
        Qt directly linked to OpenSSL ........ no
      OpenSSL 1.1 ............................ yes
      DTLS ................................... yes
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Gui:
      Accessibility .......................... yes
      FreeType ............................... yes
        Using system FreeType ................ yes
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ yes
      Fontconfig ............................. yes
      Image formats:
        GIF .................................. yes
        ICO .................................. yes
        JPEG ................................. yes
          Using system libjpeg ............... yes
        PNG .................................. yes
          Using system libpng ................ yes
      EGL .................................... yes
      OpenVG ................................. yes
      OpenGL:
        Desktop OpenGL ....................... no
        OpenGL ES 2.0 ........................ yes
        OpenGL ES 3.0 ........................ no
        OpenGL ES 3.1 ........................ no
        OpenGL ES 3.2 ........................ no
      Vulkan ................................. yes
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... yes
      INTEGRITY HID .......................... no
      mtdev .................................. yes
      tslib .................................. yes
      xkbcommon .............................. yes
      X11 specific:
        XLib ................................. yes
        XCB Xlib ............................. yes
        EGL on X11 ........................... no
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. yes
      EGLFS details:
        EGLFS OpenWFD ........................ no
        EGLFS i.Mx6 .......................... no
        EGLFS i.Mx6 Wayland .................. no
        EGLFS RCAR ........................... no
        EGLFS EGLDevice ...................... no
        EGLFS GBM ............................ no
        EGLFS VSP2 ........................... no
        EGLFS Mali ........................... no
        EGLFS Raspberry Pi ................... yes
        EGLFS X11 ............................ no
      LinuxFB ................................ yes
      VNC .................................... yes
      Mir client ............................. no
      XCB:
        Using system-provided XCB libraries .. yes
        XCB XKB .............................. yes
        XCB XInput ........................... no
        Native painting (experimental) ....... yes
        GL integrations:
          GLX Plugin ......................... no
          EGL-X11 Plugin ..................... no
    Qt Sql:
      SQL item models ........................ yes
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... yes
    Qt Sql Drivers:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. yes
      SQLite2 ................................ yes
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... yes
    Qt Testlib:
      Tester for item models ................. yes
    Qt SerialBus:
      Socket CAN ............................. yes
      Socket CAN FD .......................... yes
    Further Image Formats:
      JasPer ................................. no
      MNG .................................... yes
      TIFF ................................... yes
        Using system libtiff ................. yes
      WEBP ................................... yes
        Using system libwebp ................. no
    Qt QML:
      QML network support .................... yes
      QML debugging and profiling support .... yes
      QML sequence object .................... yes
      QML list model ......................... yes
      QML XML http request ................... yes
      QML Locale ............................. yes
      QML delegate model ..................... yes
    Qt Quick:
      Direct3D 12 ............................ no
      AnimatedImage item ..................... yes
      Canvas item ............................ yes
      Support for Qt Quick Designer .......... yes
      Flipable item .......................... yes
      GridView item .......................... yes
      ListView item .......................... yes
      TableView item ......................... yes
      Path support ........................... yes
      PathView item .......................... yes
      Positioner items ....................... yes
      Repeater item .......................... yes
      ShaderEffect item ...................... yes
      Sprite item ............................ yes
    Qt Scxml:
      ECMAScript data model for QtScxml ...... yes
    Qt Gamepad:
      SDL2 ................................... yes
    Qt 3D:
      Assimp ................................. yes
      System Assimp .......................... no
      Output Qt3D Job traces ................. no
      Output Qt3D GL traces .................. no
      Use SSE2 instructions .................. no
      Use AVX2 instructions .................. no
      Aspects:
        Render aspect ........................ yes
        Input aspect ......................... yes
        Logic aspect ......................... yes
        Animation aspect ..................... yes
        Extras aspect ........................ yes
    Qt 3D Renderers:
      OpenGL Renderer ........................ yes
    Qt 3D GeometryLoaders:
      Autodesk FBX ........................... no
    Qt Wayland Client ........................ no
    Qt Wayland Compositor .................... no
    Qt Bluetooth:
      BlueZ .................................. no
      BlueZ Low Energy ....................... no
      Linux Crypto API ....................... no
      WinRT Bluetooth API (desktop & UWP) .... no
    Qt Sensors:
      sensorfw ............................... no
    Qt Quick Controls 2:
      Styles ................................. Default Fusion Imagine Material Universal
    Qt Quick Templates 2:
      Hover support .......................... yes
      Multi-touch support .................... yes
    Qt Positioning:
      Gypsy GPS Daemon ....................... no
      WinRT Geolocation API .................. no
    Qt Location:
      Qt.labs.location experimental QML plugin . yes
      Geoservice plugins:
        OpenStreetMap ........................ yes
        HERE ................................. yes
        Esri ................................. yes
        Mapbox ............................... yes
        MapboxGL ............................. no
        Itemsoverlay ......................... yes
    QtXmlPatterns:
      XML schema support ..................... yes
    Qt Multimedia:
      ALSA ................................... yes
      GStreamer 1.0 .......................... yes
      GStreamer 0.10 ......................... no
      Video for Linux ........................ yes
      OpenAL ................................. no
      PulseAudio ............................. yes
      Resource Policy (libresourceqt5) ....... no
      Windows Audio Services ................. no
      DirectShow ............................. no
      Windows Media Foundation ............... no
    Qt Tools:
      QDoc ................................... yes
    
    Note: Also available for Linux: linux-clang linux-icc
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into '/home/developer/raspi/qt5pi'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    Note: the following from above:

    EGL .................................... yes
    OpenVG ................................. yes
    OpenGL:
      Desktop OpenGL ....................... no
      OpenGL ES 2.0 ........................ yes
    
    EGLFS .................................. yes
    EGLFS details:
      EGLFS OpenWFD ........................ no
      EGLFS i.Mx6 .......................... no
      EGLFS i.Mx6 Wayland .................. no
      EGLFS RCAR ........................... no
      EGLFS EGLDevice ...................... no
      EGLFS GBM ............................ no
      EGLFS VSP2 ........................... no
      EGLFS Mali ........................... no
      EGLFS Raspberry Pi ................... yes
    
    Qt 3D Renderers:
    OpenGL Renderer ........................ yes
    

    Has anyone got any ideas on why this is happening?

    Surely if OpenGL was not installed or compiled correctly it would not work irrespective of how the application is launched. Seems odd to me why it works when launched remotely then not when launch locally in the RPi!!

    Any help appreciated.


    UPDATE


    If I launch the application locally on the RPI from the command line with sudo then I have no error.

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

      Hi,

      Does your standard user have proper access to xorg ?
      Is the server running ?

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andy0206
        wrote on last edited by
        #3

        Hi,

        Thanks for posting.

        Yes, X server is running.
        What is the best way to check if the current user has access to xorg? and how do you add the user?

        FYI I only have one user on the Pi as per out of box when installing raspbarian.

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

          If you can log into your RPi locally with the graphical user interface working it should already be a good sign.

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

          1 Reply Last reply
          1
          • A Offline
            A Offline
            andy0206
            wrote on last edited by
            #5

            Thanks. Yes, its all generally Good in terms of the display when logged in as pi user. As described, the issue only manifests when the application is launched locally from the pi user profile. Starting the application remotely or within Qt Creator is all Good. For now I have created a launch application script elevated with sudo and the application runs fine.

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

              Can you run GLXGears ?

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

              1 Reply Last reply
              1
              • A Offline
                A Offline
                andy0206
                wrote on last edited by
                #7

                Hi, Yes it glxgears works fine - low frame rate, but that's to be expected on a PiZero.

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

                  Without sudo ?

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

                  1 Reply Last reply
                  1
                  • A Offline
                    A Offline
                    andy0206
                    wrote on last edited by
                    #9

                    Yes, sorry

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

                      @andy0206 said in Strange issue with QXcbIntegration: Cannot create platform OpenGL context, neither GLX or EGL are enabled:

                      EGL on X11

                      I wonder if your issue related to that.

                      Does running your application with sudo use X or the frame buffer directly ?

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

                      1 Reply Last reply
                      1
                      • A Offline
                        A Offline
                        andy0206
                        wrote on last edited by
                        #11

                        Hi,

                        I’m not entirely sure how to check for that. The application is not doing anything special, just a QML app with some custom styled controls which has transparency. I am using QtCamera in the application though.

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

                          You would need a build with EGL on X11 enabled.

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

                          A 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            You would need a build with EGL on X11 enabled.

                            A Offline
                            A Offline
                            andy0206
                            wrote on last edited by
                            #13

                            @SGaist Ok, thank you. I'll give it a go

                            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