Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Open GL error on raspbian Buster with Pi4 when starting application



  • Good day

    i compiled QT on raspbian Buster on my Pi4 with the linux-rasp-pi3-g++ option . I did the EGLFS fix as outlined in https://wiki.qt.io/RaspberryPi2EGLFS by editing the qmake.conf with

    VC_LIBRARY_PATH = $$[QT_SYSROOT]/opt/vc/lib
    VC_INCLUDE_PATH = $$[QT_SYSROOT]/opt/vc/include
    VC_LINK_LINE = -L$${VC_LIBRARY_PATH}
    QMAKE_LIBDIR_OPENGL_ES2 = $${VC_LIBRARY_PATH}
    

    Then i used this configuration

     PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig PKG_CONFIG_SYSROOT_DIR=/ \../qt-everywhere-src-5.12.4/configure -v -opengl es2 -eglfs -no-xcb -no-pch -no-gtk -device linux-rasp-pi3-g++ \-device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -reduce-exports \-force-pkg-config -nomake examples -no-compile-examples -skip qtwayland -skip qtwebengine -release \-qt-pcre -ssl -evdev -system-freetype -fontconfig -glib -gstreamer -prefix /opt/QT5
    

    My program compiles but i get these errors

    QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(pixelSize): shader program is not linked
    Buffer creation failed
    Buffer creation failed
    QOpenGLShaderProgram: could not create shader program
    QOpenGLShader: could not create shader
    QOpenGLShader: could not create shader
    shader compilation failed:
    

    This was the output of my configuration

    Configure summary:
    
    Building on: linux-g++ (arm, CPU features: <none>)
    Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon)
    Target compiler: gcc 8.3.0
    Configuration: cross_compile use_gold_linker enable_new_dtags largefile neon shared rpath release c++11 c++14 c++1z concurrent dbus reduce_exports stl
    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C standard ....................... C11
      Using C++ standard ..................... C++1z
      Using ccache ........................... no
      Using gold linker ...................... yes
      Using new DTAGS ........................ yes
      Using precompiled headers .............. no
      Using LTCG ............................. no
      Target compiler supports:
    	NEON ................................. yes
      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 .................................. no
      ICU .................................... yes
      Tracing backend ........................ <none>
      Logging backends:
    	journald ............................. no
    	syslog ............................... no
    	slog2 ................................ no
      Using system PCRE2 ..................... no
    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 ................................. no
      OpenGL:
    	Desktop OpenGL ....................... no
    	OpenGL ES 2.0 ........................ yes
    	OpenGL ES 3.0 ........................ yes
    	OpenGL ES 3.1 ........................ yes
    	OpenGL ES 3.2 ........................ yes
      Vulkan ................................. yes
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... yes
      INTEGRITY HID .......................... no
      mtdev .................................. yes
      tslib .................................. no
      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 ............................ yes
    	EGLFS VSP2 ........................... no
    	EGLFS Mali ........................... no
    	EGLFS Raspberry Pi ................... yes
    	EGLFS X11 ............................ no
      LinuxFB ................................ yes
      VNC .................................... yes
      Mir client ............................. 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 ................................... no
    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 Bluetooth:
      BlueZ .................................. yes
      BlueZ Low Energy ....................... yes
      Linux Crypto API ....................... yes
      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 ............................. yes
    	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 ................................... no
    
    Note: Also available for Linux: linux-clang linux-icc
    
    WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.
    
    Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
    On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
    On macOS, you can use Homebrew's llvm package.
    On Windows, you must set LLVM_INSTALL_DIR to the installation path.
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into '/opt/QT5'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    Can anyone assist what might be the issue ?



  • @Markus-Ippy said in Open GL error on raspbian Buster with Pi4 when starting application:

    QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked

    I guess it is some issue about OpenGL. Not your Qt configuration or application. Try the solution on here.



  • Hello Markus,

    I'm not sure if what I offer is a solution to what you problem or just yet another long winded ramble, but for another angle besides what you have tried so far, you could try
    adding "-no-feature-opengles3" to your configure statement.

    It is my understanding that the RPi when using the GPU firmware support OpenGLES v2 .
    Since your using the device option "linux-rasp-pi3-g++" that means you want to use the binary bcm BLOB(firmware) that controls the GPU, which is the default for that qt device option, but not the default for the pi4's firmware. But that's another issue.

    I have compiled both the raspi-pi3-g++ and the pi3-vc4 one and they both work with my projects when using the option:

    "-no-feature-opengles3"

    #I have binaries here built on buster raspbian at sf:
    https://sourceforge.net/projects/qt-5-9-8-eglfs-emb-rpipi2-plus/
    and
    https://sourceforge.net/projects/qt-5-9-8-eglfs-gbm-emb-pi3-vc4/

    If you check qtdiag after a good build you can see what your opengles setup is.

    Here is the important info from my rpi3 "GPU blob enabled" build, the same type of one your building.

    LibGLES Vendor: Broadcom
    Renderer: VideoCore IV HW
    Version: OpenGL ES 2.0
    Shading language: OpenGL ES GLSL ES 1.00
    Format: Version: 2.0 Profile: 0 Swap behavior: 0 Buffer size (RGB): 5,6,5

    and then

    Here is the important info from my rpi3 " mesa VC4 enabled" build, obv NOT same type of one your building in your example here, but given anyway for comparison. Even though I do add this option (-no-feature-opengles3) with the vc4 build too it does not break my builds so far (YMMV). The rpi3-vc4 qt "-device" version supports a higher version of es2 from mesa, but I think the hardware is still limited to 2.0
    That being said the "Shader language statement below still says it can do 3.0 in my -no-feature-opengles3 configured vc4 build :) Symantics.

    LibGLES Vendor: Broadcom
    Renderer: V3D 4.2
    Version: OpenGL ES 3.0 Mesa 19.1.0-devel
    Shading language: OpenGL ES GLSL ES 3.00
    Format: Version: 3.0 Profile: 0 Swap behavior: 0 Buffer size (RGB): 8,8,8

    Just in the unlikely case you havent seen it. A long discussion about about the vc4 , see next link.
    Some of that, I think says , how it's default setup DOES NOT use the GPU
    binary when on the Pi4. Not a quote but thats what I got from it.
    https://www.raspberrypi.org/forums/viewtopic.php?f=67&t=243564&p=1508457&hilit=vc4#p1508457
    or
    https://www.raspberrypi.org/forums/viewtopic.php?t=216804
    and
    https://www.raspberrypi.org/forums/viewtopic.php?t=244519
    and
    https://www.raspberrypi.org/forums/viewtopic.php?f=67&t=243507&p=1508172&hilit=vc4#p1508172

    Good luck.

    *note my examples are with 5.9.8, but still applies as I have built up to 12.4 same way, but I dont use the latest with mine because I have unresolved mysql/mariadb issues in >5.9.8 , but thats just me.


Log in to reply