[TUTORIAL] Avoid screen tearing on Nvidia + Intel (PRIME)

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
n_otmze

[TUTORIAL] Avoid screen tearing on Nvidia + Intel (PRIME)

Post by n_otmze »

I recently installed Linux Mint 19.3 Gnome to a friend to test this distribution (windows user).
The problem is that in "Gnome" it had a huge screen tearin compared to Cinammon.

Searching, i found the solution on the Arch Linux wiki. It is that the privative Nvidia driver must synchronize with the integrated Intel card, and this is called the PRIME system.
We can check this with the command

Code: Select all

xrandr --properties | grep PRIME
If any of the outputs are 0, synchronization is disabled.
Also use this video to check.

For the driver to synchronize with Intel, it must be in kernel mode, and this is not done by default, so this tutorial is about how to implement Nvidia in kernel mode to synchronize with Intel.

The first thing we will do is create a file

Code: Select all

sudo touch /etc/modprobe.d/nvidia-drm-modeset.conf
And add the following line

Code: Select all

sudo echo "options nvidia-drm modeset = 1" >> /etc/modprobe.d/nvidia-drm-modeset.conf
Now we must edit the following configuration file (replace nano with your favorite text editor)

Code: Select all

sudo nano /etc/initramfs-tools/initramfs.conf
and add this line below the #FILE comments, like this
# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES = "/etc/modprobe.d/nvidia-drm-modeset.conf"
Now we have the configuration ready, the following is to regenerate the initramfs, which is done like this

Code: Select all

sudo update-initramfs -u
Reboot and verify that PRIME synchronization is activated

Code: Select all

xrandr --properties | grep PRIME
If the result is "PRIME Synchronization: 1", then you have done well, enjoy!


Source: wiki Arch Linux
how to regenerate initramfs on debian/ubuntu linux

Code: Select all

inxi -G
Graphics:  Device-1: Intel UHD Graphics 620 driver: i915 v: kernel 
           Device-2: NVIDIA GM108M [GeForce MX130] driver: nvidia v: 435.21 
           Display: x11 server: X.Org 1.19.6 driver: modesetting,nvidia unloaded: fbdev,nouveau,vesa resolution: 1366x768~60Hz 
           OpenGL: renderer: GeForce MX130/PCIe/SSE2 v: 4.6.0 NVIDIA 435.21 
Last edited by n_otmze on Thu Dec 26, 2019 8:33 pm, edited 1 time in total.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: [TUTORIAL] Avoid screen tearing on Nvidia + Intel (PRIME)

Post by catweazel »

n_otmze wrote: Tue Dec 24, 2019 11:53 pm

Code: Select all

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES = "/ etc / modprobe.d / nvidia-drm-modeset.conf"
Surely that is incorrect and should be specified without spaces.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
n_otmze

Re: [TUTORIAL] Avoid screen tearing on Nvidia + Intel (PRIME)

Post by n_otmze »

catweazel wrote: Thu Dec 26, 2019 6:44 pm Surely that is incorrect and should be specified without spaces.
thanks, fixed.
Last edited by n_otmze on Thu Dec 26, 2019 9:53 pm, edited 1 time in total.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: [TUTORIAL] Avoid screen tearing on Nvidia + Intel (PRIME)

Post by catweazel »

n_otmze wrote: Thu Dec 26, 2019 8:33 pm
catweazel wrote: Thu Dec 26, 2019 6:44 pm Surely that is incorrect and should be specified without spaces.
thanks, fixed.
The invoice is in the mail.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Malik
Level 1
Level 1
Posts: 30
Joined: Sun Mar 17, 2019 12:04 am

Re: [TUTORIAL] Avoid screen tearing on Nvidia + Intel (PRIME)

Post by Malik »

Excellent! Thank you! I'm using a Linux Mint 20.1 on HP Pavilion Gaming 15 with GTX 1650 Max-Q card. This guide completely eliminated the screen tearing! Thank you again.

Only hiccups while following this tutorial were:

1. The sudo echo command returned permission denied output. So I added the options... statement manually via nano.

2. There are no #FILES section in my initramfs.conf, but I added the FILES = statement anyway.

3. The corrected FILES statement still gave an output error when I updated the initram (FILES not found). I needed to change the FILES = "/etc/modprobe.d/nvidia-drm-modeset.conf" to FILES=/etc/modprobe.d/nvidia-drm-modeset.conf without ANY spaces from after FILES to end. Then the initram update went without error outputs.

Just an observation from my system, just in case if anyone having problems following this.
Post Reply

Return to “Tutorials”