Strange issue with QXcbIntegration: Cannot create platform OpenGL context, neither GLX or EGL are enabled
-
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.
-
Hi,
Does your standard user have proper access to xorg ?
Is the server running ? -
If you can log into your RPi locally with the graphical user interface working it should already be a good sign.
-
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.
-
Can you run GLXGears ?
-
Without sudo ?
-
@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 ?
-
You would need a build with EGL on X11 enabled.