You are not logged in.

#1 2023-02-25 23:14:46

taylor85345
Member
Registered: 2021-10-04
Posts: 3

Electron Wayland with Radeon HW Acceleration causes system freeze

TLDR: Running any Electron application under any Wayland compositor using the --ozone-platform-hint=wayland flag causes an almost immediate and unrecoverable system freeze. This does NOT occur when the application is run via Nvidia PRIME, so It is likely related to my Radeon iGPU driver setup.

I recently replaced my Legion 5i (Intel i7 10750H + Nvidia GTX 1660Ti) Laptop with a nearly identical Legion 5 (AMD Ryzen 5 4600H + Nvidia GTX 1660Ti). Rather than deal with a fresh install, I decided to swap the SSDs between the two machines. On first boot into Hyprland, with no AMD-specific packages installed outside of the basic Mesa drivers, my system froze immediately upon launching any Electron app, which I ultimately tracked down to my electron-flags.conf file which set the --ozone-platform-hint=auto flag. Removing this flag and allowing the apps to launch in Xwayland resolved the freezing issue.

I've since tested with various combinations of AMD/Radeon specific driver packages installed, and have not seen any change in this behavior. I have also tested in a variety of Wayland compositors (Hyprland, Sway, River, KDE Plasma) to rule out any compositor-specific bug.

I have noted that the same issue occurs with Chromium and derivative browsers (i.e. Brave) exclusively when Hardware Acceleration is enabled, though the chances of a freeze occuring seem significantly lower, and when the browser does launch, chrome://gpu reports hardware acceleration utilizing the Radeon iGPU and working as expected.

Lastly, I do not get any freeze when running the application through my Nvidia 1660Ti dGPU (nvidia-dkms drivers) by way of the prime-run script, nor did I see any issues on my previous system using Intel graphics, so this seems to be exclusive the the AMD drivers on my system.

At this point I'm not sure where to even start diagnosing what could be causing the freeze. The system freezes before the application can print any useful errors, and I haven't had much luck filtering out anything useful from system logs. Any troubleshooting tips would be much appreciated.

Offline

#2 2023-02-26 01:16:04

blackcatgames
Member
Registered: 2023-02-26
Posts: 2

Re: Electron Wayland with Radeon HW Acceleration causes system freeze

Just want to check a couple of things from what I understand you want the hardware acceleration to run on the integrated amd gpu and not the nvidia gpu correct?

First off this is probably not related to your issue but you should make sure to remove intel-ucode,  intel-media-driver, libva-intel-driver, and xf86-video-intel if you have any of those installed and check that you have all the appropriate packages installed for amd: amd-ucode, libva-mesa-driver, mesa-vdpau, libva-utils, mesa-vdpau, vdpauinfo.

Next up you're going to want to check the vainfo and vdpauinfo commands to make sure they're working properly. I'm not too familiar with hybrid gpu setups, but I imagine you'll need to do some minor configuration for PRIME here https://wiki.archlinux.org/title/PRIME

Offline

#3 2023-02-26 03:07:08

taylor85345
Member
Registered: 2021-10-04
Posts: 3

Re: Electron Wayland with Radeon HW Acceleration causes system freeze

Yes, I want everything to run on the iGPU unless I explicitly run with Prime, as the goal is to stretch battery life as long as possible. I'm currently using nvx to disable my Nvidia GPU when I'm not actively using it.

I did make sure to uninstall all Intel packages and replace them with AMD equivalents, and I can confirm that all everything you listed has been installed/uninstalled. I was running AMDGPU Pro drivers at one point as well, but I've since removed them.

vdpauinfo doesn't seem to work under wayland, but vainfo outputs the following, which seems promising:

```
Trying display: wayland
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.6 for AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.13-x64v1-xanmod1-1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointEncSlice
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileHEVCMain10             :    VAEntrypointEncSlice
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileVP9Profile0            :    VAEntrypointVLD
      VAProfileVP9Profile2            :    VAEntrypointVLD
      VAProfileNone                   :    VAEntrypointVideoProc
```

I've reviewed the PRIME page extensively and have had everything properly configured to the best of my knowledge from the beginning. Prime offloading generally works flawlessly and exactly as expected.

Offline

#4 2023-02-26 03:20:20

taylor85345
Member
Registered: 2021-10-04
Posts: 3

Re: Electron Wayland with Radeon HW Acceleration causes system freeze

Alright, well it looks like you indirectly got me on the right track. While investigating why vdpauinfo wasn't working, I saw a few recommendations to uninstall mesa-vdpau, and after doing so I am no longer getting any freezing with Electron apps, and Hardware Acceleration still seems to be working properly. Video playback from Youtube seems to have a weird green tint for the first few seconds of playback now, but that's something I can deal with.

Offline

#5 2023-02-27 17:02:16

blackcatgames
Member
Registered: 2023-02-26
Posts: 2

Re: Electron Wayland with Radeon HW Acceleration causes system freeze

taylor85345 wrote:

Video playback from Youtube seems to have a weird green tint for the first few seconds of playback now.

So the green tint is likely a problem with chromium/electron or mesa. If you're willing to try a few troubleshooting steps to narrow down the issue here's what I would try:

First install firefox and enable wayland with the environment variable MOZ_ENABLE_WAYLAND=1 and the check that hardware acceleration is setup and works https://wiki.archlinux.org/title/Firefo … celeration . If the issue persists then it's most likely a mesa issue. I would check mesa issues or even try installing mesa-git to see if it fixes the issue. If the problem doesn't persist it's likely a chrome issue.

I would also try restarting your computer if you haven't yet that can fix issues sometimes too tongue

Offline

Board footer

Powered by FluxBB