Fix Screen Tearing in Ubuntu 18.04 Optimus Laptops

Last updated: July 16, 2018

Nvidia Linux driver

For Ubuntu 18.04 users plagued by screen tearing issue while using NVIDIA proprietary drivers, this quick tutorial may help you via enable PRIME Synchronization on Optimus.

Screen tearing usually happens on Ubuntu Linux laptop that uses Prime to switch between NVIDIA and Intel drivers.

1. Open terminal (either via Ctrl+Alt+T or by searching for ‘terminal’ from software launcher) and run command to create a new config file:

sudo gedit /etc/modprobe.d/nvidia-drm-nomodeset.conf

Type your password (no asterisks feedback) when it prompts and hit Enter.

2. When the file opens after running the previous command, add following line and save the file.

options nvidia-drm modeset=1

3. Finally update intramfs and reboot your machine.

sudo update-initramfs -u

To check if previous changes work after reboot, run command:

sudo cat /sys/module/nvidia_drm/parameters/modeset

It should output ‘Y’.

In addition, to get much SMOOTHER Nvidia window dragging experience, you can also do:

1. Set maximum performance in Nvidia X Server Settings -> PowerMizer.

2. If you have MORE than enough RAM, set swap tendency to a MUCH lower value by running command to edit sysctl.conf:

sudo gedit /etc/sysctl.conf

and add following 2 lines when the file opens:

via: ubuntuforums

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

10 responses to Fix Screen Tearing in Ubuntu 18.04 Optimus Laptops

  1. Life saver – Thank you!!!

  2. Thanks man, that did it for me.

  3. Thank you so much, I tried so many things, nothing worked, this works, praise Jesus and you ma’ man! :D

  4. Thank you for your time making the post it worked great :).

  5. After doing so – PC stopped to boot.
    To revert it –
    1. Ctrl+Alt+F2
    2. Type username, password
    3. “sudo nano /etc/modprobe.d/nvidia-drm-nomodeset.conf”
    4. remove “options nvidia-drm modeset=1”
    5. Ctrl+X to save.
    6. “sudo update-initramfs -u”
    7. “reboot”

  6. Hey thanks for the support. And I’ve got a question. With this operation, didn’t we lead nvidia card to use much of the CPU resources for basic stuff(Smoothness while scrolling etc.)? By the way I am new to Linux. Thanks.

  7. Doing this removed the screen tearing but I lost the ability to connect to a second monitor (tested via thunderbolt 3 -> DisplayPort.

    Is there a way to incorporate your fix and keep multi display functionality?

    • Tim Richardson April 28, 2019 at 4:47 am

      Yes. replace gdm3 with lightdm. The bug stopping external monitors working with modeset=1 is a gdm3 bug. Not present in lightdm or sddm.

      I have no adverse effects from using ligthdm.

      sudo apt install lightdm

      and make it the default display manager.

      You can change defaults, including back to gdm3:

      sudo dpkg-reconfigure lightdm

  8. I use ubuntu 19.04 and nvidia 1050Ti – nvidia-driver-418. it’s worked for me. but sometimes screen is freezing.