BortEngineer
Posts: 4
Joined: Tue Apr 07, 2020 1:47 pm

Qt5 and RPi EGLFS: Could not initialize egl display

Tue Apr 07, 2020 2:19 pm

Hello, i'm trying to cross-compile Qt5 with EGLFS support for Raspberry Pi Zero W running Raspbian buster lite(2020-02-13). I'm using this tutorial with appropriate changes for pi zero.

I have tried building different versions of Qt from 5.11 to 5.13, both with static and dynamic linking, yet result is always the same: whenever I try to run cross-compiled app I am only getting Could not initialize egl display error.

What i have tried so far:
  • building different versions of Qt <- no effect
  • running app with -platform eglfs args <- no effect
  • export DISPLAY=:0 before running application <- no effect
  • running examples from /opt/vc/hello_pi/ <- they all work just fine
  • enabling/disabling Full KMS OpenGL driver <- no effect
  • running with sudo <- adds QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' before error
Any ideas how to get rid of this error?

Code: Select all

config.summary from my last attempt:

Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: devices/linux-rasp-pi-g++ (arm, CPU features: <none>)
Target compiler: gcc 4.8.3
Configuration: cross_compile compile_examples enable_new_dtags largefile precompile_header release c++11 concurrent dbus reduce_exports static stl
Build options:
  Mode ................................... release
  Optimize release build for size ........ no
  Building shared libraries .............. no
  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 ........................ 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 .................................. 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 ................................... 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 .................................. 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
QtXmlPatterns:
  XML schema support ..................... yes
Qt Multimedia:
  ALSA ................................... yes
  GStreamer 1.0 .......................... no
  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
Qt WebEngine:
  Embedded build ......................... yes
  Full debug information ................. no
  Pepper Plugins ......................... no
  Printing and PDF ....................... no
  Proprietary Codecs ..................... no
  Spellchecker ........................... yes
  Native Spellchecker .................... no
  WebRTC ................................. no
  Use System Ninja ....................... no
  Geolocation ............................ no
  WebChannel support ..................... yes
  Use v8 snapshot ........................ yes
  Kerberos Authentication ................ no
  Support qpa-xcb ........................ no
  Building v8 snapshot supported ......... no
  Use ALSA ............................... yes
  Use PulseAudio ......................... yes
  Optional system libraries used:
    re2 .................................. no
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . no
    opus ................................. no
    ffmpeg ............................... no
    libvpx ............................... no
    snappy ............................... no
    glib ................................. yes
    zlib ................................. yes
    minizip .............................. no
    libevent ............................. no
    jsoncpp .............................. no
    protobuf ............................. no
    libxml2 and libxslt .................. no
    lcms2 ................................ no
    png .................................. yes
    JPEG ................................. yes
    harfbuzz ............................. yes
    freetype ............................. yes
  Required system libraries:
    fontconfig ........................... yes
    dbus ................................. yes
    nss .................................. no
    khr .................................. yes
    glibc ................................ yes
  Required system libraries for qpa-xcb:
    x11 .................................. no
    libdrm ............................... no
    xcomposite ........................... no
    xcursor .............................. no
    xi ................................... no
    xtst ................................. no

Note: Also available for Linux: linux-clang linux-icc

Note: PKG_CONFIG_LIBDIR automatically set to /home/bort/Programming/qt5rpi-buildenv/sysroot/usr/lib/pkgconfig:/home/bort/Programming/qt5rpi-buildenv/sysroot/usr/share/pkgconfig:/home/bort/Programming/qt5rpi-buildenv/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig

Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/bort/Programming/qt5rpi-buildenv/sysroot

Note: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.

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.

WARNING: gperf is required to build QtWebEngine.

WARNING: bison is required to build QtWebEngine.

WARNING: Thumb instruction set is required to build ffmpeg for QtWebEngine.
Last edited by BortEngineer on Wed Apr 08, 2020 5:29 am, edited 1 time in total.

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Tue Apr 07, 2020 10:31 pm

Tried with "sudo" ?

Can you do "ldd yourapp" and post the results here ?

BortEngineer
Posts: 4
Joined: Tue Apr 07, 2020 1:47 pm

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Wed Apr 08, 2020 5:27 am

Starting app with sudo returns warning on top of the error:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Could not initialize egl display
Aborted

NOTE: right now my app is using static linking, atleast for Qt libs
ldd:

Code: Select all

	/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so (0xb6f0d000)
        libjpeg.so.62 => /usr/lib/arm-linux-gnueabihf/libjpeg.so.62 (0xb6eb8000)
        libmng.so.1 => /usr/lib/arm-linux-gnueabihf/libmng.so.1 (0xb6e49000)
        libtiff.so.5 => /usr/lib/arm-linux-gnueabihf/libtiff.so.5 (0xb6dc9000)
        libbcm_host.so => /opt/vc/lib/libbcm_host.so (0xb6d9f000)
        libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6d57000)
        libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb6cb4000)
        libmtdev.so.1 => /usr/lib/arm-linux-gnueabihf/libmtdev.so.1 (0xb6c9f000)
        libinput.so.10 => /usr/lib/arm-linux-gnueabihf/libinput.so.10 (0xb6c57000)
        libxkbcommon.so.0 => /usr/lib/arm-linux-gnueabihf/libxkbcommon.so.0 (0xb6c0e000)
        libudev.so.1 => /lib/arm-linux-gnueabihf/libudev.so.1 (0xb6bde000)
        libdbus-1.so.3 => /lib/arm-linux-gnueabihf/libdbus-1.so.3 (0xb6b8d000)
        libts.so.0 => /usr/lib/arm-linux-gnueabihf/libts.so.0 (0xb6b79000)
        libEGL.so.1 => /usr/lib/arm-linux-gnueabihf/libEGL.so.1 (0xb6b5a000)
        libpng16.so.16 => /usr/lib/arm-linux-gnueabihf/libpng16.so.16 (0xb6b1e000)
        libharfbuzz.so.0 => /usr/lib/arm-linux-gnueabihf/libharfbuzz.so.0 (0xb6a20000)
        libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb69f5000)
        libpcre2-16.so.0 => /usr/lib/arm-linux-gnueabihf/libpcre2-16.so.0 (0xb6979000)
        libdouble-conversion.so.1 => /usr/lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0xb6955000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6942000)
        libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0xb6930000)
        libglib-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb6820000)
        libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0xb6801000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb67d7000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6690000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb660e000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb65e1000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6493000)
        /lib/ld-linux-armhf.so.3 (0xb6f20000)
        libjpeg.so.8 => /usr/lib/arm-linux-gnueabihf/libjpeg.so.8 (0xb6450000)
        liblcms2.so.2 => /usr/lib/arm-linux-gnueabihf/liblcms2.so.2 (0xb63f9000)
        libwebp.so.6 => /usr/lib/arm-linux-gnueabihf/libwebp.so.6 (0xb6395000)
        libzstd.so.1 => /usr/lib/arm-linux-gnueabihf/libzstd.so.1 (0xb62fc000)
        liblzma.so.5 => /lib/arm-linux-gnueabihf/liblzma.so.5 (0xb62cb000)
        libjbig.so.0 => /usr/lib/arm-linux-gnueabihf/libjbig.so.0 (0xb62ae000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0xb6298000)
        libvcos.so => /opt/vc/lib/libvcos.so (0xb627f000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6268000)
        libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb6227000)
        libuuid.so.1 => /lib/arm-linux-gnueabihf/libuuid.so.1 (0xb6210000)
        libevdev.so.2 => /usr/lib/arm-linux-gnueabihf/libevdev.so.2 (0xb61f0000)
        libwacom.so.2 => /usr/lib/arm-linux-gnueabihf/libwacom.so.2 (0xb61d7000)
        libsystemd.so.0 => /lib/arm-linux-gnueabihf/libsystemd.so.0 (0xb613a000)
        libGLdispatch.so.0 => /usr/lib/arm-linux-gnueabihf/libGLdispatch.so.0 (0xb60bb000)
        libgraphite2.so.3 => /usr/lib/arm-linux-gnueabihf/libgraphite2.so.3 (0xb608a000)
        libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb6013000)
        libgudev-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgudev-1.0.so.0 (0xb5ffa000)
        libgobject-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0xb5f9d000)
        liblz4.so.1 => /usr/lib/arm-linux-gnueabihf/liblz4.so.1 (0xb5f71000)
        libgcrypt.so.20 => /lib/arm-linux-gnueabihf/libgcrypt.so.20 (0xb5e97000)
        libgio-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0 (0xb5d1b000)
        libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0xb5d03000)
        libgpg-error.so.0 => /lib/arm-linux-gnueabihf/libgpg-error.so.0 (0xb5cd9000)
        libgmodule-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgmodule-2.0.so.0 (0xb5cc5000)
        libmount.so.1 => /lib/arm-linux-gnueabihf/libmount.so.1 (0xb5c64000)
        libselinux.so.1 => /lib/arm-linux-gnueabihf/libselinux.so.1 (0xb5c32000)
        libresolv.so.2 => /lib/arm-linux-gnueabihf/libresolv.so.2 (0xb5c0e000)
        libblkid.so.1 => /lib/arm-linux-gnueabihf/libblkid.so.1 (0xb5bb6000)
ldd -r <myapp> returns same result, so I guess all libs are in place.

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Thu Apr 09, 2020 10:15 pm

libEGL.so.1 => /usr/lib/arm-linux-gnueabihf/libEGL.so.1 (0xb6b5a000)
libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0xb6801000)
My theory ( I will happily admit that this is based on old information ) is that there are other versions of these libaries somewhere under "/opt/vc" that should be used instead when using EGLFS on older Pi models.

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Thu Apr 09, 2020 10:21 pm

Code: Select all

cd /opt/vc/lib
sudo ln -s libbrcmEGL.so libEGL.so.1
sudo ln -s libbrcmGLESv2.so libGLESv2.so.2
export LD_LIBRARY_PATH=/opt/vc/lib
Now if you do a new "ldd" hopefully you should see new paths and you can try to run you app again..

BortEngineer
Posts: 4
Joined: Tue Apr 07, 2020 1:47 pm

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Fri Apr 10, 2020 11:43 am

Yes, spot-on! Your suggestion fixed the issue.

Now i'm trying to make it permanent and system-wide with ldconfig, but ldconfig does not want to follow Your symlinks. /opt/vc/lib exists in /etc/ld.so.conf.d/00-vmcs.conf, this conf works for all libs in /opt/vc/lib, except symlinked ones. So, how to force ldconfig to use symlinks? In particular, how to modify /etc/ld.so.conf.d/00-vmcs.conf so ldconfig would accept symlinks?

swampdog
Posts: 1127
Joined: Fri Dec 04, 2015 11:22 am

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Wed Apr 15, 2020 9:43 pm

If this has boiled down to an 'ldconfig' issue you may be having an "LD_LIBRARY_PATH problem" - 'ldd' respects that so results can differ depending on it. That is, without it set correctly 'ldd' may erroneously pick a system lib instead of yours.

In my case, I rarely produce an "official" package (.deb/.rpm etc) because what I used to be asked to build used to be "updates" to existing packages and thus do not want to use 'ldconfig' either. Instead..

Code: Select all

foo@sdu /kvm $ cat /usr/local/sd/bin/sd-qt
#!/bin/bash

PATH=/usr/local/QT/5.12.5/bin:$PATH \
LD_LIBRARY_PATH=/usr/local/QT/5.12.5/lib64:/usr/local/QT/5.12.5/lib32:/usr/local/QT/5.12.5/lib:/usr/local/QT/5.12.5/lib/qtcreator \
LLVM_INSTALL_DIR=/usr/local/QT/5.12.5 \
QTC_ENABLE_LIBTOOLING=1 \
QTDIR=/usr/local/QT/5.12.5 \
MANPATH=/usr/local/QT/5.12.5/share/man \
INFOPATH=/usr/local/QT/5.12.5/share/info \
"$@"
I'm not sure all the above is required (the Qt docs can be confusing, especially across versions).

In essence, whenever I want to invoke a 5.12.5 app I use "sd-qt [appname]" and the correct things are found without impacting the system in any way. Obviously you'd replace "$@" with your app name. You can see something similar happening in 'qtcreator.sh' if you've ever built it. You'll be able to call 'qtcreator' directly if you've got the above correct.

Note the above is from my PC. It's the same on an rpi however. I'm using the PC example because it does use a symlink but only in one place: the installation directory..

Code: Select all

foo@sdu /kvm $ lc /usr/local/QT/
total 8
lrwxrwxrwx  1 root root    5 Feb 15 05:14 5.12.5 -> 5125r
drwxr-xr-x  2 foo  foo  4096 Mar 22 08:49 5125d
drwxr-xr-x 24 root root 4096 Feb 14 21:48 5125r
5125r is a normal (release) build whereas 5125d is same but with debug. Both are built and install to /usr/local/QT/5.12.5/ and all I do is rename the target folder then point the symlink to one of them. I do it this way because with a complex build like Qt you can never be certain there isn't a hard coded path in there - plus I build a load of other stuff before Qt.

You wouldn't need that lengthy LD_LIBRARY_PATH above just for the pi. It's just that particular search arrangement works for the PC and an rpi and saves my build script having to specifically having to check which target it is building for (and should also work if ever a 64bit rasbian comes along).

H0rBie
Posts: 1
Joined: Sun Apr 26, 2020 10:36 am

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Sun Apr 26, 2020 10:51 am

Hello,

I have the same issue, but only when I try to run my binary from ssh command line or via Qt Creator. Starting the binary on the Pi itself works from command line and by clicking it in file browser. I have a HDMI-Touch screen connected to the Raspberry Pi. I remember that I had everything configured fine before where I was able to run the binaries remotely from Qt Creator (inclusive remote debugging via gdb) and from ssh command line. Think it was Raspian Jessie and Qt 5.11.x.

I tried Qt 5.12.5 and 5.12.8. with dynamic linking on Raspbian Buster. For me it feels more like a misconfiguration in the display management or search paths looked for when logged into the Pi remotely in my case.

I tried all things I found on the internet but nothing seems to work. Any more ideas?

Cheers

swampdog
Posts: 1127
Joined: Fri Dec 04, 2015 11:22 am

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Fri May 08, 2020 10:58 am

I get this when I ssh (-X or -Y) into my pi and run qtcreator..

Code: Select all

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
..and two plugin loader messages in a dialog "QmlDesigner" "QmlProfiler" - "Plugin initialization failed: Cannot create OpenGL context".

I've assumed this is because OpenGL doesn't work across 'ssh'. I could easily, of course, be wrong because graphics is not my thing.

binu_ji
Posts: 2
Joined: Mon Jun 08, 2020 2:54 pm

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Tue Jul 07, 2020 12:11 pm

topguy wrote:
Thu Apr 09, 2020 10:21 pm

Code: Select all

cd /opt/vc/lib
sudo ln -s libbrcmEGL.so libEGL.so.1
sudo ln -s libbrcmGLESv2.so libGLESv2.so.2
export LD_LIBRARY_PATH=/opt/vc/lib
Now if you do a new "ldd" hopefully you should see new paths and you can try to run you app again..
Hi i am also sufferring from this error. Tried all the above methods.
i am using Raspberry Pi Zero W running Raspbian buster lite latest version.

This is my ldd output of my app

Code: Select all

	/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so (0xb6ecd000)
	libwiringPi.so => /usr/lib/libwiringPi.so (0xb6e9c000)
	libQt5Svg.so.5 => /usr/local/qt5pi/lib/libQt5Svg.so.5 (0xb6e4c000)
	libQt5Widgets.so.5 => /usr/local/qt5pi/lib/libQt5Widgets.so.5 (0xb691f000)
	libQt5Gui.so.5 => /usr/local/qt5pi/lib/libQt5Gui.so.5 (0xb649a000)
	libQt5SerialPort.so.5 => /usr/local/qt5pi/lib/libQt5SerialPort.so.5 (0xb647d000)
	libQt5Xml.so.5 => /usr/local/qt5pi/lib/libQt5Xml.so.5 (0xb644c000)
	libQt5Core.so.5 => /usr/local/qt5pi/lib/libQt5Core.so.5 (0xb5f3e000)
	libGLESv2.so.2 => /opt/vc/lib/libGLESv2.so.2 (0xb5f19000)
	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb5eef000)
	libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb5da8000)
	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb5d26000)
	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb5cf9000)
	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb5bab000)
	librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb5b94000)
	libcrypt.so.1 => /lib/arm-linux-gnueabihf/libcrypt.so.1 (0xb5b54000)
	libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb5b29000)
	libpng16.so.16 => /usr/lib/arm-linux-gnueabihf/libpng16.so.16 (0xb5aed000)
	libharfbuzz.so.0 => /usr/lib/arm-linux-gnueabihf/libharfbuzz.so.0 (0xb59ef000)
	libudev.so.1 => /lib/arm-linux-gnueabihf/libudev.so.1 (0xb59bf000)
	libpcre2-16.so.0 => /usr/lib/arm-linux-gnueabihf/libpcre2-16.so.0 (0xb5943000)
	libdouble-conversion.so.1 => /usr/lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0xb591f000)
	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb590c000)
	libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0xb58fa000)
	libglib-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb57ea000)
	/lib/ld-linux-armhf.so.3 (0xb6ee0000)
	libEGL.so => /opt/vc/lib/libEGL.so (0xb57b1000)
	libbcm_host.so => /opt/vc/lib/libbcm_host.so (0xb5787000)
	libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0xb5771000)
	libvcos.so => /opt/vc/lib/libvcos.so (0xb5758000)
	libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb56b5000)
	libgraphite2.so.3 => /usr/lib/arm-linux-gnueabihf/libgraphite2.so.3 (0xb5684000)
	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb560d000)
i already aloted 128MB for my gpu.

My error message
Could not initialize egl display
17:31:05: Remote process crashed.

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Tue Jul 07, 2020 2:03 pm

17:31:05: Remote process crashed.
So how exactly are you running your program ?
Is it running as the "pi" user ?

binu_ji
Posts: 2
Joined: Mon Jun 08, 2020 2:54 pm

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Tue Jul 07, 2020 2:36 pm

Thanks for your reply. yes i login as pi user
i am running from qt creator.
and this is my kits page
Screenshot from 2020-07-07 20-05-25.png
Screenshot from 2020-07-07 20-05-25.png (175.03 KiB) Viewed 12353 times
But the same program runs on desktop version of raspian.
only the error is on the raspian lite version.

This screenshot would help
Screenshot from 2020-07-07 21-12-10.jpg
Screenshot from 2020-07-07 21-12-10.jpg (48.29 KiB) Viewed 12334 times

kuldeepsmann
Posts: 5
Joined: Fri May 22, 2020 7:07 am

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Sat Mar 06, 2021 12:22 am

Hi

I was able to build a eglfs image for Pi 4 using Yocto and Qt 5.15, you can have a look at the video tutorial and blog if it is of any help.

https://youtu.be/rTp2zTAXZgY
https://everythingembedded.blogspot.com/

It is a 32 bit image, you can download it as well to try it out.

Cheers

AndreaCassigoli
Posts: 2
Joined: Wed May 05, 2021 9:00 am

Re: Qt5 and RPi EGLFS: Could not initialize egl display

Wed May 05, 2021 9:10 am

Hi all,
I'm cross-compiling a Qt application using a Ubuntu 20.04 LTS on Virtual Machine and a Raspberry compute module 3+ (version 2018).
I'm using Qt 5.12.
I solved this problem with the following the suggestions by the official guide:

https://wiki.qt.io/RaspberryPi2EGLFS

I had only to change the libEGL.so.1.0.0 version: in my case it was not libEGL.so.1.0.0 but libEGL.so.1.1.0.

So I launched on RPi the following commands:

Code: Select all

export QT_QPA_PLATFORM=eglfs
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/qt5pi/plugins/platforms
export LD_LIBRARY_PATH=/usr/local/qt5pi/lib

Code: Select all

sudo mv /usr/lib/arm-linux-gnueabihf/libEGL.so.1.1.0 /usr/lib/arm-linux-gnueabihf/libEGL.so.1.1.0_backup
sudo mv /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.1.0 /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.1.0_backup
sudo ln -s /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.1.0
sudo ln -s /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.1.0
sudo ln -s /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libEGL.so
sudo ln -s /opt/vc/lib/libbrcmGLESv2.so /opt/vc/lib/libGLESv2.so

Return to “Advanced users”