Thursday, May 23, 2024

Wayland sync issues with Nvidia GPU

     I've been using wayland instead of X11 exclusively for the past few months.  Apps that were build for wayland work great but older apps that were written for X11 have to use the xwayland protocol and would sometimes flicker or tear on my Nvidia GTX4060 GPU.  It has been a minor issue using Kde Plasma or Gnome environments since they mostly supported Nvidia.  

    The reason for the flicker using Nvidia GPUs with xwayland and not with AMD or Intel, is because AMD and Intel supported implicit sync which Nvidia did not.   This was a big issue with getting wayland to be the default windowing system on Linux.   Gamers prefer Nvidia GPUs over AMD due to the built in DLSS which makes games faster and better graphics using AI.  Nvidia far outsells AMD in the GPU market. 

    Now the good news, Nvidia for the past couple years has been working to support wayland.   The solution that everyone agreed upon is to incorporate explicit sync in wayland and the GPU drivers.   This solution gets rid of any potential for flicker as the GPU will now explicitly be told to render an apps output to the display.  

    Nvidia is now supporting explicit sync in their latest beta driver.   This appeared in Archlinux AUR two days ago as nvidia-beta 555.42.02-1. I was waiting for this to be released for the last couple weeks, so I quickly downloaded it and installed it.  I am using KDE Plasma 6 and the KDE devs state it won't fully support explicit sync until 6.1, however my flickering is gone.  I read a post by a Nvidia dev stating that just the driver alone should fix most issues even if the window manager or desktop environment does not yet support explicit sync.  It was incorporated in wayland about a month or so ago.

    I now have no issues at all using wayland and I have read most Linux distributions will make wayland the default windowing system in the near future due to Nvidia supporting explicit sync which was one of the final hurdles.   It's taken about 8 years to get this to where it is now but the future of Linux looks bright.


No comments: