Howdy! I’ve been struggling the past few days to get my NixOS+Sway+Docked Laptop setup to play nice with my Nvidia GPU. If I am only using the laptop, no problem. However, the second that I connect up my 2 external monitors, firefox, steam, and some other apps, start pitching a fit and having this weird screen-tearing/screen flickering issue. I’m a little stumped on where to even begin finding the issue much less how to fix it.
Side note, I’m fairly new to this so if anyone pokes through my config files and sees something nonsensical or bad practice, feel free to say something.
This is a long-standing nvidia bug, caused by lack of support for “explicit sync” in sway (and initially the existence of said feature in wayland/X at all, it took a few years to get it implemented). Other GPUs don’t have this problem because nvidia don’t provide a normal mesa driver and didn’t want to implement “implicit sync” when a better option was right around the corner (read: a few years off).
Gnome/KDE support it by now, but sway’s taking a little longer. AIUI, these two issues are what’s left to get the flickering to stop:
In addition, if you want explicit sync support at the driver level, you’ll want at least the version 555 driver. Your change from stable (555) to production (550) was actually a downgrade.
Thanks for sharing! I am new to nix so I could not do it way you did it in your config, but I found a simple way of just adding it to my configuration.nix like this:
It did, indeed, fix flickering, but there were still some issues. Firefox kept crashing and kitty stopped even launching. Back on iGPU everything works fine. My hardware is RTX 3070 and Ryzen 5 7600.
If you do still want to use the updated version of wlroots and sway, you can use the nixpkgs-wayland repo as an overlay. They are using the updated versions as far as I can tell.
I ended up giving up on using sway until I get rid of this machine and buy a new one and am just using the cosmic DE alpha instead. Because even though it’s jank (due to its alpha state), at least it runs correctly with NVIDIA.
My trusty 2070 started causing crashes (it frankly arrived with some issues back in 2020, I only ended up not returning it because of scummy Amazon resellers), so I switched to a 4060ti, and boy is the flickering much worse with that GPU. I’d assumed things would be mostly the same across GPUs, I appreciate why this bothers other user so much more.
I’ve since also tested the latest commits, and yeah, firefox crashes occasionally. Otherwise things are pretty stable with the 560.35.03 driver. Clearly YMMV depending on GPU.
Why would I buy nvidia again? Well, neither competitor has released a GPU that fits in my PC case in over 4 years… At least I have two models (ish) to test stuff with now.