Closed Bug 2092355 Opened 3 days ago Closed 2 days ago

Firefox 160 regression: WebGL 1/2 context creation fails on NVIDIA Kepler GPU with OCLP (macOS Sonoma)

Categories

(Core :: Graphics: CanvasWebGL, defect)

Firefox 160
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox160 --- wontfix
firefox161 --- fixed
firefox162 --- fixed

People

(Reporter: grogcw, Assigned: jnicol, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(7 files, 2 external files)

Attached file about:support data β€”

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:160.0) Gecko/20100101 Firefox/160.0

Steps to reproduce

Environment:

  • Firefox 160.0
  • macOS Sonoma 14.8.9 (23J631)
  • OpenCore Legacy Patcher 2.4.1
  • NVIDIA GeForce GTX 780M (Kepler), 4 GB VRAM, Metal 2
  • Intel iMac with internal and external displays

Steps to reproduce:

  1. Launch Firefox 160 on the affected system.
  2. Visit https://webglreport.com/.
  3. Check WebGL 1 and WebGL 2 availability.
  4. Alternatively, visit https://wplace.live/, which requires WebGL to render its map.

Additional verification:

  • Firefox ESR 153: WebGL works correctly on the same machine.
  • Google Chrome: WebGL 2 works correctly.
  • WebGL worked in Firefox before the update to version 160.

Actual results

Both WebGL 1 and WebGL 2 are unavailable in Firefox 160.

Firefox fails to create WebGL contexts with the following errors:

Failed to create WebGL context:
* tryANGLE (FEATURE_FAILURE_NO_DISPLAY)
* Exhausted GL driver options.
  (FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS)

Firefox's about:support graphics diagnostics report:

WEBGL
  default: available

WEBRENDER_ANGLE_METAL
  default: available
  env: blocklisted
  FEATURE_FAILURE_METAL_ANGLE_MULTIPLE_GPUS

However, system_profiler SPDisplaysDataType reports only one physical GPU (NVIDIA GTX 780M), driving two displays.

The following configuration changes were tested without success:

  • webgl.force-enabled=true
  • webgl.disable-angle=true
  • gl.allow-high-power=false

The issue appeared immediately after updating to Firefox 160.

Suspected regression:

Possibly related to the switch to Metal/ANGLE for WebGL on macOS introduced in Firefox 160, tracked by:

https://bugzilla.mozilla.org/show_bug.cgi?id=2079810

The previous graphics implementation still works in Firefox ESR on the same system.

Expected results

Firefox should successfully initialize WebGL 1 and WebGL 2 contexts, as it did before upgrading to Firefox 160.

WebGL-dependent applications such as https://wplace.live/ should render correctly.

The same hardware and operating system successfully support WebGL in Firefox ESR and Google Chrome.

Ideally, Firefox should fall back to a compatible graphics backend if the Metal/ANGLE implementation cannot initialize on this configuration.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: CanvasWebGL' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: CanvasWebGL
Product: Firefox → Core
Keywords: regression
Regressed by: 2079810

:jnicol, since you are the author of the regressor, bug 2079810, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(jnicol)

The about:support indicates that webgl.disable-angle was set to true, and that we successfully initialised a WebGL context using CGL. But comment 0 says:

The following configuration changes were tested without success:
...
webgl.disable-angle=true

Can you confirm that setting webgl.disable-angle=true (and restarting the browser) does indeed fix WebGL content?

It appears that Metal ANGLE is not supported on nvidia GPUs: https://searchfox.org/firefox-main/rev/09b86521110cb23b77f5385a0e02aa4013a41f97/third_party/angle/src/libANGLE/renderer/metal/DisplayMtl.mm#149

I wonder what chromium and safari do. Perhaps they fall back to ANGLE's GL backend in that case

Flags: needinfo?(jnicol) → needinfo?(grogcw)
Attached file Chrome 141 about:gpu β€”

I can confirm that webgl.disable-angle=true does not resolves the issue.

Also, chromium is no longer working too since version 152.x, I tried and earlier build (141) and it's working, so it's purely software.

If that's any help, I also attached the about:gpu report from chrome 141, and the about:support from firefox ESR 153.7 which both are working with WebGL 1 &2.

While being tech savy, I'm not by any means a dev, so I can do tests the case may be.

Anyway, thanks for taking care,

Cheers !

Flags: needinfo?(grogcw)

@jnicol

Perhaps they fall back to ANGLE's GL backend in that case

There is little time to fix this for Fx160 to make the dot release. If a fix lands today and gets beta and release uplift requests, we could take it.
There are some other reports on reddit https://old.reddit.com/r/firefox/comments/1xuofzm/firefox_160_broke_google_sheets_and_docs/

Flags: needinfo?(jnicol)
See Also: → 2091902

The reddit reports look like bug 2091596 rather than this one: AMD GPU and causes broken canvas2d rendering. Whereas this one is nVidia specific and WebGL fails to initialise altogether.

I will put together a patch to block ANGLE on nVidia GPUs. Given this comment:

I can confirm that webgl.disable-angle=true does not resolves the issue.

I'm not certain it will fix the issue. But in any case it's the right thing to do and will be low risk.

Flags: needinfo?(jnicol)

ANGLE's Metal backend does not support NVIDIA GPUs, so block Metal ANGLE
WebGL when an NVIDIA GPU is detected.

In theory we could keep it enabled when a non-NVIDIA GPU is also
present, and ensure we always select the non-NVIDIA one. But it has been
observed that GfxInfo will report both an Intel and AMD/NVIDIA adapter
as being present when in actuality only the AMD/NVIDIA GPU is
usable. Therefore out of an abundance of caution we block Metal ANGLE
WebGL when any NVIDIA GPU is detected.

Assignee: nobody → jnicol
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Severity: -- → S4
Severity: S4 → S3

Thinking about this more, S4 was maybe fair. I don't believe any NVIDIA Mac can officially run macOS 12 or later. We already block ANGLE on macOS versions older than that. So anybody affected by this has been mucking about with "OpenCore Legacy Patcher" or something in order to run a more recent OS version on their hardware.

I wonder what chromium and safari do. Perhaps they fall back to ANGLE's GL backend in that case

Chrome until recently did indeed fall back to ANGLE's GL backend. But they recently removed support for that, meaning such users will get no WebGL at all

Clearing tracking, but we could still take a simple patch for the dot release if we get it in time

See Also: 2091902 →
Pushed by jnicol@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6fdb0c8fe620 https://hg.mozilla.org/integration/autoland/rev/60f456e67a3b Block Metal ANGLE WebGL on devices with NVIDIA GPU. r=gfx-reviewers,mac-reviewers,nical,spohl

Additional reports from two more affected OCLP machines, with before/after
about:support data captured from each machine. Happy to test builds on
either machine.

Environment (common to both machines)

  • Browser: Floorp 12.21.2, rebased on Firefox 160.0.1
    (Build ID 20261112140843)
  • OS: macOS 12.7.5 (Machine A) / 12.7.6 (Machine B)
    Monterey (Darwin 21.6.0, x86_64), installed via OpenCore Legacy Patcher 2.5.1.
  • Note: the UA string reports "Mac OS X 10.15"; the kernel version
    (21.6.0) confirms macOS 12.x.

Machines

  • Machine A: MacBook Pro (15-inch, Mid 2012), ModelIdentifier
    MacBookPro9,1 (last non-Retina MacBook Pro) β€” dual GPU: Intel HD
    Graphics 4000 (0x8086:0x0166) + NVIDIA GeForce GT 650M (0x10de:0x0fd5);
    GfxInfo reports BOTH adapters as Active.
  • Machine B: Mac mini (Late 2012), ModelIdentifier Macmini6,2 β€”
    Intel HD Graphics 4000 ONLY (0x8086:0x0166), NO discrete GPU.

Symptoms (identical on both machines)

With default settings (Metal ANGLE active), WebGL 1 and WebGL 2 context
creation both fail:

  • tryANGLE (FEATURE_FAILURE_NO_DISPLAY)
  • Exhausted GL driver options. (FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS)

Setting webgl.disable-angle=true restores WebGL 1 and WebGL 2 on BOTH
machines β€” notably WITHOUT restarting the browser (contexts created after
the pref change use the CGL backend immediately). This also differs from
comment 6, where webgl.disable-angle=true reportedly did NOT resolve the
issue.

  • On Machine A the context initializes via CGL on the DISCRETE NVIDIA
    GPU: "NVIDIA Corporation -- NVIDIA GeForce GT 650M OpenGL Engine",
    driver 4.1 NVIDIA-16.0.12 355.11.11.10.10.143.
  • On Machine B the context initializes via CGL on the Intel HD 4000:
    "Intel Inc. -- Intel HD Graphics 4000 OpenGL Engine", driver
    4.1 INTEL-16.5.14.

This differs from comment 6, where webgl.disable-angle=true reportedly
did NOT resolve the issue.

Attachments

Machine A (MacBookPro9,1):

  1. about:support β€” ANGLE enabled (webgl.disable-angle at its default):
    WebGL 1/2 creation fails via tryANGLE. The Decision Log shows the
    SAME signature as comment 0: WEBRENDER_ANGLE_METAL β€” env: blocklisted
    by gfxInfo (FEATURE_FAILURE_METAL_ANGLE_MULTIPLE_GPUS). Despite this
    blocklist, WebGL context creation still attempts ANGLE and fails β€”
    the gfxInfo blocklist of Metal ANGLE does not protect the WebGL path.
  2. about:support β€” webgl.disable-angle=true, applied without restart:
    WebGL 1/2 both work via CGL (NVIDIA GT 650M, details above).

Machine B (Macmini6,2):
3. about:support β€” ANGLE enabled: WebGL 1/2 creation fails via tryANGLE.
Here the Decision Log differs from comment 0: WEBRENDER_ANGLE_METAL
reads "default: available" (NOT blocklisted), and GfxInfo reports a
single Intel adapter β€” yet the ANGLE/Metal WebGL failure occurs
anyway.
4. about:support β€” webgl.disable-angle=true, applied without restart:
WebGL 1/2 both work via CGL (Intel HD 4000, details above).

Note on the Decision Log: the entry "WEBRENDER_ANGLE: default: disabled"
refers to the WebRender compositor backend, NOT to WebGL; WebGL still
attempts ANGLE regardless of this entry (webgl.disable-angle was at its
default, false, for the broken-state captures).

Observations relevant to patch D342598

  • In favor of the NVIDIA-detection approach: GfxInfo on Machine A
    correctly reports the NVIDIA adapter as present and active (a concern
    raised in comment 9), and the CGL fallback works there, selecting the
    GeForce GT 650M.
  • However: Machine B has NO NVIDIA GPU at all, yet Metal ANGLE WebGL
    fails there too β€” and, unlike the single-GPU NVIDIA case in comment 0,
    WEBRENDER_ANGLE_METAL is not blocklisted there. If this is the same
    failure mode, blocking Metal ANGLE only when an NVIDIA GPU is detected
    may not cover non-NVIDIA OCLP machines (legacy Intel GPUs under OCLP).

Happy to test builds on both machines and report back.

Attachment #9682862 - Attachment description: (MacBookPro9,1): 1. about:support β€” ANGLE enabled (webgl.disable-angle at its default) → (Floorp 160.0.1, MacBookPro9,1, ANGLE enabled β€” WebGL broken).

Confirming the same issue on a different macOS version and GPU vendor:

  • iMac 27" Late 2013, NVIDIA GeForce GTX 780M (Kepler), macOS Sequoia 15.3.2 via OCLP
  • Firefox 160.0 (64-bit): WebGL 1 and 2 both fail with tryANGLE (FEATURE_FAILURE_NO_DISPLAY) / Exhausted GL driver options (FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS)
  • Firefox ESR 153.7.0esr (64-bit) on the same machine: WebGL works
  • macOS was not updated. The breakage started with the Firefox update only.

Workaround confirmed: setting webgl.disable-angle=true restores WebGL on Firefox 160.0 (64-bit) on this NVIDIA Kepler machine (native CGL path), same as comment 17 on Intel HD 4000. So the failing ANGLE path seems to affect both Intel and NVIDIA legacy GPUs, and the CGL fallback is never attempted.

Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

The patch landed in nightly and beta is affected.

:jnicol, please make an uplift decision for beta:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox161 to wontfix if the fix can wait for the next release.

Uplift requests can be submitted from Lando: D342598.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(jnicol)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: No WebGL for certain Mac users. Only affects those with nvidia GPUs running macOS 12 or later, which is believed to only affect users who have used "OpenCore Legacy Patcher" or similar tools to install an unsupported macOS version on their hardware.
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Blocks ANGLE for macOS users with nvidia GPUs, moving them to the old "CGL" path that was default until Firefox 160.
  • String changes made/needed?: N/A
  • Is Android affected?: no
Attachment #9683306 - Flags: approval-mozilla-beta?

ANGLE's Metal backend does not support NVIDIA GPUs, so block Metal ANGLE
WebGL when an NVIDIA GPU is detected.

In theory we could keep it enabled when a non-NVIDIA GPU is also
present, and ensure we always select the non-NVIDIA one. But it has been
observed that GfxInfo will report both an Intel and AMD/NVIDIA adapter
as being present when in actuality only the AMD/NVIDIA GPU is
usable. Therefore out of an abundance of caution we block Metal ANGLE
WebGL when any NVIDIA GPU is detected.

Original Revision: https://phabricator.services.mozilla.com/D342598

Attachment #9683306 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: