Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firefox-wrapper: rename gdkWayland->forceWayland; always use libglvnd #73365

Merged
merged 2 commits into from Jul 11, 2020

Conversation

colemickens
Copy link
Member

Motivation for this change

Without this change, when starting Firefox with WebRender enabled, the default standard out/err is filled with errors.

Further, this cleans up some old remnants of what looks like early Firefox Wayland support that is no longer needed. I'm not even sure libglvnd needs to be optional.

Note: I'm not sure if I need to do this differently, or make more changes, for backward compat purposes?

A somewhat clipped log when starting Firefox (with WebRender enabled) without my change:

Attempting load of libEGL.so
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) [GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) [GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) [GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) [GFX1-]: Failed to get shared GL context
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) [GFX1-]: Failed to load EGL library 3!
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) [GFX1-]: Failed GL context creation for WebRender: 0
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) [GFX1-]: Failed to connect WebRenderBridgeChild.
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) |[7][GFX1-]: Failed to load EGL library 3! (t=0.578314) [GFX1-]: Failed to load EGL library 3!
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) |[7][GFX1-]: Failed to load EGL library 3! (t=0.578314) |[8][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.578345) [GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT

(firefox:15570): dbind-WARNING **: 14:11:12.546: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) |[7][GFX1-]: Failed to load EGL library 3! (t=0.578314) |[8][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.578345) |[9][GFX1-]: Failed to load EGL library 3! (t=0.718512) [GFX1-]: Failed to load EGL library 3!
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) |[7][GFX1-]: Failed to load EGL library 3! (t=0.578314) |[8][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.578345) |[9][GFX1-]: Failed to load EGL library 3! (t=0.718512) |[10][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.718559) [GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) |[7][GFX1-]: Failed to load EGL library 3! (t=0.578314) |[8][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.578345) |[9][GFX1-]: Failed to load EGL library 3! (t=0.718512) |[10][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.718559) |[11][GFX1-]: Failed to load EGL library 3! (t=1.32254) [GFX1-]: Failed to load EGL library 3!
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) |[7][GFX1-]: Failed to load EGL library 3! (t=0.578314) |[8][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.578345) |[9][GFX1-]: Failed to load EGL library 3! (t=0.718512) |[10][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=0.718559) |[11][GFX1-]: Failed to load EGL library 3! (t=1.32254) |[12][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=1.32258) [GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT
JavaScript error: , line 0: uncaught exception: Object
JavaScript error: , line 0: uncaught exception: Object
JavaScript error: moz-extension://8a7dccdd-9a4d-4fda-a8bf-79a1c0e60b17/common/sidebar-connection.js, line 89: Error: Attempt to postMessage on disconnected port
JavaScript error: moz-extension://8a7dccdd-9a4d-4fda-a8bf-79a1c0e60b17/common/sidebar-connection.js, line 89: Error: Attempt to postMessage on disconnected port
JavaScript warning: https://open.scdn.co/static/vendor.38438abe.js, line 0: Successfully compiled asm.js code (total compilation time 1ms)
JavaScript error: resource://gre/modules/WebNavigationContent.js, line 271: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIWebProgress.DOMWindow]
Extension error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowUtils.removeSheet]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/modules/ExtensionCommon.jsm :: runSafeSyncWithoutClone :: line 75"  data: no] undefined 75
[[Exception stack
runSafeSyncWithoutClone@resource://gre/modules/ExtensionCommon.jsm:75:12
cleanup/<@resource://gre/modules/ExtensionContent.jsm:413:36
Current stack
runSafeSyncWithoutClone@resource://gre/modules/ExtensionCommon.jsm:81:9
cleanup/<@resource://gre/modules/ExtensionContent.jsm:413:36
]]
Exiting due to channel error.
Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=9.81542) Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
[Child 15820, Chrome_ChildThread] WARNING: pipe error: Broken pipe: file /build/firefox-70.0.1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 728
[clipped]
[Child 15820, Chrome_ChildThread] WARNING: pipe error (3): Connection reset by peer: file /build/firefox-70.0.1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
Exiting due to channel error.
Exiting due to channel error.
Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=13.6711) 

Note this one: Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226486) |[1][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.226627) |[2][GFX1-]: Failed to load EGL library: FEATURE_FAILURE_EGL_LOAD_3 (t=0.577772) |[3][GFX1-]: Failed to get shared GL context (t=0.577814) |[4][GFX1-]: Failed to load EGL library 3! (t=0.577919) |[5][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.577936) |[6][GFX1-]: Failed to connect WebRenderBridgeChild. (t=0.578027) |[7][GFX1-]: Failed to load EGL library 3! (t=0.578314).

Afterward, the complete, non-clipped log is:

Attempting load of libEGL.so

(firefox:16916): dbind-WARNING **: 14:13:40.153: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
1573683220602	addons.webextension.treestyletab@piro.sakura.ne.jp	WARN	Loading extension 'treestyletab@piro.sakura.ne.jp': Reading manifest: Error processing variable_color_icons: An unexpected property was found in the WebExtension manifest.
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: We don't have EGLSurface to draw into. Called too early? (t=3.02578) [GFX1-]: We don't have EGLSurface to draw into. Called too early?
JavaScript error: , line 0: uncaught exception: Object
JavaScript error: , line 0: uncaught exception: Object
JavaScript error: , line 0: uncaught exception: Object
JavaScript error: , line 0: uncaught exception: Object
JavaScript error: moz-extension://8a7dccdd-9a4d-4fda-a8bf-79a1c0e60b17/common/sidebar-connection.js, line 89: Error: Attempt to postMessage on disconnected port
JavaScript warning: https://open.scdn.co/static/vendor.38438abe.js, line 0: Successfully compiled asm.js code (total compilation time 2ms)
JavaScript error: resource://gre/modules/WebNavigationContent.js, line 271: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIWebProgress.DOMWindow]
Extension error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowUtils.removeSheet]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/modules/ExtensionCommon.jsm :: runSafeSyncWithoutClone :: line 75"  data: no] undefined 75
[[Exception stack
runSafeSyncWithoutClone@resource://gre/modules/ExtensionCommon.jsm:75:12
cleanup/<@resource://gre/modules/ExtensionContent.jsm:413:36
Current stack
runSafeSyncWithoutClone@resource://gre/modules/ExtensionCommon.jsm:81:9
cleanup/<@resource://gre/modules/ExtensionContent.jsm:413:36
]]
Exiting due to channel error.
[Child 17213, Chrome_ChildThread] WARNING: pipe error (3): Connection reset by peer: file /build/firefox-70.0.1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=11.6343) [Child 17091, Chrome_ChildThread] WARNING: pipe error (44): Connection reset by peer: file /build/firefox-70.0.1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
[Child 17091, Chrome_ChildThread] WARNING: pipe error (54): Connection reset by peer: file /build/firefox-70.0.1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
[Child 17091, Chrome_ChildThread] WARNING: pipe error (3): Connection reset by peer: file /build/firefox-70.0.1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
Exiting due to channel error.
Exiting due to channel error.

More verification that this is doing something good is still a wip.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@adisbladis
Copy link
Member

FYI libglvnd is becoming a propagated input of libGL https://github.com/NixOS/nixpkgs/pull/72999/files#diff-183f9a17793cc3d409a82e827a38a21dR54

@colemickens
Copy link
Member Author

@adisbladis Does that just make this PR redundant then? I don't fully understand GL, let alone GL in Nix, or propagated inputs, embarrassingly.

If so, I'll pull those commits and test and can close this out. Thanks for the heads up.

@jonringer
Copy link
Contributor

IIRC, compiled propagated build inputs do not work well with cross builds

@colemickens
Copy link
Member Author

colemickens commented Jan 30, 2020

It's been a couple of months and I can confirm that this commit is still required to get WebGL (https://get.webgl.org) working with Firefox stable on nixos-unstable with Intel/iris graphics.

Or if there's a better way to solve this, I can update the PR?

Thanks!

EDIT: This is the output without libglvnd available to Firefox:

firefox -p stable

(firefox:15212): dbind-WARNING **: 00:26:31.077: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Attempting load of libEGL.so
JavaScript warning: https://get.webgl.org/, line 193: Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL creation failed: 
* tryNativeGL
* Exhausted GL driver options.
JavaScript warning: https://get.webgl.org/, line 197: Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL creation failed: 
* tryNativeGL
* Exhausted GL driver options.

@colemickens
Copy link
Member Author

(Also, I'm new to nix-review but it did pass for this PR (nix-review pr 73365).)

@worldofpeace
Copy link
Contributor

@colemickens I've just visited the website you mentioned. It reports 'Your browser supports WebGL`, and I don't see any of those errors in the console. This machine isn't using iris though, so I'm betting somehow that has something to do with.

@colemickens
Copy link
Member Author

Strange. I disabled Iris and restarted Sway and starting Firefox from a terminal still absolutely fills my console with "Failed to load EGL library 3!" etc, and the same error specifically on webgl.org:

Attempting load of libEGL.so
JavaScript warning: https://get.webgl.org/, line 193: Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL creation failed: 
* tryNativeGL
* Exhausted GL driver options.
JavaScript warning: https://get.webgl.org/, line 197: Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL creation failed: 
* tryNativeGL
* Exhausted GL driver options.

To be clear:

$ env | grep MESA_

[nothing]

@colemickens colemickens changed the title firefox-wrapper: use libglvnd firefox-wrapper: rename gdkWayland->forceWayland; always use libglvnd Jul 7, 2020
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/hardware-acceleration-on-firefox/7947/9

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/hardware-acceleration-on-firefox/7947/11

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM

didn't test though

@flokli flokli merged commit 1b78e0e into NixOS:master Jul 11, 2020
@colemickens colemickens deleted the nixpkgs-firefox-libglvnd branch December 30, 2022 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants