Prevent screen tearing when using proprietary NVIDIA Linux drivers

There's no doubt that NVIDIA's proprietary Linux drivers are the best when it comes to gaming and high performance 3D graphics in general; even at the expense of running closed source software. Still, despite the driver's robust OpenGL performance and overall stability, there's one issue I've yet to see fixed out of the box: screen tearing.

Depending on your setup, the desktop environment, driver-specific and X11 settings all offer different methods to either lower the amount of visual tearing or remove it entirely. Here are some of the methods I've discovered. Chances are the first method won't work, so in that case, give a try to the other options listed.

Change compositor settings

Depending on the desktop environment you use, this might be the easiest (and thus the first) method you'll try. In my case, KDE Plasma 5 has a setting (you can find it in System Settings -> Display and Monitor -> Compositor) for tearing prevention, complete with more than two options to choose from. Some of them don't eliminate tearing entirely and some may not work depending on the driver you are using (if you're not using the proprietary driver, that is). Put simply, Full screen repaints tries to eliminate tearing entirely and Only when cheap eliminates tearing only in full screen applications. Changing the Rendering backend might also resolve the issue.

Again, whether this option works with your setup depends on the desktop environment you're using; it might require dabbling with configuration files or it might not be an option at all.

Change driver settings

To change the driver settings, open up a console and type sudo nvidia-settings. You might not have nvidia-settings installed already; in that case try installing the application using your package manager (sudo apt-get install nvidia-settings). Since some Linux distributions don't offer non-free software out of the box, you might have to change your repository settings before you can install the application (for Ubuntu and derivatives, try enabling the multiverse repository as described here).

Once you have opened the application, there are a few settings you can change to prevent tearing:

OpenGL Settings -> Sync to VBlank (enable)
PowerMizer -> Preferred Mode (set this to Prefer Maximum Performance)

Once you're done, click Quit to close the application and save the settings. Chances are you'll need to restart your computer to see the results, so do that as well.

Didn't work? There's still something you can try to fix screen tearing.

Modify xorg.conf

Start by opening a console and typing the following command to edit the Xorg configuration file (we're using nano to edit the configuration file, but you can choose a different editor if you wish):

sudo nano /etc/X11/xorg.conf

There's a chance the file won't exist, which means you'll need to generate one first. To do that, open nvidia-settings as described in the previous method and select the X Server Display Configuration tab. From there, select Save to X Configuration File and save the configuration file to /etc/X11/xorg.conf

If the configuration file already exists, make a copy of it before modifying it. The easiest would be to make a local copy named xorg.conf.backup; you can do it with the following command: sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Once you have done either of the previous steps (created a new X11 file or backed up the existing one), find the following line:

Section "Screen"
   ...
   ...
   Option         "metamodes" "DVI-I-1: nvidia-auto-select +4480+0, HDMI-0: nvidia-auto-select +0+240, DP-1: nvidia-auto-select +1920+0"
   ...
   ...
EndSection

 

Your own file might differ slightly, but our point of interest is the metamodes line. Append it with { ForceCompositionPipeline = On } and place it before the quotes. In my case, the line would now look like this:

   Option         "metamodes" "DVI-I-1: nvidia-auto-select +4480+0, HDMI-0: nvidia-auto-select +0+240, DP-1: nvidia-auto-select +1920+0 { ForceCompositionPipeline = On }"

Now that you're done, save the file (for Nano, press Ctrl+X followed by Y and Enter) and try restarting the computer and seeing if the edit worked. If it didn't, you might notice that the /etc/X11/xorg.conf file has been renamed to /etc/X11/xorg.conf.05212016 or something similar, especially if the xorg.conf file didn't exist in the first place. In this case, we'll just need to create the X11 configuration file with nvidia-settings, but save it to /usr/share/X11/xorg.conf.d/nvidia.conf (the filename can be something besides nvidia, as long as it is in the right directory) instead. After that, edit the file as described in the previous paragraph and try restarting your computer again.

If luck has it, your Linux desktop should finally be free of screen tearing. In my case, it wasn't until I edited the X11.conf file that the screen tearing disappeared. Again, your mileage may vary and depending on the scenario none of the methods described here would not work. In case you find a way to fix screen tearing with a different method not described here, please mention it in the comments below. It would be very appreciated!

Pingbacks are closed.

Trackbacks
  1. Bitcoin mining on 02/17/2018 11:38 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  2. bitcoin mining rechner euro on 09/16/2018 6:30 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  3. 선릉안마방 on 10/26/2019 12:37 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  4. 선릉안마추천 on 12/27/2019 6:57 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  5. 레깅스룸이란 on 12/27/2019 12:56 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  6. 고구려 on 12/27/2019 5 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  7. 울산마사지 on 12/27/2019 9:41 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  8. 역삼안마방 on 12/31/2019 9:55 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  9. 강남피쉬안마 on 12/31/2019 6:22 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  10. 역삼역 안마 on 12/31/2019 8:42 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  11. 대전안마방 on 01/01/2020 4:04 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  12. 광주출장마사지 on 01/01/2020 7:13 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  13. 전주출장 on 01/01/2020 9:30 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  14. 전주출장 on 01/04/2020 1:37 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  15. 대전안마 on 01/04/2020 7:08 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  16. 군산출장안마 on 01/08/2020 11:14 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  17. 마사지 on 01/09/2020 7:12 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  18. 익산출장안마 on 01/09/2020 8:20 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  19. 군산출장안마 on 01/10/2020 8:05 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  20. 강남안마 on 01/14/2020 10:35 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  21. 청주출장안마 on 01/14/2020 5:49 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  22. 강남가라오케 on 01/15/2020 2 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  23. 레깅스룸 on 01/15/2020 10:58 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  24. 가인안마방 on 01/16/2020 6:08 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  25. 제주출장마사지 on 01/16/2020 9:50 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  26. 울산풀싸롱 on 01/16/2020 10:50 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  27. 광주출장안마 on 01/18/2020 11:27 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  28. 대전출장안마 on 01/19/2020 12:27 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  29. 삼성동안마 on 01/19/2020 10:34 p.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  30. 논현동안마 on 01/20/2020 12:18 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  31. 신사동마사지 on 01/20/2020 2:56 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  32. 일산명월관 on 01/20/2020 3:06 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  33. 울산모텔출장 on 01/21/2020 9:13 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  34. 광주출장안마 on 01/22/2020 1:54 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

  35. 광주출장 on 01/22/2020 6:14 a.m. #

    Janne Pulkkinen: Prevent screen tearing when using proprietary NVIDIA Linux drivers

Trackback URL