EGLFS Issues with 3D Rendering on i.MX8

I am currently working on a Qt-based application running on a system with an i.MX8 (Apalis) board, using EGLFS as the display platform. The application utilizes 3D graphics, but I am encountering an issue where **3D images are rendered with shadows the gradiation of the black colour are obvious they suppose to make a 3d effect **
this part of the service launching the qt app

Environment=QT_QPA_PLATFORM=eglfs
Environment=QT_QPA_EGLFS_INTEGRATION=eglfs_viv
Environment=QT_QPA_EGLFS_FORCE888=1
Environment=QT_QPA_EGLFS_DEPTH=32
Environment=QT_QPA_EGLFS_FORCEVSYNC=1
#Environment=QT_QPA_EGLFS_DEBUG=1
#Environment=QSG_INFO=1
#Environment=QT_DEBUG_PLUGINS=1
Environment=XDG_RUNTIME_DIR=/tmp/runtime-root

i also did this in layer.conf i added DISTRO_FEATURES : remove = " x11"
in qtbase_git.bbappend i added

# Enable eglfs support in Qt
PACKAGECONFIG:append = " eglfs gles2"

here are some logs

root@apalis-imx8-recovery-mode:~# cat pixii.log | grep -Ei "opengl|egl|qsg|glcontext"
Apr 28 17:42:26 apalis-imx8-recovery-mode Pixii_App_1[244]: EGLFS: Failed to open /dev/fb0
Apr 28 17:42:26 apalis-imx8-recovery-mode Pixii_App_1[244]: EGLFS: Can't continue without a display
Apr 28 17:42:27 apalis-imx8-recovery-mode systemd[1]: Stopped Launch Pixii App with EGLFS.
Apr 28 17:42:27 apalis-imx8-recovery-mode systemd[1]: Started Launch Pixii App with EGLFS.
Apr 28 18:06:10 apalis-imx8-recovery-mode Pixii_App_1[674]: qt.scenegraph.general: Loading backend opengl
Apr 28 18:06:10 apalis-imx8-recovery-mode Pixii_App_1[674]: Could not create scene graph context for backend 'opengl' - check that plugins are installed correctly in /usr/lib/plugins
Apr 28 18:06:10 apalis-imx8-recovery-mode Pixii_App_1[674]: qt.scenegraph.general: QSG: basic render loop
Apr 28 18:06:10 apalis-imx8-recovery-mode Pixii_App_1[674]: qt.scenegraph.general: opengl texture atlas dimensions: 1024x1024
Apr 28 18:06:10 apalis-imx8-recovery-mode Pixii_App_1[674]: qt.scenegraph.general: GL_VERSION:        OpenGL ES 3.2 V6.4.3.p4.398061
Apr 28 18:06:10 apalis-imx8-recovery-mode Pixii_App_1[674]: qt.scenegraph.general: GL_EXTENSIONS:     GL_ANDROID_extension_pack_es31a GL_EXT_blend_minmax GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_copy_image GL_EXT_discard_framebuffer GL_EXT_draw_buffers GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_frag_depth GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_multi_draw_arrays GL_EXT_multi_draw_indirect GL_EXT_multisampled_render_to_texture GL_EXT_primitive_bounding_box GL_EXT_read_format_bgra GL_EXT_robustness GL_EXT_sRGB GL_EXT_shader_implicit_conversions GL_EXT_shader_io_blocks GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_sRGB_decode GL_EXT_texture_type_2_10_10_10_REV GL_EXT_unpack_subimage GL_KHR_blend_equation_advanced GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_copy_image GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_get_program_binary GL_OES_gpu_shader5 GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_primitive_bounding_box GL_OES_required_internalformat GL_OES_rgb8_rgba8 GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_image_atomic GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_npot GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_vertex_array_object GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_VIV_direct_texture
root@apalis-imx8-recovery-mode:~# 

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

For the Apalis iMX8, the GPU supports OpenGL ES 3.1 and provides hardware acceleration for graphics. The recommended approach for utilizing graphics acceleration is to use OpenGL ES through a graphics framework like Qt.

Regarding your configuration:

  1. The error “Failed to open /dev/fb0” suggests a framebuffer issue. Your system should be using Wayland as the graphics backend since X11 support was dropped for i.MX 8 Series modules.

  2. In your layer configuration, instead of just removing X11, you should use:

    DISTRO_FEATURES_remove = "x11 wayland"
    
  3. For Qt applications on i.MX 8, ensure you have these dependencies in your build:

    IMAGE_INSTALL_append = " qtbase qtbase-fonts qtbase-plugins libxkbcommon"
    
  4. The i.MX 8QXP features a GC7000Lite Graphics Processing Unit that supports OpenGL ES 3.1. Your logs show OpenGL ES 3.2 is being used, which might cause rendering issues.

I recommend checking if all required Qt plugins are properly installed, as your logs indicate: “Could not create scene graph context for backend ‘opengl’ - check that plugins are installed correctly in /usr/lib/plugins”.

I hope this helps resolve your issue. If you have any more questions, feel free to ask.

Best regards,
Toradex AI Assistant.

Hello @rania,

Can you tell me more about your setup?
Which version of the Toradex BSP is your image based on?
Which version of Qt are you using?

Also, can you send me some pictures of the issue you see?
How are you rendering the 3D content? Using Qt3D or OpenGL directly?

Best Regards,
Bruno

Here are the details about my setup:
Board: Apalis iMX8QM
BSP : TDX Wayland with XWayland 5.7.2-devel-202304
Display Backend: EGLFS
Rendering: Using OpenGL ES 3.2 directly via Qt Quick / QML SceneGraph (not Qt3D)
Qt Version: Qt 5.15
Graphics Driver: Vivante GPU, initialized successfully — confirmed via dmesg:

[drm] Initialized vivante 1.0.0 20170808 for 80000000.imx8_gpu1_ss on minor 0

OpenGL ES Version: Confirmed via logs:

GL_VERSION: OpenGL ES 3.2 V6.4.3.p4.398061

SceneGraph Log Output:

qt.scenegraph.general: Loading backend opengl
qt.scenegraph.general: QSG: basic render loop
qt.scenegraph.general: GL_VERSION: OpenGL ES 3.2…

Plugin Issue:

Currently, under /usr/lib/plugins/scenegraph, I only have libqsgopenvgbackend.so, but OpenGL rendering seems active — the SceneGraph backend is reported as “opengl”, though I also get this warning:

Could not create scene graph context for backend ‘opengl’ - check that plugins are installed correctly in /usr/lib/plugins

Environment Variables:

I’m setting these:

QT_QPA_PLATFORM=eglfs
QT_OPENGL=es2
QSG_RENDER_LOOP=basic

Problem Description:

The application launches successfully, uses OpenGL ES 3.2, and renders most content — however, 3D images are not displaying expected shadows or lighting effects the shadow is showed as graduates colours black grey … There might be a fallback in rendering or a missing feature due to backend/plugin configuration.

i would like to send you pictures but they are not clear

Hello @rania,

Thanks for the clarification.

It is hard to understand the issue here.
Can you send me some pictures, even if they are not that clear?

Also, do you see the same problem when running your application via QtCreator on your development machine?

Best Regards,
Bruno

the problem wasn’t there when i used to work with wayland it only occurs after migrating to eglfs so yes i don’t see it either when running the app on my development machine

i tried to send you pictures but they literally show nothing

Hello @rania,

From your description of the issue, it could be due to some bug in the EGLFS platform plugin.
Therefore, I would recommend that you update your BSP to a more recent version.
The last version of BSP 5 was BSP 5.7.6, which is newer than the 5.7.2, which you are currently using.
Moving to the latest BSP 7 as a base would be recommended, as BSP 5 is EOL.

Best Regards,
Bruno