X11 vs Wayland ?
I have recently noticed a trend that I thought I’d better add to my list of causes for poor system performance/instability. As the usage of Wayland becomes more commonplace, so unfortunately have reports of many problems related to Wayland. Wayland has made great strides and will likely become the default display server on most Linux machines in the near future. Sadly though, even as we approach 2024 Wayland is still having its fair share of teething pains. Although much improved, Wayland is still causing major issues on some systems. I’m not trying paint Wayland in a bad light, most users rate the experience as a positive one, and many report much improved performance.
Unfortunately KDE users are still reporting a myriad of negative side effects when attempting to transition to Wayland. Recently quite a few KDE users have reported being unable to login under Wayland, but logging in under an X session is fine. Other KDE users have recently reported frame drops/stutters and 70 - 90% CPU usage with kwin_wayland
. As well, some KDE users have been unable to get their secondary monitors recognized or working under Wayland. Nvidia users on KDE with Wayland have been experiencing a lot of graphic problems as well. The most common fix has been to enable DRM (Direct Rendering Manager) for Nvidia with the kernel parameter nvidia-drm.modeset=1
. Enabling DRM (Direct Rendering Manager) is covered at NVIDIA - ArchWiki .
If you are uncomfortable editing grub’s configuration file, then you can use the command below to automatically add the nvidia-drm.modeset=1
kernel parameter to /etc/default/grub:
sudo cp /etc/default/grub /etc/default/grub.bak && sudo sed '/^GRUB_CMDLINE_LINUX_DEFAULT=/s/"$/ nvidia-drm.modeset=1 "/g' -i /etc/default/grub && sudo update-grub
You may need to press Enter
again at the update-grub
stage of the above string of commands. The above command will firstly backup your Grub config before editing. Next, it will add the nvidia-drm.modeset=1
kernel parameter to the /etc/default/grub
config file. Lastly, it will execute the update-grub
command to regenerate grub. It can take a fair bit of time to regenerate grub, so don’t worry if it takes a while to finish. When the process has completed, reboot your computer.
X11 has been in use since September 1987, so it is considered far more mature and stable than the newcomer Wayland. For this reason, severe bugs are usually encountered far less frequently with X11. However, X11’s days are definitely numbered as Wayland is faster /more secure and in heavy development by the big corporate Linux players. Regardless of X’s long standing track record, it can also create major system malfunctions at times. In some cases switching to a Wayland session from X11 may cure system instability/performance issues.
To sum things up, I would now consider it best practice to switch session types whenever experiencing any performance/stability issues on either Wayland or X11.
Edited to update recent developments: