This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

QtWebEngine code crashing on AM437x-EVM

We are using Qt 5.6.3 and we have integrated QtWebEngine. We have created a small Qt application to display HTML page. When we execute it on target (TI AM437X-EVM) application crashes with error as below

ERROR:gl_surface_qt.cpp(477)] eglCreatePbufferSurface failed with error EGL_BAD_MATCH
ERROR:gl_surface_qt.cpp(622)] Requested OpenGL platform is not supported.
Illegal instruction

We have Linux image and SDK build with Yocto including Qt 5.6.3 along with opengl es2. We have removed X11 and Wayland from the image. We are able to build QtWebEngine and QtWebSockets. But the application throws error and doesn't work.

  • Here is the debug log

    qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_kms_egldevice", "eglfs_kms")
    qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms", "eglfs_kms_egldevice")
    qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms"
    qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms"
    qt.qpa.eglfs.kms: Loading KMS setup from "/etc/qt5/eglfs_kms_cfg.json"
    qt.qpa.eglfs.kms: Configuration:
    hwcursor: false
    pbuffers: true
    separateScreens: false
    outputs: QMap()
    qt.qpa.eglfs.kms: Using DRM device "/dev/dri/card0" specified in config file
    qt.qpa.eglfs.kms: Opening device "/dev/dri/card0"
    qt.qpa.eglfs.kms: Creating GBM device for file descriptor 4 obtained from "/dev/dri/card0"
    qt.qpa.eglfs.kms: "UNKNOWN1" mode count: 1
    qt.qpa.eglfs.kms: mode 0 800 x 480 @ 60 hz
    qt.qpa.eglfs.kms: Selected mode 0 : 800 x 480 @ 60 hz for output "UNKNOWN1"
    qt.qpa.input: evdevkeyboard: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags(0x8)
    qt.qpa.input: Found matching devices ("/dev/input/event1")
    qt.qpa.input: Adding keyboard at "/dev/input/event1"
    qt.qpa.input: Try to create keyboard handler for "/dev/input/event1" ""
    qt.qpa.input: Opening keyboard at "/dev/input/event1"
    qt.qpa.input: Create keyboard handler with for device "/dev/input/event1"
    qt.qpa.input: Unload current keymap and restore built-in
    qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
    qt.qpa.input: evdevmouse: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags(0x1|0x2)
    qt.qpa.input: Found matching devices ()
    qt.qpa.input: evdevtouch: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags(0x2|0x4)
    qt.qpa.input: Found matching devices ("/dev/input/event0")
    qt.qpa.input: evdevtouch: Adding device at "/dev/input/event0"
    qt.qpa.input: evdevtouch: Using device /dev/input/event0
    Created context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize -1, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior 2, swapInterval 1, profile 0) with config:
    qt.qpa.input: evdevtouch: /dev/input/event0: Protocol type B (multi)
    qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: 1023
    qt.qpa.input: evdevtouch: /dev/input/event0: min Y: 0 max Y: 599
    qt.qpa.input: evdevtouch: /dev/input/event0: min pressure: 0 max pressure: 0
    qt.qpa.input: evdevtouch: /dev/input/event0: device name: pixcir_tangoc
    EGL_BUFFER_SIZE: 24
    EGL_ALPHA_SIZE: 0
    EGL_BLUE_SIZE: 8
    EGL_GREEN_SIZE: 8
    EGL_RED_SIZE: 8
    EGL_DEPTH_SIZE: 0
    EGL_STENCIL_SIZE: 0
    EGL_CONFIG_CAVEAT: 12344
    EGL_CONFIG_ID: 5
    EGL_LEVEL: 0
    EGL_MAX_PBUFFER_HEIGHT: 0
    EGL_MAX_PBUFFER_PIXELS: 0
    EGL_MAX_PBUFFER_WIDTH: 0
    EGL_NATIVE_RENDERABLE: 1
    EGL_NATIVE_VISUAL_ID: 875713112
    EGL_NATIVE_VISUAL_TYPE: 12344
    EGL_SAMPLES: 0
    EGL_SAMPLE_BUFFERS: 0
    EGL_SURFACE_TYPE: 4
    EGL_TRANSPARENT_TYPE: 12344
    EGL_TRANSPARENT_BLUE_VALUE: 0
    EGL_TRANSPARENT_GREEN_VALUE: 0
    EGL_TRANSPARENT_RED_VALUE: 0
    EGL_BIND_TO_TEXTURE_RGB: 0
    EGL_BIND_TO_TEXTURE_RGBA: 0
    EGL_MIN_SWAP_INTERVAL: 1
    EGL_MAX_SWAP_INTERVAL: 1
    Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
    qt.scenegraph.general: threaded render loop
    qt.scenegraph.general: Using sg animation driver
    qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
    qt.qpa.eglfs.kms: Creating window for screen "UNKNOWN1"
    Created context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 1, profile 1) with config:
    EGL_BUFFER_SIZE: 24
    EGL_ALPHA_SIZE: 0
    EGL_BLUE_SIZE: 8
    EGL_GREEN_SIZE: 8
    EGL_RED_SIZE: 8
    EGL_DEPTH_SIZE: 24
    EGL_STENCIL_SIZE: 8
    EGL_CONFIG_CAVEAT: 12344
    EGL_CONFIG_ID: 7
    EGL_LEVEL: 0
    EGL_MAX_PBUFFER_HEIGHT: 0
    EGL_MAX_PBUFFER_PIXELS: 0
    EGL_MAX_PBUFFER_WIDTH: 0
    EGL_NATIVE_RENDERABLE: 1
    EGL_NATIVE_VISUAL_ID: 875713112
    EGL_NATIVE_VISUAL_TYPE: 12344
    EGL_SAMPLES: 0
    EGL_SAMPLE_BUFFERS: 0
    EGL_SURFACE_TYPE: 4
    EGL_TRANSPARENT_TYPE: 12344
    EGL_TRANSPARENT_BLUE_VALUE: 0
    EGL_TRANSPARENT_GREEN_VALUE: 0
    EGL_TRANSPARENT_RED_VALUE: 0
    EGL_BIND_TO_TEXTURE_RGB: 0
    EGL_BIND_TO_TEXTURE_RGBA: 0
    EGL_MIN_SWAP_INTERVAL: 1
    EGL_MAX_SWAP_INTERVAL: 1
    qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
    qt.scenegraph.general: texture atlas dimensions: 1024x512
    qt.scenegraph.general: R/G/B/A Buffers: 8 8 8 0
    qt.scenegraph.general: Depth Buffer: 24
    qt.scenegraph.general: Stencil Buffer: 8
    qt.scenegraph.general: Samples: 0
    qt.scenegraph.general: GL_VENDOR: Imagination Technologies
    qt.scenegraph.general: GL_RENDERER: PowerVR SGX 530
    qt.scenegraph.general: GL_VERSION: OpenGL ES 2.0 build 1.17@4948957
    qt.scenegraph.general: GL_EXTENSIONS: GL_OES_fbo_render_mipmap GL_OES_vertex_array_object GL_IMG_texture_compression_pvrtc GL_OES_egl_sync GL_OES_texture_half_float GL_EXT_shader_texture_lod GL_OES_mapbuffer GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_surfaceless_context GL_OES_EGL_image GL_IMG_texture_format_BGRA8888 GL_IMG_texture_npot GL_OES_compressed_ETC1_RGB8_texture GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_standard_derivatives GL_IMG_shader_binary GL_IMG_read_format GL_EXT_texture_format_BGRA8888 GL_EXT_texture_storage GL_IMG_program_binary GL_IMG_uniform_buffer_object GL_OES_element_index_uint GL_OES_packed_depth_stencil GL_EXT_blend_minmax GL_OES_texture_float GL_OES_vertex_half_float GL_EXT_multi_draw_arrays GL_EXT_multisampled_render_to_texture GL_OES_depth_texture GL_OES_required_internalformat GL_IMG_multisampled_render_to_texture GL_EXT_texture_rg GL_KHR_debug
    qt.scenegraph.general: Max Texture Size: 2048
    qt.scenegraph.general: Debug context: false
    qt.qpa.input: evdevtouch: Updating QInputDeviceManager device count: 1 touch devices, 0 pending handler(s)
    [0420/004526:ERROR:gl_surface_qt.cpp(477)] eglCreatePbufferSurface failed with error EGL_BAD_MATCH
    [0420/004526:ERROR:gl_surface_qt.cpp(622)] Requested OpenGL platform is not supported.

    I see value of PBUFFER parameters is zero. Probably that is the reason for EGL_BAD_MATCH. I am not able to change that value..  

  • Hello,

    I am wondering if you could please try the same test on PSDK6.3.

    Ref. Link: https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM437X#release-notes

    Regards,
    Krunal

  • I downloaded TI SDK and rootfs.. Ran sample codes provided by TI rootfs.. Re-compiled my qtwebengine application and ran it on target.. It is working..  

  • One difference is TI is using wayland and we are not.. I will build wayland and integrate it with my rootfs and try it.. 

  • Hello,

    I am wondering if you could please disable weston using the command "/etc/init.d/weston stop". Next, launch Qt app with the "-platform eglfs". Please give it a try before rebuilding the rootfs.

    Regards,
    Krunal

  • We do not have weston in our image. And we are launching Qt app with -platform eglfs.. 

  • Hello,

    On PSDK6.3, there is a bug that causes CPU usage to increase while launching a Qt application. I would recommend you to remove the following patch from Yocto "0001-eglfs_kms-enhance-the-QPA-for-multiple-display-and-u.patch" and rebuild the Qt package.

    Regards,
    Krunal

  • I did not see  "0001-eglfs_kms-enhance-the-QPA-for-multiple-display-and-u.patch" patch applied for Qt 5.6.3. Also are you using Qt Quick 2D renderer and scenegraph plugin? I rebuild my image with scenegraph plugin and I am able to render HTML application. As per my understanding it skips opengl. 

  • I did not see  "0001-eglfs_kms-enhance-the-QPA-for-multiple-display-and-u.patch" patch applied for Qt 5.6.3. Also are you using Qt Quick 2D renderer and scenegraph plugin? I rebuild my image with scenegraph plugin and I am able to render HTML application. As per my understanding it skips opengl. 

  • Hello,

    The above patch is present on Qt5.11 and I would recommend you to check with Qt if QtQuick/Scenegraph utilizes the opengles.

    Regards,
    Krunal