Closed Bug 1655026 Opened 1 year ago Closed 1 year ago

[Linux] Enable WebGL DMABuf backend for X11/EGL

Categories

(Core :: Graphics, enhancement)

Desktop
Linux
enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Crash Data

Attachments

(3 files)

Enable WebGL DMABuf backend for X11/EGL.

This is basically Bug 1586696 but for X11.

OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Attachment #9166058 - Attachment description: Bug 1655026 [Linux] Enable WebGL for EGL GL backends, r?jgilbert → Bug 1655026 [Linux] Enable WebGL DMABuf backend for X11/EGL, r?jgilbert

Awesome! Will have a deeper look tomorrow, but on a first glance it looks great!

https://treeherder.mozilla.org/#/jobs?repo=try&revision=0ab1cd36a2dbf0aa10cf263cf806c1a35c0d05c9

Attached file debug.txt

Gnome Wayland, Debian Testing, Intel HD Graphics 630 (KBL GT2), 2560x1440 (one APU, no external GPUs)
$ MOZ_X11_EGL=1 mozregression --repo try --launch 0ab1cd36a2dbf0aa10cf263cf806c1a35c0d05c9 --pref gfx.webrender.all:true layers.gpu-process.enabled:false -a https://webglsamples.org/aquarium/aquarium.html

By performance, it definitely works.
500 fish: ~58 fps (~34 without DMABUF) on a 60 Hz display. After a minute, tab becomes black or crashes.
1000 fish: ~50 fps (31 without)
5000 fish: 26 fps (18 without)
10000 fish: 14 fps (12 without)


$ MOZ_X11_EGL=1 mozregression --repo try --launch 0ab1cd36a2dbf0aa10cf263cf806c1a35c0d05c9 --pref gfx.webrender.all:true layers.gpu-process.enabled:false -a https://webglsamples.org/aquarium/aquarium.html -B debug

It took longer to repro with a debug build. Quotes from attached log:

0:43.12 INFO: b'[Child 8009, Main Thread] WARNING: Failed to create EGLContext with rbab_attribs: file /builds/worker/checkouts/gecko/gfx/gl/GLContextProviderEGL.cpp, line 713'
0:43.12 INFO: b'[Child 8009, Main Thread] WARNING: Failed to create EGLContext with robustness_attribs: file /builds/worker/checkouts/gecko/gfx/gl/GLContextProviderEGL.cpp, line 719'
0:43.12 INFO: b'Initializing context 0x7f30388a6820 surface 0x7f303e1ab800 on display 0x7f303e1a8000'
0:43.12 INFO: b'[Child 8009, Main Thread] WARNING: robust_buffer_access_behavior marked as unsupported: file /builds/worker/checkouts/gecko/gfx/gl/GLContextFeatures.cpp, line 623'
0:43.12 INFO: b'[Child 8009, Main Thread] WARNING: Robustness supported, strategy is not LOSE_CONTEXT_ON_RESET!: file /builds/worker/checkouts/gecko/gfx/gl/GLContext.cpp, line 959'
0:43.12 INFO: b'[Child 8009, Main Thread] WARNING: robustness marked as unsupported: file /builds/worker/checkouts/gecko/gfx/gl/GLContextFeatures.cpp, line 623'
0:43.36 INFO: b'[GFX2-]: glXWaitVideoSync failed to increment the sync counter.'

This seems to be the moment it became black:

7:56.13 INFO: b'[Child 8009, Main Thread] WARNING: Failed to duplicate file handle for other process!: file /builds/worker/checkouts/gecko/ipc/glue/FileDescriptor.cpp, line 79'
7:56.13 INFO: b'IPDL protocol Error: Received an invalid file descriptor'

[...]

7:57.14 INFO: b'[Parent 7774, Renderer] WARNING: EGLImageKHR creation failed: file /builds/worker/checkouts/gecko/widget/gtk/DMABufSurface.cpp, line 544'
7:57.14 INFO: b'[2020-07-25T13:02:23Z WARN webrender::renderer] Invalid ext-image'
7:57.21 INFO: b'[Child 8009, Main Thread] WARNING: Failed to duplicate file handle for current process!: file /builds/worker/checkouts/gecko/ipc/glue/FileDescriptor.cpp, line 124'
7:57.21 INFO: b'IPDL protocol Error: Received an invalid file descriptor'
7:57.21 INFO: b'IPDL protocol Error: Received an invalid file descriptor'
7:57.21 INFO: b'[Parent 7774, Renderer] WARNING: EGLImageKHR creation failed: file /builds/worker/checkouts/gecko/widget/gtk/DMABufSurface.cpp, line 544'
7:57.21 INFO: b'[2020-07-25T13:02:23Z WARN webrender::renderer] Invalid ext-image'

(In reply to Jan Andre Ikenmeyer [:darkspirit] from comment #5)

...
After a minute, tab becomes black or crashes.
...

Interesting. I can't reproduce that here - did you check already if it only happens with the EGL backend or also on Wayland, with the same build?

Pushed by abutkovits@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ffcc87593328
[Linux] Move dmabuf format setup from nsWaylandDisplay to nsDMABufDevice, r=rmader
See Also: → 1655323

(In reply to Robert Mader [:rmader] from comment #6)

Interesting. I can't reproduce that here - did you check already if it only happens with the EGL backend or also on Wayland, with the same build?

Yes, reproducible for me with MOZ_X11_EGL=1 and MOZ_ENABLE_WAYLAND=1: bug 1655323
It would still be good to enable DMABUF WebGL for users of experimental MOZ_X11_EGL=1 env var.

Keywords: leave-open
Depends on: 1656505
Duplicate of this bug: 1655090
Crash Signature: [@ mozilla::layers::DMABUFTextureData::FillInfo]
No longer depends on: 1656505
Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5e401631f3ef
[Linux] Enable WebGL DMABuf backend for X11/EGL, r=jgilbert

Should be fixed now.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Regressions: 1729656
You need to log in before you can comment on or make changes to this bug.