eglInitialize fails in Chromium release/official build (wayland backend)

155 views
Skip to first unread message

Muralitharan Perumal

unread,
May 29, 2024, 9:58:07 AMMay 29
to Chromium-dev
Hi,

I tried building chromium with ozone wayland with the following args:

ozone_auto_platforms = false
ozone_platform_wayland = true
ozone_platform_headless = true
target_os = "linux"
target_cpu = "arm"
target_sysroot = "custom toolchain"
use_cups = false
has_native_accessibility = false
has_platform_accessibility_support = false
enable_accessibility_service = false
use_glib = false
use_gtk = false
rtc_use_pipewire = false
use_qt = false
dawn_enable_vulkan = false
dawn_use_swiftshader = false
enable_swiftshader = false
enable_swiftshader_vulkan = false
use_libpci = false
angle_enable_swiftshader = false
use_system_libffi = true
use_kerberos = false
use_system_minigbm = false
use_nss_certs = true
enable_validating_command_decoder = false
use_v8_context_snapshot = false
enable_gpu_client_logging = false
angle_use_wayland = false
use_wayland_gbm = false
is_debug = true
is_component_build = true
is_official_build = false

And with this I can launch chrome browser with westeros display server.
XDG_RUNTIME_DIR=/tmp WAYLAND_DISPLAY=westeros-chromium WAYLAND_DEBUG=1 ./chrome --no-sandbox --use-gl=egl --ozone-platform=wayland --in-process-gpu --window-size=1920,1080

But when I do the official or release build, we see 'eglInitialize' call is failing:

Release build
--------------
is_component_build = false
is_official_build = false
is_debug = false

Official build
--------------
is_official_build = true

[11282:11308:0517/161914.948920:ERROR:gl_display.cc(787)] eglInitialize Default failed with error EGL_NOT_INITIALIZED
[11282:11308:0517/161914.948996:ERROR:gl_display.cc(822)] Initialization of all EGL display types failed.
[11282:11308:0517/161914.949036:ERROR:gl_ozone_egl.cc(27)] GLDisplayEGL::Initialize failed.


Here is my args for official build:

ozone_auto_platforms = false
ozone_platform_wayland = true
ozone_platform_headless = false
target_os = "linux"
target_cpu = "arm"
target_sysroot = "custom toolchain"
use_cups = false
has_native_accessibility = false
has_platform_accessibility_support = false
enable_accessibility_service = false
use_glib = false
use_gtk = false
rtc_use_pipewire = false
use_qt = false
dawn_enable_vulkan = false
dawn_use_swiftshader = false
enable_swiftshader = false
enable_swiftshader_vulkan = false
use_libpci = false
angle_enable_swiftshader = false
use_system_libffi = true
use_kerberos = false
use_system_minigbm = false
use_nss_certs = false
enable_validating_command_decoder = false
use_v8_context_snapshot = false
enable_gpu_client_logging = false
angle_use_wayland = false
use_wayland_gbm = false
is_debug = false
symbol_level = 0
v8_symbol_level = 0
blink_symbol_level = 0
enable_nacl = false
is_official_build = true
chrome_pgo_phase = 0
enable_vulkan = false

This is the simpler version of the calls:

   struct wl_display *display = wl_display_connect(NULL);
    if (!display) {
        fprintf(stderr, "Failed to connect to Wayland display.\n");
        return -1;
    }

EGLDisplay egl_display = eglGetDisplay((NativeDisplayType)display);
    if (egl_display == EGL_NO_DISPLAY) {
        EGLint error = eglGetError();
        fprintf(stderr, "Failed to get EGL display. Error code: 0x%x\n", error);
        wl_display_disconnect(display);
        return -1;
    }

if (eglInitialize(egl_display, NULL, NULL) == EGL_FALSE) {
        EGLint error = eglGetError();
        fprintf(stderr, "Failed to initialize EGL. Error code: 0x%x\n", error);
        wl_display_disconnect(display);
        return -1;
    }

Even though our custom graphics library remains the same (closed source), I feel there is some chromium optimization that is triggering this type of behaviour.

Any hint or input will be very helpful. 

Muralitharan Perumal

unread,
Jun 18, 2024, 1:28:22 PMJun 18
to Chromium-dev, Muralitharan Perumal
This particular problem is nothing to do with release or debug build but between component and monolith images. 

I am able to resolve the issue by selectively linking the chrome binary with dynamic wayland_client lib so that the platform gpu library will use the same as to avoid the memory corruption when passing the wl_display created by the library. 

Thanks,
-M

Reply all
Reply to author
Forward
0 new messages