"WebGL not supported" with Chrome 114 and Fedora 38 (Kernel 6.3.8)

I get an “WebGL not supported” error for any Babylon.js page (e.g. https://www.babylonjs-playground.com/). Any other WebGL content (e.g. three.js) works just fine.

Tried different Babylon.js versions, WebGL, WebGL2… same issue.

Here’s the console error:

rendererComponent.tsx:364 Error: WebGL not supported
    at t.e (thinEngine.ts:954:23)
    at new t (engine.ts:584:9)
    at t.createDefaultEngine (rendererComponent.tsx:151:28)
    at asyncEngineCreation (<anonymous>:40:32)
    at window.initFunction (<anonymous>:44:43)
    at R._compileAndRunAsync (rendererComponent.tsx:295:36) 'Retrying if possible. If this error persists please notify the team.'

Fedora 38, 64 bit
Chrome 114.0.5735.198
Kernel 6.3.8
Intel Xe graphics driver

Can you try to browse this page and see if that works: https://webglreport.com/

We don’t do anything fancy to get the webgl context:

try {
    this._gl = <WebGL2RenderingContext>(canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options));
} catch (e) {
    throw new Error("WebGL not supported");

Maybe some options are not supported by your system…

Try to change the options you pass to the engine creation and see if that helps.

Also, this thread could help:

Thanks for the suggestions.

Already tried WebGL(2) report and everything looks fine IMHO (just like any other WebGL test page I could find):

Platform: Linux x86_64
Browser User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36
Context Name: webgl2
GL Version: WebGL 2.0 (OpenGL ES 3.0 Chromium)
Shading Language Version: WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium)
Vendor: WebKit
Renderer: WebKit WebGL
Unmasked Vendor: Google Inc. (Intel)
Unmasked Renderer: ANGLE (Intel, Vulkan 1.3.246 (Intel(R) Xe Graphics (TGL GT2) (0x00009A49)), Intel open-source Mesa driver)
Antialiasing: Available
Major Performance Caveat: No

It used to work for a year now on the same machine. Relevant stuff that recently changed: kernel went from 6.2 to 6.3 and Chrome got its usual updates.

Before the error message shown above, I get the following line: “Failed to create WebGPU Context Provider”

Why is it trying to use WebGPU if WebGL or WebGL2 is selected?

Everything works with Chromium 114.0.5735.133 (Official Build) Fedora Project (64-bit).

Judging by the chrome://gpu output, Chromium is not using Vulkan (Chrome does). :thinking:

For some reason (Chrome update?) chrome://flags/#enable-vulkan was no longer disabled. Disabling fixed the issue. So it’s actually related to Babylonjs not working on Chrome 108.0.5359.94 - #9 by 7om

Thanks for bearing with me. :heart:

Still, Babylon.js seems to either be more picky or has very specific requirements about the WebGL context because virtually any other WebGL page works with the Vulkan driver enabled.

If any dev wants to dig deeper, I’m all in… :wink:

As said above, we create the context in a straightforward way…

You can try to change the options to see if it works better: alpha, antialias, premultipliedAlpha, preserveDrawingBuffer, stencil.

We enable a number of properties by default in the playground (stencil=true, preserveDrawingBuffer=true, antialias=true), it’s possible that one of them is the problem. I seem to recall that Threejs uses preserveDrawingBuffer=false by default, so you should try first to set it to false and see if that helps.