2

I'm on ubuntu 20.04. I'm using an external monitor with a laptop as shown in nvidia-settings here: enter image description here

nominally this works. But, to get rid of tearing on the external display, I need to select "Force Composition Pipeline" under Advanced. This is fine, but when I try to save the X config file, a restart would remove my PRIME display completely. Only my external monitor works.

I would have to delete /etc/X11/xorg.conf to get the display back.

Is there a way to save this config and keep the prime display?

2
  • I am having the same issue...after saving to X config file, even if I select "merge" the internal screen isn't working. nomodset only fixes the issue for internal screen. – adi Jun 10 at 7:17
  • @adi - Did you have a chance of testing what I proposed? – sancho.s ReinstateMonicaCellio Jun 16 at 11:29
1
+50

You may try this solution, which seems to have worked for others.

  1. Remove any xorg.conf in /etc/X11

  2. Create directory /etc/X11/xorg.conf.d

  3. Create file /etc/X11/xorg.conf.d/20-nvidia-antitear.conf with contents

     Section "OutputClass"
         Identifier "nvidia-antitear"
         MatchDriver "nvidia-drm"
         Driver "nvidia"
         Option "ForceCompositionPipeline" "true"
     EndSection
    

Related: https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Avoid_screen_tearing


Alternatively, you could write a script that applies the settings as mentioned by adi, but run it at boot time via crontab so it works for any user. This is done here.

The solution via compton posted there is yet another option.

1
  • 1
    Seems to work, thanks. – adi Jun 16 at 12:01
0

Ok so I've found a solution, courtesy of answer from the following question: How to automatically force full composition pipeline for Nvidia GPU driver?

I've changed the solution a bit though.

Step 1, create a shell script file, wherever you want, I've made it like in the answer in ~/bin/force-composition-pipeline.sh

Step 2, add the following content to the scrip:

#!/bin/bash
s="$(nvidia-settings -q CurrentMetaMode -t)"

if [[ "${s}" != "" ]]; then
  s="${s#*" :: "}"
  nvidia-settings -a CurrentMetaMode="${s//\}/, ForceCompositionPipeline=On\}}"
fi

Step 3, make the script executable:

chmod +x ~/bin/force-composition-pipeline.sh

Step 4, add the script to the sign in process, either by adding the following code to the .profile or .bash_profile, whichever you find in your home directory:

if [ -f "$HOME/bin/force-composition-pipeline.sh" ] ; then
    ~/bin/force-composition-pipeline.sh
fi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.