i.mx8mp GPU and GTK4 app: GUI/window present delay and blocking Vivante /dev/galcore ioctl

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx8mp GPU and GTK4 app: GUI/window present delay and blocking Vivante /dev/galcore ioctl

160 Views
jim777
Contributor II
GTK4 Window Startup Delay (~10s) on i.MX8MP with Vivante GPU
When using the default GTK4 GL renderer:
gtk_window_present(window);​
takes approximately 9-10 seconds before the window becomes visible.

The evidence (see attached file) strongly suggests that the startup delay is not caused by GTK application code.

The delay appears correlated with a blocking Vivante /dev/galcore ioctl within the GL rendering path. Software rendering (GSK_RENDERER=cairo) avoids the issue.

We are looking for guidance on known issues, debugging methods, configuration changes, or fixes for GTK4/OpenGL startup latency on i.MX8MP with the Vivante GPU stack.

0 Kudos
Reply
2 Replies

138 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @jim777 

Thank you for sharing such detailed information. Could you provide a minimal, reproducible GTK4 source code example? I need to conduct further testing in the NXP BSP.

Best Regards,
Zhiming

0 Kudos
Reply

127 Views
jim777
Contributor II

Hi Zhiming,

Thanks for your quick response!

Attached is a small skeleton but complete source file to test.
and the environment variables set before running:

#!/bin/sh
export XDG_RUNTIME_DIR=/run/user/0
export WAYLAND_DISPLAY=wayland-1
export GDK_BACKEND=wayland
export GSK_RENDERER=gl

 the relevant from weston.ini:

root@nitrogen8mp:~# cat /etc/xdg/weston/weston.ini
[core]
#gbm-format=argb8888
use-g2d=true
repaint-window=16
idle-time=0
xwayland=true
#enable-overlay-view=1

[shell]
panel-position=none

[libinput]
touchscreen_calibrator=true

#[output]
#name=HDMI-A-1
#mode=1920x1080@60
#transform=rotate-90

#[output]
#name=HDMI-A-2
#mode=off
#       WIDTHxHEIGHT    Resolution size width and height in pixels
#       off             Disables the output
#       preferred       Uses the preferred mode
#       current         Uses the current crt controller mode
#transform=rotate-90

[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
#start-on-startup=true

[input-method]
path=/usr/libexec/ibus-wayland


the running time for the gtk_window_present on a desktop w/o GPU support takes some hundreds msec (< 1sec); and on the i.mx8mp device takes 9970 ms :

root@nitrogen8mp:~# gtk4-test
A: activate: before _present: 47333 ms
B: activate: after _present: 57303 ms, takes: 9970 ms
C: activate: after idele_add: 57303 ms
D: startup_task_cb: 57315 ms
^C
root@nitrogen8mp:~#


I have tried render: ngl, which leads to smear image/widgetrs/video, and Vulkan leads to critical errors: Loader Message: vkCreateDevice: Failed to validate extensions in list; Failed to realize renderer of type ‘GskVulkanRenderer’ for surface ‘GdkWaylandToplevel’: Could not find a Vulkan device with the required features.

Since out app need GPU support, and the recommended renderer under wayland/weston is still gl (UG10159  11.3.2.1 GL renderer)   , I hope you can help to find a solution.

Best regards,





0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2411550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.mx8mp%20GPU%20and%20GTK4%20app%3A%20%20GUI%2Fwindow%20present%20delay%20and%20%20blocking%20Vivante%20%2Fdev%2Fgalcore%20ioctl%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2411550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3EGTK4%20Window%20Startup%20Delay%20(~10s)%20on%20i.MX8MP%20with%20Vivante%20GPU%3CBR%20%2F%3E%3CDIV%3EWhen%20using%20the%20default%20GTK4%20GL%20renderer%3A%3C%2FDIV%3E%3C%2FDIV%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Egtk_window_present(window)%3B%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3CDIV%3Etakes%20approximately%20%3CSTRONG%3E9-10%20seconds%20before%20the%20window%20becomes%20visible%3C%2FSTRONG%3E.%3C%2FDIV%3E%3CDIV%3E%3CP%3EThe%20evidence%20(%3CSTRONG%3Esee%20attached%20file%3C%2FSTRONG%3E)%20strongly%20suggests%20that%20the%20startup%20delay%20is%20not%20caused%20by%20GTK%20application%20code.%3C%2FP%3E%3CP%3EThe%20delay%20appears%20correlated%20with%20a%20blocking%20Vivante%20%2Fdev%2Fgalcore%20ioctl%20within%20the%20GL%20rendering%20path.%20Software%20rendering%20(GSK_RENDERER%3Dcairo)%20avoids%20the%20issue.%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20are%20looking%20for%20%3CEM%3E%3CSTRONG%3Eguidance%3C%2FSTRONG%3E%3C%2FEM%3E%20on%20known%20issues%2C%20debugging%20methods%2C%20configuration%20changes%2C%20or%20fixes%20for%20GTK4%2FOpenGL%20startup%20latency%20on%20i.MX8MP%20with%20the%20Vivante%20GPU%20stack.%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2411605%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20i.mx8mp%20GPU%20and%20GTK4%20app%3A%20%20GUI%2Fwindow%20present%20delay%20and%20%20blocking%20Vivante%20%2Fdev%2Fgalcore%20ioctl%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2411605%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F247983%22%20target%3D%22_blank%22%3E%40jim777%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20for%20sharing%20such%20detailed%20information.%20Could%20you%20provide%20a%20minimal%2C%20reproducible%20GTK4%20source%20code%20example%3F%20I%20need%20to%20conduct%20further%20testing%20in%20the%20NXP%20BSP.%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2411760%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20i.mx8mp%20GPU%20and%20GTK4%20app%3A%20%20GUI%2Fwindow%20present%20delay%20and%20%20blocking%20Vivante%20%2Fdev%2Fgalcore%20ioctl%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2411760%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Zhiming%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20quick%20response!%3CBR%20%2F%3E%3CBR%20%2F%3EAttached%20is%20a%20small%20skeleton%20but%20complete%20source%20file%20to%20test.%3CBR%20%2F%3Eand%20the%20environment%20variables%20set%20before%20running%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%23!%2Fbin%2Fsh%0Aexport%20XDG_RUNTIME_DIR%3D%2Frun%2Fuser%2F0%0Aexport%20WAYLAND_DISPLAY%3Dwayland-1%0Aexport%20GDK_BACKEND%3Dwayland%0Aexport%20GSK_RENDERER%3Dgl%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3Bthe%20relevant%20from%20weston.ini%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Eroot%40nitrogen8mp%3A~%23%20cat%20%2Fetc%2Fxdg%2Fweston%2Fweston.ini%0A%5Bcore%5D%0A%23gbm-format%3Dargb8888%0Ause-g2d%3Dtrue%0Arepaint-window%3D16%0Aidle-time%3D0%0Axwayland%3Dtrue%0A%23enable-overlay-view%3D1%0A%0A%5Bshell%5D%0Apanel-position%3Dnone%0A%0A%5Blibinput%5D%0Atouchscreen_calibrator%3Dtrue%0A%0A%23%5Boutput%5D%0A%23name%3DHDMI-A-1%0A%23mode%3D1920x1080%4060%0A%23transform%3Drotate-90%0A%0A%23%5Boutput%5D%0A%23name%3DHDMI-A-2%0A%23mode%3Doff%0A%23%20%20%20%20%20%20%20WIDTHxHEIGHT%20%20%20%20Resolution%20size%20width%20and%20height%20in%20pixels%0A%23%20%20%20%20%20%20%20off%20%20%20%20%20%20%20%20%20%20%20%20%20Disables%20the%20output%0A%23%20%20%20%20%20%20%20preferred%20%20%20%20%20%20%20Uses%20the%20preferred%20mode%0A%23%20%20%20%20%20%20%20current%20%20%20%20%20%20%20%20%20Uses%20the%20current%20crt%20controller%20mode%0A%23transform%3Drotate-90%0A%0A%5Bscreen-share%5D%0Acommand%3D%2Fusr%2Fbin%2Fweston%20--backend%3Drdp-backend.so%20--shell%3Dfullscreen-shell.so%20--no-clients-resize%0A%23start-on-startup%3Dtrue%0A%0A%5Binput-method%5D%0Apath%3D%2Fusr%2Flibexec%2Fibus-wayland%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3Ethe%20running%20time%20for%20the%20gtk_window_present%20on%20a%20desktop%20w%2Fo%20GPU%20support%20takes%20some%20hundreds%20msec%20(%26lt%3B%201sec)%3B%20and%20on%20the%20i.mx8mp%20device%20takes%26nbsp%3B9970%20ms%20%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Eroot%40nitrogen8mp%3A~%23%20gtk4-test%0AA%3A%20activate%3A%20before%20_present%3A%2047333%20ms%0AB%3A%20activate%3A%20after%20_present%3A%2057303%20ms%2C%20takes%3A%209970%20ms%0AC%3A%20activate%3A%20after%20idele_add%3A%2057303%20ms%0AD%3A%20startup_task_cb%3A%2057315%20ms%0A%5EC%0Aroot%40nitrogen8mp%3A~%23%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3EI%20have%20tried%20render%3A%20ngl%2C%20which%20leads%20to%20smear%20image%2Fwidgetrs%2Fvideo%2C%20and%20%3CSPAN%3EVulkan%20leads%20to%20critical%20errors%3A%26nbsp%3BLoader%20Message%3A%20vkCreateDevice%3A%20Failed%20to%20validate%20extensions%20in%20list%3B%26nbsp%3BFailed%20to%20realize%20renderer%20of%20type%20%E2%80%98GskVulkanRenderer%E2%80%99%20for%20surface%20%E2%80%98GdkWaylandToplevel%E2%80%99%3A%20Could%20not%20find%20a%20Vulkan%20device%20with%20the%20required%20features.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3ESince%20out%20app%20need%20GPU%20support%2C%20and%20the%20recommended%20renderer%20under%20wayland%2Fweston%20is%20still%20gl%20(UG10159%26nbsp%3B%2011.3.2.1%20GL%20renderer)%26nbsp%3B%20%26nbsp%3B%2C%20I%20hope%20you%20can%20help%20to%20find%20a%20solution.%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20regards%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E