1

I have Ubuntu 18.04 installed on my Acer Nitro 5 notebook, and I'm using the NVIDIA driver metapackage nvidia-driver-450. I'm observing a lot of screen tearing in my external monitor, connected to the notebook via HDMI cable. I can observe it in videos and when I drag windows around. However, there is no screen tearing on the notebook monitor, only on the external one.

I have already tried the options nvidia-drm modeset=1 solution, it solved the screen tearing only for the notebook monitor, but not the external one.

I also have tried setting "Force Composition Pipeline" in the NVIDIA X Server Settings, it solves the issue, but when I restart the system the notebook monitor stops being recognized (the screen is black, and it is not listed in xrandr). It seems like it is because the Notebook monitor is a PRIME Display, as shown in the link below, and it can't deal with the X Configuration File that the X Server generates.

NVIDIA X Server Settings image

Can someone help me? The only thing I haven't tried yet is using the X X.Org Server (xserver-xorg-video-nouveau), but I didn't want to use it because I have an GTX 1650, and I understand the Nouveau isn't that good.

AmandaB
  • 21

2 Answers2

1

So, with the help of this, this and this post, I was able to find a workaround. Since using "Force Composition Pipeline" in NVIDIA X Server stops the screen tearing, but makes the notebook monitor stop being recognized, the workaround is to run the Force Composition Pipeline command after every startup.

I just added the command bash -c "sleep 10 && nvidia-settings --assign CurrentMetaMode=\"$(xrandr | sed -nr '/(\S+) connected (primary )?([0-9]+x[0-9]+)(\+\S+).*/{ s//\1: \3 \4 { ForceCompositionPipeline = On }, /; H}; ${ g; s/\n//g; s/, $//; p }')\"" (found in this post) in the startup commands, and now the second monitor has no screen tearing, and I have no problems after shutting the notebook down.

AmandaB
  • 21
0

I let the nvidia-settings generate a conf file. That file was copied to: /etc/X11/xorg.conf.d/90-dual.conf.

You might have to setup both monitors in your config. See here for an example. Note that I've configured

Option "Xinerama" "0"

in the "ServerLayout" section

The following contents may not apply to your monitor, but it might give a gist how it should look like. After copying that file you need to reboot...

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files" EndSection

Section "Module" Load "dbe" Load "extmod" Load "type1" Load "freetype" Load "glx" EndSection

Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection

Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection

Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "<your monitor here>" HorizSync 30.0 - 83.0 VertRefresh 55.0 - 76.0 Option "DPMS" EndSection

Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce <your version here>" EndSection

Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-0" Option "metamodes" "DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, DVI-D-0: nvidia-auto-select +1920+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection

kanehekili
  • 6,402
  • I have done that, but after rebooting the notebook monitor stopped being recognized. It blacks out and xrandr won't list it anymore. Does yours work fine after generating that file? Do you use a notebook or a desktop? – AmandaB Nov 16 '20 at 19:55
  • Both. The conf file above is from my desktop. But I've done a similar config for my Thinkpad. So my educated guess is the that the second monitor does not have any EDID information. Try to apply a second "monitor" section in your conf. -> see my revised answer – kanehekili Nov 16 '20 at 20:02
  • What I think happens is that the notebook monitor can't deal with the file generated by the NVIDIA X Server. Do you have an example of how the file would be with the second monitor section? Coudn't find on Google :/ – AmandaB Nov 16 '20 at 20:05
  • As I said: see my revised answer. One more question: Are you using wayland? If yes, try to switch to X-Server – kanehekili Nov 16 '20 at 20:07
  • Ok, I'll try that. The configuration on your Thinkpad is something like that too? Do I have to add any other section other than another "monitor" section? – AmandaB Nov 16 '20 at 20:10
  • My monitors are recognized, so i do not have multiple monitor sections. I thought - from your headline - that screen-tearing is your problem, but it looks now it is monitor recognition – kanehekili Nov 16 '20 at 20:17
  • Screen tearing is the problem, but when I try the xorg file fix, then I have a problem of monitor recognition. If I don't use any xorg file, both monitors are recognized, but when I create an xorg file from NVIDIA X Server, then the notebook monitor stops being recognized (because it is a PRIME Monitor). – AmandaB Nov 16 '20 at 20:23
  • Are you using wayland???

    – kanehekili Nov 16 '20 at 22:55
  • No, I'm not. However, I found a workaround that might help (I'll put an answer for better understanding). – AmandaB Nov 17 '20 at 16:33
  • Great. Thanks for sharing your solution – kanehekili Nov 19 '20 at 17:06