Closed Bug 1732002 Opened 3 years ago Closed 3 years ago

X11/EGL/Nvidia: Only ship EGL on Xwayland

Categories

(Core :: Graphics: WebRender, task)

Unspecified
Linux
task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: rmader, Assigned: rmader)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The Nvidia driver does not yet support EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV, triggering bug 1731172 (see bug 1731172 comment 13). In Wayland sessions, however, setups currently need to have the alternative (and more involved) solution around NVreg_PreserveVideoMemoryAllocations configured to not run into similar issues for the whole desktop.

This is not the case for most Xorg setups, thus don't ship EGL there for now. We can enable it again once either EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV is supported or NVreg_PreserveVideoMemoryAllocations is the default (and detectable).

The Nvidia driver does not yet support EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV,
triggering bug 1731172 (see bug 1731172 comment 13).
In Wayland sessions, however, setups currently need to have the alternative
(and more involved) solution around NVreg_PreserveVideoMemoryAllocations
configured to not run into similar issues for the whole desktop.

This is not the case for most Xorg setups, thus don't ship EGL there for now.
We can enable it again once either EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV
is supported or NVreg_PreserveVideoMemoryAllocations is the default (and
detectable).

Type: enhancement → task

Overview

Security:
Can widget.dmabuf-webgl.enabled be officially shipped without being tested in CI? Is having ASan Nightly, daily usage and past code review enough for confidence? Ubuntu and Fedora have already been shipping it downstream for a long time by enabling MOZ_ENABLE_WAYLAND=1 on Wayland. (Confirmed with Ubuntu 21.04, Gnome Wayland on Intel and $ firefox: about:support says wayland and widget.dmabuf-webgl.enabled is enabled.)
Or should widget.dmabuf-webgl.enabled be restricted to Beta and Nighty until bug 1725245 has been done? But Ubuntu and Fedora users would perceive it as drastic performance regression.

Xwayland:

X11+Xwayland/Nvidia:
Theoretically we could trade bugs.
GLX status quo has been low fps with multiple windows (can be fixed with layout.frame_rate=0), but flawless suspend&resume.

vs.

  • bug 1731172 occurs after suspend/resume or when switching virtual terminals (e.g. Ctrl+Alt+F6, Ctrl+Alt+F7).
    • Gnome Wayland itself runs into this bug. Then it really doesn't seem to matter if Firefox does it as well on Xwayland.
    • X11: EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV is not implemented by the Nvidia driver yet:
      Users can fix suspend&resume by enabling NVreg_PreserveVideoMemoryAllocations=1 and Nvidia's systemd service. (bug 1515253 comment 18)
    • Ubuntu should make sure that the nvidia-driver-470 package also installs Nvidia's systemd service.
    • PopOS does it already for WebRender.
  • bug 1731125, bug 1716114, bug 1677314 could be solved by fixing GLContextEGL::FindVisual() or by enforcing SW WR for popups on non-Mesa EGL.

Can widget.dmabuf-webgl.enabled be officially shipped without being tested in CI?

I don't think DmaBuf a big security concern here - and I also don't see how the CI would help much. It has been enabled in Fedora for quite some time, so regular crashes should have been caught by now. Sophisticated attackers can of course still find issues, but I guess the WebGL and driver attack surface is much bigger - security minded people should just have WebGL disabled until the whole stack is more robust.

Concerning bug 1716049 (and friends) vs bug 1731172 (and friends): I'd say new bugs are worse than existing bugs. Thus:

We can enable it again once either EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV is supported or NVreg_PreserveVideoMemoryAllocations is the default (and detectable).

I don't think that distributions should do that. Once Nvidia finds that the option is ready, they will likely make it the default. But that will take time, I'm afraid, nothing we can push for the 94 release.

Pushed by robert.mader@posteo.de: https://hg.mozilla.org/integration/autoland/rev/f835c13c3914 Disable EGL on Nvidia on X11 in beta and release, r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Regressions: 1735091
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: