Electron apps are buggy and laggy on Wayland with proprietary Nvidia drivers

I have noticed that two electron apps that I use regularly (Visual Studio Code and Obsidian) have notably bad performance on Fedora with Wayland. I have noticed this since Fedora 36 (the first version that I have used, so it could go back further than this) this has been occurring. Typing input is often laggy to the point of being unusable and often menu windows get randomly blacked out:

This happens on both the deb and flatpak version of vscode. I have long chalked this up to the proprietary nvidia drivers and Wayland not playing nice (I use an RTX 3060 Ti with the most recent 535 proprietary driver) and electron just generally being terrible, but recently I have tried Visual Studio code on Linux Mint (you can get Wayland quite easily by installing gnome-shell) and NixOS on Wayland. It works fine with Fedora with X11 so I think this is a uniquely Fedora/Wayland/Electron/Nvidia issue.

Does anyone know why this is or how to fix it? Can anyone see if this issue is also reproduced on a system with an AMD GPU, for instance? Thanks.

Hi,

With my onboard AMD GPU, vscode working normal here. May be current Nvidia driver didn’t playing nicely with wayland.

Great, thank you!

yes I have the same issue with AMD Ryzen 5 5600G, very frustrating

What graphics driver are you using? Are you using AMD integrated graphics or do you have an external Nvidia GPU as well?

Interestingly, with the release of Asahi Fedora, I have had a chance to try this with the drivers designed by the Asahi team for Apple GPUs and vscode works smoothly there. Ironically, it also runs better in a VM using software rendering. It is only using Nvidia drivers in Fedora where I have encountered this issue.

Reproduced.

Fedora Linux 38
GNOME 44.4
wayland
i5-12600K
NVIDIA GeForce RTX 3060 Ti GDDR6X        latest proprietary driver

Issue Link
Seemed very common.

Also experiencing it here:
Fedora 39
Gnome 44.0-7
Haven’t changed defaults from Wayland for anything
Nvidia GeForce RTX 4090 w/ 545.29.06-2 proprietary driver release

On Firefox/VIM/whatever normal applications, I seem to have very reasonable typing experience, but on Slack and Discord installed from Flathub, I’m getting extreme lag and stuttering where letters I’ve typed pop up and then disappear and then pop back up. It’s about a 2 second delay before the display settles out after I stop typing.

That seems to indicate you are not fully updated. The current F39, fully updated, shows gnome at 45.2.

I suggest you do a full upgrade to the latest package versions, wait at least 5 minutes after the upgrade completes then reboot and try again to see if later packages may have already fixed the problem.
sudo dnf upgrade --refresh done from the cli in a terminal is the way I do it.

When I do that it says nothing to upgrade, and I just did a round of updates as well not 20 minutes ago, with similar results. What’s going wrong? How would you check things from here?

(base) wcunning@ozymandius:~$ sudo dnf upgrade --refresh
[sudo] password for wcunning:
Copr repo for PyCharm owned by phracek 3.2 kB/s | 2.1 kB 00:00
Fedora 39 - x86_64 81 kB/s | 25 kB 00:00
Fedora 39 openh264 (From Cisco) - x86_64 5.9 kB/s | 989 B 00:00
Fedora 39 - x86_64 - Updates 67 kB/s | 24 kB 00:00
google-chrome 5.4 kB/s | 1.3 kB 00:00
RPM Fusion for Fedora 39 - Free 5.1 kB/s | 3.6 kB 00:00
RPM Fusion for Fedora 39 - Free - Updates 21 kB/s | 3.5 kB 00:00
RPM Fusion for Fedora 39 - Nonfree 49 kB/s | 6.8 kB 00:00
RPM Fusion for Fedora 39 - Nonfree - NVIDIA Driver 51 kB/s | 6.0 kB 00:00
RPM Fusion for Fedora 39 - Nonfree - Steam 40 kB/s | 6.2 kB 00:00
RPM Fusion for Fedora 39 - Nonfree - Updates 52 kB/s | 6.4 kB 00:00
Dependencies resolved.
Nothing to do.
Complete!

Did you open the gnome settings → about → system details panel to check if it is up to date as I showed with that image?

I don’t use electron apps so I have not seen the problems you report.

I ran the following, but here’s the other screenshot as well.

(base) wcunning@ozymandius:~$ dnf list installed | grep gnome-desktop
gnome-desktop3.x86_64 44.0-7.fc39 @fedora
gnome-desktop4.x86_64 44.0-7.fc39 @fedora

And switching back to X11 (logged out, used the gear icon to log back into a gnome + X11 session) fixed the stuttering and lag, which indicates that it’s a function of Wayland still.

Hm.
I noted you have 2 nvidia GPUs and there was an earlier thread (cant find it right now) about the second GPU not being usable with wayland but working fine with X11. That user had 5 monitors with one attached to the second gpu and wayland was unable to drive the monitor on the second gpu.

Switching back to X11 fixed everything, so I’ve just been running that for the last couple weeks, but it’s worth noting that I only have one graphics card installed. My processor has onboard graphics, but they’re disabled since Nvidia doesn’t play nicely with that in general.