OSSystems / meta-browser

OpenEmbedded/Yocto BSP layer for Web Browsers
MIT License
184 stars 191 forks source link

HW acceleration on stm32mp1 #699

Open sedlalu2 opened 1 year ago

sedlalu2 commented 1 year ago

Hi, i am using stm32mp DK2 kit. I have built their latest ecosystem with Yocto and added chromium for testing. Compilation went just fine.

Weston interface boots up correctly after a start (desktop-shell.so). There are a few applications for GPU testing, which running without any problems either (weston-simple-egl,...).

Chromium on this setup also starts. But HW acceleration is not working correctly. I am lauching chromium with these arguments

--use-gl=egl --ozone-platform=wayland --no-sandbox

When I check chrome://gpu everything is disabled. So I added argument --in-process-gpu, then chrome://gpu shows that chromium is HW accelerated but I believe it is not really - when I monitor GPU usage during rendering CSS animated pages usage is very low, almost negligible (1-3 % permanently) - webGL is not working at all, and so on...

During the start error shows up:

[10152:10179:0307/111631.034638:ERROR:gl_display.cc(892)] EGL display query failed with error EGL_SUCCESS
[10152:10179:0307/111631.034893:ERROR:gl_display.cc(917)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[10152:10179:0307/111631.035007:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.

And these errors come up everytime GPU should be used (loading webGL page for example)

[10152:10179:0307/111632.263693:ERROR:gpu_channel_manager.cc(883)] Failed to create GLES3 context, fallback to GLES2.
[10152:10179:0307/111632.264127:ERROR:gpu_channel_manager.cc(894)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[10152:10179:0307/111632.264374:ERROR:shared_image_stub.cc(475)] SharedImageStub: unable to create context
[10152:10179:0307/111632.264765:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub

Am I missing something?

Also tried to add --ignore-gpu-blocklist --ignore-gpu-blacklist but none of these helped.

rakuco commented 1 year ago

Tentatively cc'ing @MaxIhlenfeldt for GPU-related stuff

MaxIhlenfeldt commented 1 year ago

I'm not too familiar with HW acceleration, sorry. Maybe @msisov still has some time to take a look?

In any case, if chrome://gpu reports that HW acceleration is available, but it looks like it isn't, this may be worth to report upstream?

sedlalu2 commented 1 year ago

I am starting chromium with these arguments:

chromium --no-sandbox --in-process-gpu --ignore-gpu-blacklist --ignore-gpu-blocklist --enable-features=CanvasOopRasterization,UseOzonePlatform --enable-accelerated-2d-canvas --enable-zero-copy --enable-gpu-compos
iting --enable-raw-draw --enable-native-gpu-memory-buffers --enable-gpu-rasterization --use-gl=egl --ozone-platform=wayland

This is chrome://gpu report

Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Enabled
Direct Rendering Display Compositor: Disabled
Compositing: Software only. Hardware acceleration disabled
Multiple Raster Threads: Disabled
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Raw Draw: Disabled
Video Decode: Hardware accelerated
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Hardware accelerated but at reduced performance
WebGL2: Hardware accelerated but at reduced performance
WebGPU: Disabled
Driver Bug Workarounds
clear_uniforms_before_first_program_use
enable_webgl_timer_query_extensions
exit_on_context_lost
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
disabled_extension_GL_MESA_framebuffer_flip_y
Problems Detected
WebGPU has been disabled via blocklist or the command line.
Disabled Features: webgpu
Raster is using a single thread.
Disabled Features: multiple_raster_threads
Accelerated video encode has been disabled, either via blocklist, about:flags or the command line.
Disabled Features: video_encode
Gpu compositing has been disabled, either via blocklist, about:flags or the command line. The browser will fall back to software compositing and hardware acceleration will be unavailable.
Disabled Features: gpu_compositing
Clear uniforms before first program use on all platforms: 124764, 349137
Applied Workarounds: clear_uniforms_before_first_program_use
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Expose WebGL's disjoint_timer_query extensions on platforms with site isolation: 808744, 870491
Applied Workarounds: enable_webgl_timer_query_extensions
Some drivers can't recover after OUT_OF_MEM and context lost: 893177
Applied Workarounds: exit_on_context_lost
Disable GL_MESA_framebuffer_flip_y for desktop GL: 964010
Applied Workarounds: disable(GL_MESA_framebuffer_flip_y)
Version Information
Data exported
2023-03-08T10:50:00.381Z
Chrome version
Chrome/110.0.5481.77
Operating system
Linux 5.15.67
Software rendering list URL
https://chromium.googlesource.com/chromium/src/+/65ed616c6e8ee3fe0ad64fe83796c020644d42af/gpu/config/software_rendering_list.json
Driver bug list URL
https://chromium.googlesource.com/chromium/src/+/65ed616c6e8ee3fe0ad64fe83796c020644d42af/gpu/config/gpu_driver_bug_list.json
ANGLE commit id
unknown hash
2D graphics backend
Skia/110 aab9fb4100da797d25fe340e9a2fcb2ae30fc2e1
Command Line
/usr/bin/chromium --no-sandbox --in-process-gpu --ignore-gpu-blacklist --ignore-gpu-blocklist --enable-features=CanvasOopRasterization,UseOzonePlatform --enable-accelerated-2d-canvas --enable-zero-copy --enable-gpu-compositing --enablel
Driver Information
Initialization time
3563
In-process GPU
true
Passthrough Command Decoder
true
Sandboxed
false
GPU0
VENDOR= 0x0000, DEVICE=0x0000
Optimus
false
AMD switchable
false
GPU CUDA compute capability major version
0
Pixel shader version
Vertex shader version
Max. MSAA samples
Machine model name
Machine model version
GL_VENDOR
GL_RENDERER
GL_VERSION
GL_EXTENSIONS
Disabled Extensions
GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_MESA_framebuffer_flip_y
Disabled WebGL Extensions
Window system binding vendor
Window system binding version
Window system binding extensions
XDG_SESSION_TYPE
tty
Interfaces exposed by the Wayland compositor
wl_compositor:4 wl_subcompositor:1 wp_viewporter:1 zxdg_output_manager_v1:2 wp_presentation:1 zwp_relative_pointer_manager_v1:1 zwp_pointer_constraints_v1:1 zwp_input_timestamps_manager_v1:1 wl_data_device_manager:3 wl_shm:1 weston_tou2
Ozone platform
wayland
Direct rendering version
unknown
Reset notification strategy
0x0000
GPU process crash count
0
gfx::BufferFormats supported for allocation and texturing
R_8: not supported, R_16: not supported, RG_88: not supported, RG_1616: not supported, BGR_565: not supported, RGBA_4444: not supported, RGBX_8888: not supported, RGBA_8888: not supported, BGRX_8888: not supported, BGRA_1010102: not sud
Compositor Information
Tile Update Mode
Zero-copy
Partial Raster
Enabled
GpuMemoryBuffers Status
R_8
Software only
R_16
Software only
RG_88
Software only
RG_1616
Software only
BGR_565
Software only
RGBA_4444
Software only
RGBX_8888
Software only
RGBA_8888
Software only
BGRX_8888
Software only
BGRA_1010102
Software only
RGBA_1010102
Software only
BGRA_8888
Software only
RGBA_F16
Software only
YVU_420
Software only
YUV_420_BIPLANAR
Software only
YUVA_420_TRIPLANAR
Software only
P010
Software only
Display(s) Information
Info
Display[19] bounds=[0,0 800x480], workarea=[0,0 800x480], scale=1, rotation=270, panel_rotation=270 external.
Color space (all)
{primaries:BT709, transfer:SRGB, matrix:RGB, range:FULL}
Buffer format (all)
RGBA_8888
Color volume
{name:'srgb', r:[0.6400, 0.3300], g:[0.3000, 0.6000], b:[0.1500, 0.3300], w:[0.3127, 0.3290]}
SDR white level in nits
203
HDR relative maximum luminance
1
Bits per color component
8
Bits per pixel
24
Video Acceleration Information
Decoding
Encoding
Vulkan Information
Device Performance Information
Log Messages
Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Enabled
Direct Rendering Display Compositor: Disabled
Compositing: Software only. Hardware acceleration disabled
Multiple Raster Threads: Disabled
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Raw Draw: Disabled
Video Decode: Hardware accelerated
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Hardware accelerated but at reduced performance
WebGL2: Hardware accelerated but at reduced performance
WebGPU: Disabled
Driver Bug Workarounds
clear_uniforms_before_first_program_use
enable_webgl_timer_query_extensions
exit_on_context_lost
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
disabled_extension_GL_MESA_framebuffer_flip_y
Problems Detected
WebGPU has been disabled via blocklist or the command line.
Disabled Features: webgpu
Raster is using a single thread.
Disabled Features: multiple_raster_threads
Accelerated video encode has been disabled, either via blocklist, about:flags or the command line.
Disabled Features: video_encode
Gpu compositing has been disabled, either via blocklist, about:flags or the command line. The browser will fall back to software compositing and hardware acceleration will be unavailable.
Disabled Features: gpu_compositing
Clear uniforms before first program use on all platforms: 124764, 349137
Applied Workarounds: clear_uniforms_before_first_program_use
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Expose WebGL's disjoint_timer_query extensions on platforms with site isolation: 808744, 870491
Applied Workarounds: enable_webgl_timer_query_extensions
Some drivers can't recover after OUT_OF_MEM and context lost: 893177
Applied Workarounds: exit_on_context_lost
Disable GL_MESA_framebuffer_flip_y for desktop GL: 964010
Applied Workarounds: disable(GL_MESA_framebuffer_flip_y)
Version Information
Data exported
2023-03-08T10:50:00.381Z
Chrome version
Chrome/110.0.5481.77
Operating system
Linux 5.15.67
Software rendering list URL
https://chromium.googlesource.com/chromium/src/+/65ed616c6e8ee3fe0ad64fe83796c020644d42af/gpu/config/software_rendering_list.json
Driver bug list URL
https://chromium.googlesource.com/chromium/src/+/65ed616c6e8ee3fe0ad64fe83796c020644d42af/gpu/config/gpu_driver_bug_list.json
ANGLE commit id
unknown hash
2D graphics backend
Skia/110 aab9fb4100da797d25fe340e9a2fcb2ae30fc2e1
Command Line
/usr/bin/chromium --no-sandbox --in-process-gpu --ignore-gpu-blacklist --ignore-gpu-blocklist --enable-features=CanvasOopRasterization,UseOzonePlatform --enable-accelerated-2d-canvas --enable-zero-copy --enable-gpu-compositing --enablel
Driver Information
Initialization time
3563
In-process GPU
true
Passthrough Command Decoder
true
Sandboxed
false
GPU0
VENDOR= 0x0000, DEVICE=0x0000
Optimus
false
AMD switchable
false
GPU CUDA compute capability major version
0
Pixel shader version
Vertex shader version
Max. MSAA samples
Machine model name
Machine model version
GL_VENDOR
GL_RENDERER
GL_VERSION
GL_EXTENSIONS
Disabled Extensions
GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_MESA_framebuffer_flip_y
Disabled WebGL Extensions
Window system binding vendor
Window system binding version
Window system binding extensions
XDG_SESSION_TYPE
tty
Interfaces exposed by the Wayland compositor
wl_compositor:4 wl_subcompositor:1 wp_viewporter:1 zxdg_output_manager_v1:2 wp_presentation:1 zwp_relative_pointer_manager_v1:1 zwp_pointer_constraints_v1:1 zwp_input_timestamps_manager_v1:1 wl_data_device_manager:3 wl_shm:1 weston_tou2
Ozone platform
wayland
Direct rendering version
unknown
Reset notification strategy
0x0000
GPU process crash count
0
gfx::BufferFormats supported for allocation and texturing
R_8: not supported, R_16: not supported, RG_88: not supported, RG_1616: not supported, BGR_565: not supported, RGBA_4444: not supported, RGBX_8888: not supported, RGBA_8888: not supported, BGRX_8888: not supported, BGRA_1010102: not sud
Compositor Information
Tile Update Mode
Zero-copy
Partial Raster
Enabled
GpuMemoryBuffers Status
R_8
Software only
R_16
Software only
RG_88
Software only
RG_1616
Software only
BGR_565
Software only
RGBA_4444
Software only
RGBX_8888
Software only
RGBA_8888
Software only
BGRX_8888
Software only
BGRA_1010102
Software only
RGBA_1010102
Software only
BGRA_8888
Software only
RGBA_F16
Software only
YVU_420
Software only
YUV_420_BIPLANAR
Software only
YUVA_420_TRIPLANAR
Software only
P010
Software only
Display(s) Information
Info
Display[19] bounds=[0,0 800x480], workarea=[0,0 800x480], scale=1, rotation=270, panel_rotation=270 external.
Color space (all)
{primaries:BT709, transfer:SRGB, matrix:RGB, range:FULL}
Buffer format (all)
RGBA_8888
Color volume
{name:'srgb', r:[0.6400, 0.3300], g:[0.3000, 0.6000], b:[0.1500, 0.3300], w:[0.3127, 0.3290]}
SDR white level in nits
203
HDR relative maximum luminance
1
Bits per color component
8
Bits per pixel
24
Video Acceleration Information
Decoding
Encoding
Vulkan Information
Device Performance Information
Log Messages

Is looks like HW acceleration is partly working. But I am not so sure. WebGL is not working at all for example. In comparsion with WPEWebkit and Cog chromium's performance is still laggy.

When I try to monitor GPU load it is around 5-10 % with chromium. On the same page with COG load is around 80 %. Monitoring with this command: https://wiki.st.com/stm32mpu/wiki/How_to_monitor_the_GCNANO_GPU_load

msisov commented 1 year ago

First of all, you have to use --in-process-gpu because you system doesn't support wl_drm or zwp_linux_dmabuf, which require certain extensions.

Interfaces exposed by the Wayland compositor
wl_compositor:4 wl_subcompositor:1 wp_viewporter:1 zxdg_output_manager_v1:2 wp_presentation:1 zwp_relative_pointer_manager_v1:1 zwp_pointer_constraints_v1:1 zwp_input_timestamps_manager_v1:1 wl_data_device_manager:3 wl_shm:1 weston_tou2

Secondly, I think the main problem here is

[10152:10179:0307/111631.034638:ERROR:gl_display.cc(892)] EGL display query failed with error EGL_SUCCESS
[10152:10179:0307/111631.034893:ERROR:gl_display.cc(917)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[10152:10179:0307/111631.035007:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.

In case of --in-process-gpu, a display is initialised as [1]. I can't know why GL doesn't understand this display type on your system. It feels like you have to figure that out on your own (or ask your provider for help) as it doesn't look like a mainstream device and we haven't worked on the upstream support for that unlike WPE, which knows how to deal with that. Probably, there are driver specifics that we don't know and don't support, but which works with desktop devices.

[1] https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc;l=162?q=wayland_surface_factory.cc&ss=chromium%2Fchromium%2Fsrc

sedlalu2 commented 1 year ago

@msisov Thank you. I will investigate a little more further.

Anyway, I also deleted original libEGL.so and libGLESv2.so in /usr/lib/chromium. Couldn't this be the problem why HW acceleration is not working as expected? Chromium should then use system installed libEGL and libGLESv2, shouldn't it?Why are these libraries in chromium folder anyway? Does chromium use different implementation or so? Before I deleted it, I have got a lot of API based errors.

[1697:1715:0309/143440.935660:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security.
[1697:1715:0309/143440.945154:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security.
[     1] Failed EGL API GetProcAddress: eglBindWaylandDisplayWL !
[     2] Failed EGL API GetProcAddress: eglUnbindWaylandDisplayWL !
[     3] Failed EGL API GetProcAddress: eglQueryWaylandBufferWL !
[     4] Failed EGL API GetProcAddress: eglQueryDevicesEXT !
[     5] Failed EGL API GetProcAddress: eglCreateWaylandBufferFromImageWL !
[     6] Failed EGL API GetProcAddress: eglSwapBuffersWithDamageEXT !
[     7] Failed EGL API GetProcAddress: eglPatchID !
[     8] Failed ES_Common API GetProcAddress: forward_glActiveTexture !
[     9] Failed ES_Common API GetProcAddress: forward_glBindBuffer !
[    10] Failed ES_Common API GetProcAddress: forward_glBindTexture !
[    11] Failed ES_Common API GetProcAddress: forward_glBlendFunc !
[    12] Failed ES_Common API GetProcAddress: forward_glBufferData !
[    13] Failed ES_Common API GetProcAddress: forward_glBufferSubData !
[    14] Failed ES_Common API GetProcAddress: forward_glClear !
[    15] Failed ES_Common API GetProcAddress: forward_glClearColor !
[    16] Failed ES_Common API GetProcAddress: forward_glClearDepthf !
[    17] Failed ES_Common API GetProcAddress: forward_glClearStencil !
[    18] Failed ES_Common API GetProcAddress: forward_glColorMask !
[    19] Failed ES_Common API GetProcAddress: forward_glCompressedTexImage2D !
[    20] Failed ES_Common API GetProcAddress: forward_glCompressedTexSubImage2D !
[    21] Failed ES_Common API GetProcAddress: forward_glCopyTexImage2D !
[    22] Failed ES_Common API GetProcAddress: forward_glCopyTexSubImage2D !
[    23] Failed ES_Common API GetProcAddress: forward_glCullFace !
[    24] Failed ES_Common API GetProcAddress: forward_glDeleteBuffers !
[    25] Failed ES_Common API GetProcAddress: forward_glDeleteTextures !
[    26] Failed ES_Common API GetProcAddress: forward_glDepthFunc !
[    27] Failed ES_Common API GetProcAddress: forward_glDepthMask !
[    28] Failed ES_Common API GetProcAddress: forward_glDepthRangef !
[    29] Failed ES_Common API GetProcAddress: forward_glDisable !
[    30] Failed ES_Common API GetProcAddress: forward_glDrawArrays !
[    31] Failed ES_Common API GetProcAddress: forward_glDrawElements !
[    32] Failed ES_Common API GetProcAddress: forward_glEnable !
[    33] Failed ES_Common API GetProcAddress: forward_glFinish !
[    34] Failed ES_Common API GetProcAddress: forward_glFlush !
[    35] Failed ES_Common API GetProcAddress: forward_glFrontFace !
[    36] Failed ES_Common API GetProcAddress: forward_glGenBuffers !
[    37] Failed ES_Common API GetProcAddress: forward_glGenTextures !
[    38] Failed ES_Common API GetProcAddress: forward_glGetBooleanv !
[    39] Failed ES_Common API GetProcAddress: forward_glGetBufferParameteriv !
[    40] Failed ES_Common API GetProcAddress: forward_glGetError !
[    41] Failed ES_Common API GetProcAddress: forward_glGetFloatv !
[    42] Failed ES_Common API GetProcAddress: forward_glGetIntegerv !
[    43] Failed ES_Common API GetProcAddress: forward_glGetPointerv !
[    44] Failed ES_Common API GetProcAddress: forward_glGetString !
[    45] Failed ES_Common API GetProcAddress: forward_glGetTexParameterfv !
[    46] Failed ES_Common API GetProcAddress: forward_glGetTexParameteriv !
[    47] Failed ES_Common API GetProcAddress: forward_glHint !
[    48] Failed ES_Common API GetProcAddress: forward_glIsBuffer !
[    49] Failed ES_Common API GetProcAddress: forward_glIsEnabled !
[    50] Failed ES_Common API GetProcAddress: forward_glIsTexture !
[    51] Failed ES_Common API GetProcAddress: forward_glLineWidth !
[    52] Failed ES_Common API GetProcAddress: forward_glPixelStorei !
[    53] Failed ES_Common API GetProcAddress: forward_glPolygonOffset !
[    54] Failed ES_Common API GetProcAddress: forward_glReadPixels !
[    55] Failed ES_Common API GetProcAddress: forward_glSampleCoverage !
[    56] Failed ES_Common API GetProcAddress: forward_glScissor !
[    57] Failed ES_Common API GetProcAddress: forward_glStencilFunc !
[    58] Failed ES_Common API GetProcAddress: forward_glStencilMask !
[    59] Failed ES_Common API GetProcAddress: forward_glStencilOp !
[    60] Failed ES_Common API GetProcAddress: forward_glTexImage2D !
[    61] Failed ES_Common API GetProcAddress: forward_glTexParameterf !
[    62] Failed ES_Common API GetProcAddress: forward_glTexParameterfv !
[    63] Failed ES_Common API GetProcAddress: forward_glTexParameteri !
[    64] Failed ES_Common API GetProcAddress: forward_glTexParameteriv !
[    65] Failed ES_Common API GetProcAddress: forward_glTexSubImage2D !
[    66] Failed ES_Common API GetProcAddress: forward_glViewport !
[    67] Failed ES_Common API GetProcAddress: forward_glMapBufferOES !
[    68] Failed ES_Common API GetProcAddress: forward_glUnmapBufferOES !
[    69] Failed ES_Common API GetProcAddress: forward_glEGLImageTargetTexture2DOES !
[    70] Failed ES_Common API GetProcAddress: forward_glEGLImageTargetRenderbufferStorageOES !
[    71] Failed ES_Common API GetProcAddress: forward_glMultiDrawArraysEXT !
[    72] Failed ES_Common API GetProcAddress: forward_glMultiDrawElementsEXT !
[    73] Failed ES_Common API GetProcAddress: forward_glTexDirectVIV !
[    74] Failed ES_Common API GetProcAddress: forward_glTexDirectInvalidateVIV !
[    75] Failed ES_Common API GetProcAddress: forward_glTexDirectVIVMap !
[    76] Failed ES_Common API GetProcAddress: forward_glTexDirectTiledMapVIV !
[    77] Failed GLES32 API GetProcAddress: glMultiDrawArraysEXT !
[    78] Failed GLES32 API GetProcAddress: glMultiDrawElementsEXT !
[    79] Failed GLES32 API GetProcAddress: glTexDirectVIV !
[    80] Failed GLES32 API GetProcAddress: glTexDirectInvalidateVIV !
[    81] Failed GLES32 API GetProcAddress: glTexDirectVIVMap !
[    82] Failed GLES32 API GetProcAddress: glTexDirectTiledMapVIV !
[    83] Failed GLES32 API GetProcAddress: glTexDirectCacheOperationVIV !
[    84] Failed GLES32 API GetProcAddress: glTexDirectWithTileStatusMapVIV !
[    85] Failed GLES32 API GetProcAddress: glGetTexImage !
[    86] Failed ES Common GLES2X API GetProcAddress: glMultiDrawArraysEXT !
[1697:1725:0309/143441.139478:ERROR:gl_display.cc(892)] EGL display query failed with error EGL_SUCCESS
[1697:1725:0309/143441.139650:ERROR:gl_display.cc(917)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[1697:1725:0309/143441.139748:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[1697:1715:0309/143441.207598:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security.
[1697:1715:0309/143441.215018:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security.
[1697:1725:0309/143442.400514:ERROR:gpu_channel_manager.cc(883)] Failed to create GLES3 context, fallback to GLES2.
[1697:1725:0309/143442.400718:ERROR:gpu_channel_manager.cc(894)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1697:1725:0309/143442.400850:ERROR:shared_image_stub.cc(475)] SharedImageStub: unable to create context
[1697:1725:0309/143442.400987:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub
[1697:1725:0309/143442.401386:ERROR:gpu_channel_manager.cc(883)] Failed to create GLES3 context, fallback to GLES2.
[1697:1725:0309/143442.401532:ERROR:gpu_channel_manager.cc(894)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1697:1725:0309/143442.401633:ERROR:shared_image_stub.cc(475)] SharedImageStub: unable to create context
[1697:1725:0309/143442.401767:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub

Btw, this error still remains:

[1697:1725:0309/143441.139478:ERROR:gl_display.cc(892)] EGL display query failed with error EGL_SUCCESS
[1697:1725:0309/143441.139650:ERROR:gl_display.cc(917)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[1697:1725:0309/143441.139748:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.

Does it mean that I should investigate more on GPU drivers level?

msisov commented 1 year ago

Why are these libraries in chromium folder anyway

They are there because of ANGLE usage by Chromium

[1697:1725:0309/143441.139478:ERROR:gl_display.cc(892)] EGL display query failed with error EGL_SUCCESS [1697:1725:0309/143441.139650:ERROR:gl_display.cc(917)] eglInitialize Default failed with error EGL_BAD_DISPLAY [1697:1725:0309/143441.139748:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.

Check your driver's logs. Maybe, that can give you a hint why it happens

sedlalu2 commented 1 year ago

@msisov

No solution yet. I have tried to switch driver to Etnaviv instead of gcnano. Now when I launch chromium with --in-process-gpu flag no window shows up. Without the flag chromium starts successfully, but HW acceleration is not working at all.

Log when I launch chromium with --in-process-gpu:

Error sending request: Bad file descriptor
[1509:1536:0327/073206.219348:ERROR:gl_display.cc(504)] EGL Driver message (Error) eglInitialize: eglInitialize
[1509:1536:0327/073206.219729:ERROR:gl_display.cc(917)] eglInitialize Default failed with error EGL_NOT_INITIALIZED
[1509:1536:0327/073206.219899:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[1509:1536:0327/073207.279205:ERROR:gpu_channel_manager.cc(883)] Failed to create GLES3 context, fallback to GLES2.
[1509:1536:0327/073207.281692:ERROR:gpu_channel_manager.cc(894)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1509:1536:0327/073207.281966:ERROR:shared_image_stub.cc(475)] SharedImageStub: unable to create context
[1509:1536:0327/073207.282176:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub
[1509:1536:0327/073207.283101:ERROR:gpu_channel_manager.cc(883)] Failed to create GLES3 context, fallback to GLES2.
[1509:1536:0327/073207.283328:ERROR:gpu_channel_manager.cc(894)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1509:1536:0327/073207.283514:ERROR:shared_image_stub.cc(475)] SharedImageStub: unable to create context
[1509:1536:0327/073207.283709:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub
Error: Couldn't load Vulkan. Searched /usr/lib/chromium/libvulkan.so.1, /usr/lib/chromium/libvulkan.so.1, libvulkan.so.1.
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:248)
    at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:253)
    at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:215)
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:474)

Error: Couldn't load Vulkan. Searched /usr/lib/chromium/libvk_swiftshader.so, /usr/lib/chromium/libvk_swiftshader.so, libvk_swiftshader.so.
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:248)
    at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:259)
    at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:215)
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:474)

Error: eglGetDisplay
    at Create (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:32)

Error: eglGetDisplay
    at Create (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:32)

Any idea why there is Error sending request: Bad file descriptor error printed? Tried also launch with --enable-logging=stderr --v=1 but no useful information shows up.

msisov commented 1 year ago

No solution yet. I have tried to switch driver to Etnaviv instead of gcnano. Now when I launch chromium with --in-process-gpu flag no window shows up. Without the flag chromium starts successfully, but HW acceleration is not working at all.

It'd help if you can share your driver's log. There is no clue why there is no display as eglInitialize states that EGL_NOT_INITIALIZED is generated if display cannot be initialized.

sedlalu2 commented 1 year ago

This is all I can get when I set environmental variables for Mesa (22.0.3) debug

LIBGL_DEBUG=1
MESA_DEBUG=1
EGL_LOG_LEVEL=debug
WAYLAND_DEBUG=1
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
[1051881.891]  -> wl_display@1.get_registry(new id wl_registry@2)
[1051882.105]  -> wl_display@1.sync(new id wl_callback@3)
[1051882.743] wl_display@1.delete_id(3)
[1051882.821] wl_registry@2.global(1, "wl_compositor", 4)
[1051882.880]  -> wl_registry@2.bind(1, "wl_compositor", 4, new id [unknown]@4)
[1051883.111] wl_registry@2.global(2, "wl_subcompositor", 1)
[1051883.182]  -> wl_registry@2.bind(2, "wl_subcompositor", 1, new id [unknown]@5)
[1051883.359] wl_registry@2.global(3, "wp_viewporter", 1)
[1051883.423]  -> wl_registry@2.bind(3, "wp_viewporter", 1, new id [unknown]@6)
[1051883.587] wl_registry@2.global(4, "zxdg_output_manager_v1", 2)
[1051883.652]  -> wl_registry@2.bind(4, "zxdg_output_manager_v1", 2, new id [unknown]@7)
[1051883.814] wl_registry@2.global(5, "wp_presentation", 1)
[1051883.871]  -> wl_registry@2.bind(5, "wp_presentation", 1, new id [unknown]@8)
[1051884.068] wl_registry@2.global(6, "zwp_relative_pointer_manager_v1", 1)
[1051884.135]  -> wl_registry@2.bind(6, "zwp_relative_pointer_manager_v1", 1, new id [unknown]@9)
[1051884.307] wl_registry@2.global(7, "zwp_pointer_constraints_v1", 1)
[1051884.367]  -> wl_registry@2.bind(7, "zwp_pointer_constraints_v1", 1, new id [unknown]@10)
[1051884.528] wl_registry@2.global(8, "zwp_input_timestamps_manager_v1", 1)
[1051884.589] wl_registry@2.global(9, "wl_data_device_manager", 3)
[1051884.638]  -> wl_registry@2.bind(9, "wl_data_device_manager", 3, new id [unknown]@11)
[1051884.801] wl_registry@2.global(10, "wl_shm", 1)
[1051884.858]  -> wl_registry@2.bind(10, "wl_shm", 1, new id [unknown]@12)
[1051885.062] wl_registry@2.global(11, "weston_touch_calibration", 1)
[1051885.123] wl_registry@2.global(12, "wl_drm", 2)
[1051885.169]  -> wl_registry@2.bind(12, "wl_drm", 2, new id [unknown]@13)
[1051885.936]  -> wl_display@1.sync(new id wl_callback@14)
[1051885.997] wl_registry@2.global(13, "wl_seat", 7)
[1051886.046]  -> wl_registry@2.bind(13, "wl_seat", 7, new id [unknown]@15)
[1051886.102]  -> wl_data_device_manager@11.get_data_device(new id wl_data_device@16, wl_seat@15)
[1051886.482] wl_registry@2.global(14, "zwp_linux_dmabuf_v1", 4)
[1051886.569]  -> wl_registry@2.bind(14, "zwp_linux_dmabuf_v1", 3, new id [unknown]@17)
[1051886.632]  -> wl_display@1.sync(new id wl_callback@18)
[1051886.734] wl_registry@2.global(15, "weston_direct_display_v1", 1)
[1051887.185] wl_registry@2.global(16, "zwp_linux_explicit_synchronization_v1", 2)
[1051887.259]  -> wl_registry@2.bind(16, "zwp_linux_explicit_synchronization_v1", 2, new id [unknown]@19)
[1051887.451] wl_registry@2.global(17, "weston_content_protection", 1)
[1051887.511] wl_registry@2.global(18, "wl_output", 3)
[1051887.559]  -> wl_registry@2.bind(18, "wl_output", 3, new id [unknown]@20)
[1051887.609]  -> zxdg_output_manager_v1@7.get_xdg_output(new id zxdg_output_v1@21, wl_output@20)
[1051887.856] wl_registry@2.global(19, "zwp_input_panel_v1", 1)
[1051887.924] wl_registry@2.global(20, "zwp_input_method_v1", 1)
[1051887.973] wl_registry@2.global(21, "zwp_text_input_manager_v1", 1)
[1051888.019]  -> wl_registry@2.bind(21, "zwp_text_input_manager_v1", 1, new id [unknown]@22)
[1051888.208] wl_registry@2.global(22, "xdg_wm_base", 3)
[1051888.267]  -> wl_registry@2.bind(22, "xdg_wm_base", 3, new id [unknown]@23)
[1051888.545] wl_registry@2.global(23, "wl_shell", 1)
[1051888.611] wl_registry@2.global(24, "weston_desktop_shell", 1)
[1051888.658] wl_registry@2.global(25, "weston_screenshooter", 1)
[1051888.701] wl_callback@3.done(18)
[1051889.050] wl_display@1.delete_id(14)
[1051889.107] wl_display@1.delete_id(18)
[1051889.141] wp_presentation@8.clock_id(1)
[1051889.179] wl_drm@13.device("/dev/dri/card1")
[1051889.469]  -> wl_drm@13.authenticate(1)
[1051889.773]  -> wl_display@1.sync(new id wl_callback@3)
[1051889.837] wl_drm@13.format(875713089)
[1051889.881] wl_drm@13.format(875713112)
[1051889.919] wl_drm@13.format(909199186)
[1051889.950] wl_drm@13.format(961959257)
[1051889.982] wl_drm@13.format(825316697)
[1051890.011] wl_drm@13.format(842093913)
[1051890.043] wl_drm@13.format(909202777)
[1051890.071] wl_drm@13.format(875713881)
[1051890.102] wl_drm@13.format(842094158)
[1051890.130] wl_drm@13.format(909203022)
[1051890.161] wl_drm@13.format(1448695129)
[1051890.188] wl_drm@13.capabilities(1)
[1051890.220] wl_callback@14.done(18)
[1051890.250] wl_seat@15.capabilities(6)
[1051890.285]  -> wl_seat@15.get_keyboard(new id wl_keyboard@14)
[1051890.329]  -> wl_seat@15.get_touch(new id wl_touch@24)
[1051890.744] wl_seat@15.name("default")
[1051890.806] zwp_linux_dmabuf_v1@17.modifier(875713089, 16777215, 4294967295)
[1051890.851] zwp_linux_dmabuf_v1@17.modifier(875713089, 0, 0)
[1051890.889] zwp_linux_dmabuf_v1@17.modifier(875713089, 100663296, 1)
[1051890.926] zwp_linux_dmabuf_v1@17.modifier(875713089, 100663296, 2)
[1051890.963] zwp_linux_dmabuf_v1@17.modifier(875708993, 16777215, 4294967295)
[1051891.001] zwp_linux_dmabuf_v1@17.modifier(875708993, 0, 0)
[1051891.036] zwp_linux_dmabuf_v1@17.modifier(875708993, 100663296, 1)
[1051891.073] zwp_linux_dmabuf_v1@17.modifier(875708993, 100663296, 2)
[1051891.109] zwp_linux_dmabuf_v1@17.modifier(875713112, 16777215, 4294967295)
[1051891.146] zwp_linux_dmabuf_v1@17.modifier(875713112, 0, 0)
[1051891.182] zwp_linux_dmabuf_v1@17.modifier(875713112, 100663296, 1)
[1051891.219] zwp_linux_dmabuf_v1@17.modifier(875713112, 100663296, 2)
[1051891.253] zwp_linux_dmabuf_v1@17.modifier(875709016, 16777215, 4294967295)
[1051891.289] zwp_linux_dmabuf_v1@17.modifier(875709016, 0, 0)
[1051891.323] zwp_linux_dmabuf_v1@17.modifier(875709016, 100663296, 1)
[1051891.359] zwp_linux_dmabuf_v1@17.modifier(875709016, 100663296, 2)
[1051891.396] zwp_linux_dmabuf_v1@17.modifier(892424769, 16777215, 4294967295)
[1051891.430] zwp_linux_dmabuf_v1@17.modifier(892424769, 0, 0)
[1051891.463] zwp_linux_dmabuf_v1@17.modifier(892424769, 100663296, 1)
[1051891.497] zwp_linux_dmabuf_v1@17.modifier(892424769, 100663296, 2)
[1051891.529] zwp_linux_dmabuf_v1@17.modifier(909199186, 16777215, 4294967295)
[1051891.566] zwp_linux_dmabuf_v1@17.modifier(909199186, 0, 0)
[1051891.601] zwp_linux_dmabuf_v1@17.modifier(909199186, 100663296, 1)
[1051891.638] zwp_linux_dmabuf_v1@17.modifier(909199186, 100663296, 2)
[1051891.672] zwp_linux_dmabuf_v1@17.modifier(1448433985, 16777215, 4294967295)
[1051891.708] zwp_linux_dmabuf_v1@17.modifier(1448433985, 0, 0)
[1051891.740] zwp_linux_dmabuf_v1@17.modifier(1448433985, 100663296, 1)
[1051891.771] zwp_linux_dmabuf_v1@17.modifier(1448433985, 100663296, 2)
[1051891.801] zwp_linux_dmabuf_v1@17.modifier(1448434008, 16777215, 4294967295)
[1051891.831] zwp_linux_dmabuf_v1@17.modifier(1448434008, 0, 0)
[1051891.861] zwp_linux_dmabuf_v1@17.modifier(1448434008, 100663296, 1)
[1051891.891] zwp_linux_dmabuf_v1@17.modifier(1448434008, 100663296, 2)
[1051891.921] zwp_linux_dmabuf_v1@17.modifier(1448695129, 16777215, 4294967295)
[1051891.951] zwp_linux_dmabuf_v1@17.modifier(1448695129, 0, 0)
[1051891.981] zwp_linux_dmabuf_v1@17.modifier(1448695129, 100663296, 1)
[1051892.010] zwp_linux_dmabuf_v1@17.modifier(1448695129, 100663296, 2)
[1051892.041] zwp_linux_dmabuf_v1@17.modifier(1498831189, 16777215, 4294967295)
[1051892.071] zwp_linux_dmabuf_v1@17.modifier(1498831189, 0, 0)
[1051892.100] zwp_linux_dmabuf_v1@17.modifier(1498831189, 100663296, 1)
[1051892.130] zwp_linux_dmabuf_v1@17.modifier(1498831189, 100663296, 2)
[1051892.160] wl_callback@18.done(18)
[1051892.189] wl_output@20.geometry(0, 0, 81, 142, 0, "unknown", "unknown", 1)
[1051892.230] wl_output@20.scale(1)
[1051892.258] wl_output@20.mode(3, 480, 854, 65727)
[1051892.291] wl_output@20.done()
[1051892.320] zxdg_output_v1@21.logical_position(0, 0)
[1051892.349] zxdg_output_v1@21.logical_size(854, 480)
[1051892.378] zxdg_output_v1@21.name("DPI-1")
[1051892.405] zxdg_output_v1@21.done()
[1051892.514] wl_display@1.delete_id(3)
[1051892.553] wl_drm@13.authenticated()
[1051892.580] wl_callback@3.done(18)
[1051892.606] wl_keyboard@14.repeat_info(40, 400)
[1051892.638] wl_keyboard@14.keymap(1, fd 33, 64434)
[1051985.440]  -> wl_shm@12.create_pool(new id wl_shm_pool@3, fd 44, 2304)
[1051986.627]  -> wl_shm_pool@3.resize(5568)
[1051986.893]  -> wl_shm_pool@3.resize(12096)
libEGL debug: Native platform type: wayland (environment)
Error sending request: Bad file descriptor
[3875:3903:0327/174055.176212:ERROR:gl_display.cc(504)] EGL Driver message (Error) eglInitialize: eglInitialize
libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize

[3875:3903:0327/174055.176470:ERROR:gl_display.cc(917)] eglInitialize Default failed with error EGL_NOT_INITIALIZED
[3875:3903:0327/174055.176559:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
...

No error messages in dmesg. Also no error messages when I turn on DRM debug in kernel debugfs.

Is that what you meant by driver's log?

msisov commented 1 year ago

Thanks. It's probably a problem with how it gets the display handle. We store it here https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc;l=164 and then get the EGLDisplay type somewhere here in the switch case https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/gl_display.cc;drc=48340c1e35efad5fb0253025dcc36b3a9573e258;bpv=1;bpt=1;l=276

So, it's worth checking what path it uses. If it doesn't use angle, it must use https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/gl_display.cc;l=284;drc=48340c1e35efad5fb0253025dcc36b3a9573e258;bpv=1;bpt=1

sedlalu2 commented 1 year ago

@msisov Thank you.

I'm starting chromium with argument --use-gl=egl. I suppose that is the corrent way to force chromium to use system GL libraries (mesa). With that argument the above error is printed out.

When I switch to --use-gl=angle then this warning occures:

[1063:1092:0328/145713.692315:ERROR:gl_factory.cc(128)] Requested GL implementation (gl=egl-angle,angle=default) not found in allowed implementations.

So it looks like angle is not allowed. Despite that warning chromium window at least shows up. Suprisingly, it shouldn't work with angle, should it? And what GL implementation will be used on fallback?

When I open chrome://gpu page (--use-gl=angle) it shows:

chromium --no-sandbox --in-process-gpu --ignore-gpu-blacklist --ignore-gpu-blocklist --enablefeatures=CanvasOopRasterization,UseOzonePlatform --enable-accelerated-2d-canvas --enable-zero-copy --enable-gpu-compositing --enable-raw-draw --enable-native-gpu-memory-buffers --enable-gpu-rasterization  --ozone-platform=wayland --use-gl=angle

Chromium's libEGL and libGLES libraries back in the /usr/lib/chromium for these tests.

image

From this report it looks like some of the features are HW accelerated, but I dont think they really are. For example WebGL is "HW accelerated at reduced performance" - but even the simpliest WebGL 1.0 example does not work at all.

nandra commented 1 year ago

@sedlalu2 which poky release do you use? I'm using kirkstone and on same platform I see lot of crashes. Thanks.

sedlalu2 commented 1 year ago

@nandra I'm using kirkstone too. And still facing the same EGL based crashes I described above :)

nandra commented 1 year ago

@sedlalu2 do you use chromium-x11 or ozone wayland please? Thanks.

sedlalu2 commented 1 year ago

@nandra Wayland ozone platform.