Screen tearing in Ubuntu with Nvidia/Intel graphics

Solution 1:

Create /etc/X11/xorg.conf.d/20-intel.conf containing

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TearFree"    "true"
EndSection

That should fix everything.

Source is https://wiki.archlinux.org/index.php/Intel_graphics#Tear-free_video

Note: This only works if you're using bumblebee.


Note from comments: Since 10.10 the config file directory is now /usr/share/X11/xorg.conf.d

Starting from Ubuntu 16.04 LTS * you can use the following script to switch between NVIDIA and INTEL's graphics cards and besides it corrects the video/screen tearing on INTELs environment: https://github.com/bauca/graphics-switcher

Solution 2:

Using Wayland on Ubuntu 18.04 gets rid of all tearing for me.

You can enable it by clicking on the cog on the password screen and selecting "Ubuntu on Wayland".