OSSystems / meta-browser

OpenEmbedded/Yocto BSP layer for Web Browsers
MIT License
186 stars 195 forks source link

chromium-ozone-wayland: eglCreateContext: Requested version is not supported #849

Open MastaG opened 1 week ago

MastaG commented 1 week ago

When I run chromium-ozone-wayland on my armv7 board using the Panfrost mesa drivers, I always get the following error:

ERROR:gl_display.cc(497)] EGL Driver message (Error) eglCreateContext: Requested version is not supported

The browser runs fine otherwise and seems fully accelerated except for WebGL. Is it possible I could get more verbose information regarding the above error? My chromium flags: --ozone-platform=wayland --enable-wayland-ime --use-gl=angle --use-angle=gles-egl --use-cmd-decoder=passthrough --ignore-gpu-blocklist --ignore-gpu-blacklist --enable-accelerated-video-decode --enable-features=VaapiVideoDecoder,VaapiVideoEncoder --gtk-version=4 --disable-gpu-memory-buffer-video-frames

By the way: --use-gl=egl doesn't seem to work anymore and needs to be replaced with: --use-gl=angle --use-angle=gles-egl or --use-gl=angle --use-angle=gl-egl

msisov commented 1 week ago

It might be related to Angle. Please see https://issues.chromium.org/issues/326752458 .

I wonder what happens if you try use desktop implementation via --use-angle=gl-egl

MastaG commented 1 week ago

With --use-angle=gl-egl I'm getting the same EGL error. Is it possible to compile Chromium with legacy EGL support (--use-gl=egl)? Because Angle doesn't seem to work for my platform.

msisov commented 6 days ago

With --use-angle=gl-egl I'm getting the same EGL error. Is it possible to compile Chromium with legacy EGL support (--use-gl=egl)? Because Angle doesn't seem to work for my platform.

Can you try https://github.com/OSSystems/meta-browser/pull/850 ?

MastaG commented 6 days ago

Yes I can only run with Angle now. So I only have --use-angle=gles-egl. When I use --use-gl=egl I'm getting a message that it isn't supported any longer.

Hardware acceleration works for the most part when using Angle. It's just that it will display the: ERROR:gl_display.cc(497)] EGL Driver message (Error) eglCreateContext: Requested version is not supported twice. And WebGL seems to only thing that fails to work.

See the report:

about-gpu-2024-11-19T11-15-51-085Z.txt

msisov commented 6 days ago

Can you try --use-angle=gl-egl ?

MastaG commented 6 days ago

Interesting, with --use-angle=gl-egl I'm getting the same error (twice) when starting the browser:

ERROR:gl_display.cc(497)] EGL Driver message (Error) eglCreateContext: Requested version is not supported

But when I check the report: about-gpu-2024-11-19T14-00-49-060Z.txt

I can see that Angle still decided to use the OpenGL ES Mesa driver instead of regular GL. Everything else seems to be accelerated like before.

Now when I try to display the WebGL aquarium demo, I'll get the following error on the console:

ERROR:context_group.cc(179)] ContextResult::kFatalFailure: ES3 is blocklisted/disabled/unsupported by driver.

The webpage itself will display:

Status: Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, GL_VENDOR = Google Inc. (Mesa), GL_RENDERER = ANGLE (Mesa, Mali-T620 (Panfrost), OpenGL ES 2.0 Mesa 24.2.3-1ubuntu1), GL_VERSION = 24.2.3, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = BindToCurrentSequence failed: .

So if I understand it correctly, it seems that Angle decided to use the Mesa OpenGLES driver instead of the regular GL driver. And OpenGLES is "blocklisted/disabled/unsupported" for use with Angle for WebGL?

The question I have it, why didn't it select the regular GL driver instead:

OpenGL vendor string: Mesa
OpenGL renderer string: Mali-T620 (Panfrost)
OpenGL version string: 2.1 Mesa 24.2.3-1ubuntu1
OpenGL shading language version string: 1.20 

Perhaps the supported version GL version 2.1 is not sufficient for Angle/WebGL ?

MastaG commented 6 days ago

Yeah that's probably it. I now reckon that the Mesa Panfrost driver for me Mali GPU, only supports OpenGLES 2.0 and OpenGL 2.1.

I've switched to the proprietary binary driver from ARM which unfortunately only supports OpenGLES 3.1 on X11 and WebGL is working just fine when running on the Ozone X11 platform.

So the reason for the ERROR:gl_display.cc(497)] EGL Driver message (Error) eglCreateContext: Requested version is not supported is probably OpenGL/ES 3.x or higher missing from the Mesa driver.

So I can confirm that the change in PR https://github.com/OSSystems/meta-browser/pull/850 works across both X11 and Wayland. It's just that my platform is missing OpenGL/ES 3.x on Wayland being a requirement for WebGL.

MaxIhlenfeldt commented 4 days ago

Does https://webglsamples.org/aquarium/aquarium.html work for you? afaict that's using WebGL 1, and that should only require OpenGL ES 2.0 according to MDN.

MastaG commented 4 days ago

Does https://webglsamples.org/aquarium/aquarium.html work for you? afaict that's using WebGL 1, and that should only require OpenGL ES 2.0 according to MDN.

That was the exactly the demo I was trying. However when I run chromium using the Mesa Panfrost driver (GL2.1 ES2.0), the "ERROR:gl_display.cc(497)] EGL Driver message (Error) eglCreateContext: Requested version is not supported" will print immediately on the terminal when starting the browser. I've tried both --use-angle=gles-egl and --use-angle=gl-egl. This probably means that Angle isn't happy about it.

Then when I open the aquarium demo, the webpage will display: Status: Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, GL_VENDOR = Google Inc. (Mesa), GL_RENDERER = ANGLE (Mesa, Mali-T620 (Panfrost), OpenGL ES 2.0 Mesa 24.2.3-1ubuntu1), GL_VERSION = 24.2.3, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = BindToCurrentSequence failed: . While the terminal will say: ERROR:context_group.cc(179)] ContextResult::kFatalFailure: ES3 is blocklisted/disabled/unsupported by driver.

That's why I think Angle will fail to initialize the WebGL backend, because I don't have OpenGL(ES) 3.x or higher.