X11/EGL/Nvidia: Only ship EGL on Xwayland
Categories
(Core :: Graphics: WebRender, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: rmader, Assigned: rmader)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
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).
Assignee | ||
Comment 1•3 years ago
|
||
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).
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 2•3 years ago
|
||
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:
- Ubuntu and Fedora don't take this code path at the moment.
Ubuntu 21.10 will switch to a Mozilla-provided Snap (bug 1665641), so it might unship MOZ_ENABLE_WAYLAND and take this official code path (unless bug 1543600, bug 1587060, bug 1633989 have been fixed until then). - Status quo: Firefox 92 users can manually enable gfx.webrender.all and then run into bug 1635186 comment 49. It can be fixed with MOZ_X11_EGL.
- Mesa (bug 1695933 + bug 1730671): HW WR can ship with MOZ_X11_EGL.
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.
- bug 1716049 and all dupes definitely occur with GLX, feedback and own testing indicated that EGL fixes it. Exception: bug 1703529
- bug 1714633 comment 27 seemed to have the desired behavior with EGL.
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.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
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.
Updated•3 years ago
|
Comment 5•3 years ago
|
||
bugherder |
Description
•