How to get rid of screen tearing in Linux

Linux, in my opinion, is a great operating system. It respects your choice as a user so that you can choose whatever application you want for any of your needs. Actually, I believe the "free" word in things that people keep talking about Linux is free of choice, not free of cost since there are many applications that you need to buy in order to use them.

As a game programmer, I cannot be happier when gaming on Linux is starting to be more and more pleasant. There are a bunch of good games on Steam that run on Linux, including "The Rise of Tomb Raider" or "Portals" series. Even Unity and Unreal Engine, two fantastic and free of cost game engines, support Linux natively, which means you can develop games on this amazing platform.

However, there is a thing that would heavily damage your experience of gaming on Linux. Especially, if you run non-hardware-accelerated desktop environments such as XFCE, or basic windows managers like i3 or bspwm, along with a proprietary nVidia driver, you're very likely to face this before.

Yes, I'm mentioning screen tearing.

Luckily, it's damn easy to fix this. No need to edit any configuration files, since the nvidia-settings tool has an option graphically - just be sure that you have the updated driver, because as I remember such option did not exist when I tried to do the same thing around a year ago.

Launch the terminal and run the nvidia-settings with root:

$ sudo nvidia-settings

Choose X Server Display Configuration, pick the display that you don't want to see screen tearing (or you can pick all of your screens). Select Advance button to show advance options, there you can see two tick boxes: "Force Composition Pipeline" and "Force Full Composition Pipeline". You should experiment with the left check box first, then try to drag around any window to see if this works. If you are lucky (like my friend), you don't see any tearing anymore. Otherwise, choose the right check box, and you will be fine.

I ticked this option for all of my screens.

Lastly, to make this change permanent, you should save this configuration to nVidia's default. Choose the "Save to X Configuration File" to override the default configuration.

That's all. No more tearing. Happy gaming!

References:

How To: An update on fixing screen-tearing on Linux with an NVIDIA GPU

NVIDIA/Troubleshooting on Arch Wiki

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *