electron: [Bug]: Zero GPU Acceleration on Wayland

Preflight Checklist

Electron Version

22.0.0

What operating system are you using?

Other Linux

Operating System Version

Linux apg 6.0.11-arch1-g14-1 #1 SMP PREEMPT_DYNAMIC Wed, 07 Dec 2022 16:24:00 +0000 x86_64 GNU/Linux

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

I expect content rendered in Electron to use the GPU to display graphics, and accelerate video.

Actual Behavior

No content inside of Electron seems to be accelerated through the GPU.

Testcase Gist URL

No response

Additional Information

This only occurs when running Electron using the Wayland backend. When running under XWayland, acceleration appears to be functional. I am passing the following flags to Electron:

--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-gpu
--enable-unsafe-webgpu
--enable-features=WebRTCPipeWireCapturer,Vulkan,UseSkiaRenderer,VaapiVideoDecoder,CanvasOopRasterization,VaapiVideoEncoder,RawDraw
--disable-features=UseSkiaRenderer,UseChromeOSDirectVideoDecoder
--enable-zero-copy
--enable-oop-rasterization
--enable-raw-draw
--enable-accelerated-mjpeg-decode
--enable-accelerated-video 
--enable-native-gpu-memory-buffers
--use-vulkan
--use-gl=egl
--ozone-platform-hint=auto

These flags allow Chromium to accelerate: image

This issue affects Electron 20, 21, and 22 in my testing. I am applying these flags to Electron through adding them here and launching WebCord (a Discord client) with Electron 22, then fullscreening a video. I see a CPU core immediately go to 100% usage, and the video playback is laggy and drops frames.

My system is Arch Linux with a Ryzen 9 6900HS and RX 6800M GPU under the open source AMD drivers.

I have attached logs for both Electron 20 and Electron 22: logs22.txt logs20.txt

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 15
  • Comments: 17 (2 by maintainers)

Most upvoted comments

If I had any knowledge of how to contribute to Electron, I’d make this my top priority issue to fix, given that Wayland should already be the default experience for Linux users on certain distros, and adoption will only increase. A wide class of applications perform badly due to lack of GPU acceleration on Wayland, and as a result of this bug I have personally committed to not developing applications with Electron for Dense Analysis for the moment to avoid the bug.

still an issue on the latest electron release. Approaching the 1 year mark now.

Do we have any idea on a timeline for when that would be?

Bump

On Sun, Apr 7, 2024, 04:50 electron-issue-triage[bot] < @.***> wrote:

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, “bump”), and we’ll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron https://www.electronjs.org/releases/stable or in the beta https://www.electronjs.org/releases/beta—please include it with your comment!

— Reply to this email directly, view it on GitHub https://github.com/electron/electron/issues/36633#issuecomment-2041271991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGEVVBMJ62DFVOBMVKSWXQDY4CQ5VAVCNFSM6AAAAAAS2L7Z66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGI3TCOJZGE . You are receiving this because you commented.Message ID: @.***>

This is probably going to be improved once Electron pulls in a Chromium revision with the recent libva-drm changes.

Ref: https://www.phoronix.com/news/Google-Chrome-Wayland-VA-API

Also happening for me on wayland via kwin

Nvidia 3060, 545.23.06 driver. Still an issue ;_;