Cross-compiled QtWebengine raises EGL_BAD_CONTEXT error on Arm64
-
Hello,
I ported a QtQuick QtWebengine based app that works very well on x86_64 for an aarch64 SBC. After cross-compilation and deployment, every aspect of the app like QtWindow QtControl, Images, etc worked fine
but failed to load QtWebengine.
When I run:webengine_app -platform eglfs
I got multiple repeats of this error message on my ssh terminal, then it hangs:
[3844:3875:0218/130036.767422:ERROR:gl_context_egl.cc(199)] eglCreateContext failed with error EGL_BAD_CONTEXT [3844:3875:0218/130036.767638:ERROR:gles2_command_buffer_stub.cc(262)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
I tested a fresh Webengine example: Qt Quick Minimal but got the same error messages. Other non-webengine examples like QtQuick Clock Example worked.
My Arm64 Spec:
-
Qt version is 5.12.7 on Ubuntu Server 18.4.3
-
RockChip rk3399 Dual Cortex-A72 + Quad Cortex-A53, 64-bit CPU
-
Graphics: Mali-T864 GPU, OpenGL ES1.1/2.0/3.0/3.1, OpenCL, DX11
-
Memory: 2GB Ram, 16GB EEMC
Configuration for compilation:
~/amboxQt/qt-everywhere-src-5.12.7/configure -opengl es2 -eglfs -no-xcb \ -shared -c++std c++14 -v \ -opensource -release --confirm-license \ -device linux-khadas-edge-g++ \ -device-option CROSS_COMPILE=$HOME/amboxQt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- \ -sysroot $HOME/amboxQt/rootfs \ -nomake examples -nomake tests -no-use-gold-linker \ -prefix /usr/local/amqt-5127-egl \ -extprefix $HOME/amboxQt/amqt-5127-egl \ -hostprefix $HOME/amboxQt/amqt5127-egl-host \ -skip qtlocation -skip qtscript -skip qtpurchasing \ -skip qttranslations -skip qtvirtualkeyboard -skip qt3d \ -skip qtgamepad -skip qtcharts -skip qtconnectivity \ -skip qtdatavis3d -skip qtsensors -skip qtspeech \ -skip qtwebview -skip qtscxml -skip qtxmlpatterns \ -skip qtandroidextras -skip qtcanvas3d \ -skip qtmacextras -skip qtwinextras -skip qtwayland
Config Summary:
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: devices/linux-khadas-edge-g++ (arm64, CPU features: neon) Target compiler: gcc 7.4.1 Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 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++14 Using ccache ........................... no Using gold linker ...................... no Using new DTAGS ........................ yes Using precompiled headers .............. yes 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 ................................. no 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 ...................... yes EGLFS GBM ............................ yes EGLFS VSP2 ........................... no EGLFS Mali ........................... no EGLFS Raspberry Pi ................... no 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 ................................ no 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 Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch 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 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 ......... yes 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 .................. yes lcms2 ................................ no png .................................. yes JPEG ................................. yes harfbuzz ............................. yes freetype ............................. yes Required system libraries: fontconfig ........................... yes dbus ................................. yes nss .................................. yes khr .................................. yes glibc ................................ yes Required system libraries for qpa-xcb: x11 .................................. no libdrm ............................... yes 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/uzisky/amboxQt/rootfs/usr/lib/pkgconfig:/home/uzisky/amboxQt/rootfs/usr/share/pkgconfig:/home/uzisky/amboxQt/rootfs/usr/lib/aarch64-linux-gnu/pkgconfig Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/uzisky/amboxQt/rootfs 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.
Please, how can I fix this or what are the tried and tested way to make QtWebengine work on Arm64?
-