You are not logged in.

#1 2022-11-11 18:39:46

TheSunCat
Member
Registered: 2021-12-22
Posts: 25

Hardware acceleration on Electron

Hi! I'm using Wayland on my laptop due to needing fractional scaling, and everything so far has been great, except for battery life when using any Electron app in native Wayland mode. Testing in Chromium, I see everything disabled in chrome://gpu:
All types of acceleration are disabled

Meanwhile, starting Chromium in XWayland mode yields very blurry text (due to fractional scaling) but almost everything green:
All acceleration except WebGPU available


I'm running a Zephyrus G14 GA402RJ laptop, which has an AMD iGPU and dGPU, and using the following flags on both Chromium and Electron:

--use-vulkan
--use-gl=egl
--enable-zero-copy
--enable-hardware-overlays
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,CanvasOopRasterization,VaapiIgnoreDriverChecks
--disable-features=UseSkiaRenderer,UseChromeOSDirectVideoDecoder
--ignore-gpu-blocklist

# comment this out to run blurry in XWayland, where GPU acceleration works
--ozone-platform=wayland

One thing of note is that running chromium prints a bunch of errors, while running electron prints fewer.

What am I doing wrong? I've followed the ArchWiki article, have chromium-wayland-vaapi installed (but no equivalent Electron package), yet it's very much not working.
I'm testing whether hardware acceleration works on Electron by building WebCord with my flags added here (also printing out a message to make sure this code is running, which it is), and joining a video call or playing a fullscreen video. My CPU usage spikes and it heats up pretty much instantly, confirming this is not hardware accelerated.

Offline

Board footer

Powered by FluxBB