<SOLVED> Fixing screentear on second monitor disappears PRIME monitor

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
SaberClassMor
Level 1
Level 1
Posts: 26
Joined: Sun Jun 13, 2021 10:50 am

<SOLVED> Fixing screentear on second monitor disappears PRIME monitor

Post by SaberClassMor »

I've been having a problem of screen tearing on Linux Mint 20 Ulyana (Cinnamon 4.6.7). It's bad on my primary screen, and very bad on a secondary screen. After trying a bunch of random stuff (that I didn't write down! sorry), I've found that the secondary screen issue is solved when Force Full Composition is turned on in the Nvidia settings. This, however, causes the computer to forget the existence of the PRIME monitor on reboot (it just displays a black screen with an underscore at the very top left, so if there's no second monitor, it just looks like it crashed.) The second monitor is the only one to appear in the Display settings and the Nvidia settings at this point. Turning the setting off from this position does not fix the issue - but manually deleting etc/X11/xorg.conf DOES fix the issue. As long as I delete the xorg.conf file before rebooting, it works fine, but that's not a tenable workaround. Oh, and I never fixed the screentear on the PRIME monitor! Sorry if I'm missing something obvious.

Output of

Code: Select all

inxi -Fxxxrz

Code: Select all

System:
  Kernel: 5.8.0-55-generic x86_64 bits: 64 compiler: N/A 
  Desktop: Cinnamon 4.6.7 wm: muffin 4.6.3 dm: LightDM 1.30.0 
  Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: LENOVO product: 82DS v: Yoga Creator 7 15IMH05 
  serial: <filter> Chassis: type: 10 v: Yoga Creator 7 15IMH05 
  serial: <filter> 
  Mobo: LENOVO model: LNVNB161216 v: SDK0J40700 WIN serial: <filter> 
  UEFI: LENOVO v: DNCN22WW date: 05/26/2020 
Battery:
  ID-1: BAT1 charge: 18.4 Wh condition: 67.9/70.0 Wh (97%) volts: 14.8/15.4 
  model: SMP L19M4PF2 type: Li-poly serial: <filter> status: Discharging 
  cycles: 30 
CPU:
  Topology: Quad Core model: Intel Core i5-10300H bits: 64 type: MT MCP 
  arch: N/A L2 cache: 8192 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 39999 
  Speed: 899 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 899 2: 900 
  3: 900 4: 899 5: 900 6: 900 7: 900 8: 900 
Graphics:
  Device-1: Intel UHD Graphics vendor: Lenovo driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:9bc4 
  Device-2: NVIDIA vendor: Lenovo driver: nvidia v: 465.27 bus ID: 01:00.0 
  chip ID: 10de:1f99 
  Display: x11 server: X.Org 1.20.9 driver: modesetting,nvidia 
  unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: NVIDIA GeForce GTX 1650/PCIe/SSE2 v: 4.6.0 NVIDIA 465.27 
  direct render: Yes 
Audio:
  Device-1: Intel Comet Lake PCH cAVS vendor: Lenovo driver: sof-audio-pci 
  bus ID: 00:1f.3 chip ID: 8086:06c8 
  Device-2: NVIDIA vendor: Lenovo driver: snd_hda_intel v: kernel 
  bus ID: 01:00.1 chip ID: 10de:10fa 
  Sound Server: ALSA v: k5.8.0-55-generic 
Network:
  Device-1: Intel Wi-Fi 6 AX201 driver: iwlwifi v: kernel port: 4000 
  bus ID: 00:14.3 chip ID: 8086:06f0 
  IF: wlp0s20f3 state: up mac: <filter> 
Drives:
  Local Storage: total: 476.94 GiB used: 91.70 GiB (19.2%) 
  ID-1: /dev/nvme0n1 vendor: SK Hynix model: HFS512GD9TNG-L3A0B 
  size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: 80050C10 
  scheme: GPT 
Partition:
  ID-1: / size: 375.49 GiB used: 91.65 GiB (24.4%) fs: ext4 
  dev: /dev/nvme0n1p5 
Sensors:
  System Temperatures: cpu: 49.0 C mobo: N/A gpu: nvidia temp: 44 C 
  Fan Speeds (RPM): N/A 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/alexlarsson-flatpak-focal.list 
  1: deb http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/graphics-drivers-ppa-focal.list 
  1: deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://packages.linuxmint.com ulyana main upstream import backport
  2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
  3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
  4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ focal partner
Info:
  Processes: 342 Uptime: 2h 25m Memory: 7.49 GiB used: 4.32 GiB (57.7%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash 
  v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Fixing screentear on second monitor disappears PRIME monitor

Post by roblm »

You will need to have the xorg.conf file re-created with the X config option and post it’s contents:
xed /etc/X11/xorg.conf
SaberClassMor
Level 1
Level 1
Posts: 26
Joined: Sun Jun 13, 2021 10:50 am

Re: Fixing screentear on second monitor disappears PRIME monitor

Post by SaberClassMor »

Good point!

Code: Select all

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 460.73.01

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      "Vestel 40FHD_LCD_TV"
    HorizSync       15.0 - 70.0
    VertRefresh     48.0 - 62.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1650"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-2"
    Option         "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, AllowGSYNC=Off}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Fixing screentear on second monitor disappears PRIME monitor

Post by roblm »

That xorg.conf file is configured for a desktop system and not an Optimus-based laptop.

Try adding the ForceFullCompositionPipeline X config option to a different config file. Open the 11-nvidia.conf file: xed admin:///usr/share/X11/xorg.conf.d/11-nvidia.conf

Add the line Option "ForceFullCompositionPipeline" "true", so it will now look like this:

Code: Select all

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
    Option "ForceFullCompositionPipeline" "true"
EndSection
Reboot.
SaberClassMor
Level 1
Level 1
Posts: 26
Joined: Sun Jun 13, 2021 10:50 am

Re: Fixing screentear on second monitor disappears PRIME monitor

Post by SaberClassMor »

roblm wrote: Sun Jun 13, 2021 1:03 pm That xorg.conf file is configured for a desktop system and not an Optimus-based laptop.

Try adding the ForceFullCompositionPipeline X config option to a different config file. Open the 11-nvidia.conf file: xed admin:///usr/share/X11/xorg.conf.d/11-nvidia.conf

Add the line Option "ForceFullCompositionPipeline" "true", so it will now look like this:

Code: Select all

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
    Option "ForceFullCompositionPipeline" "true"
EndSection
Reboot.
I don't have an 11-nvidia.conf file, however I do have 10-nvidia.conf file with the same contents as you've listed here - should I go ahead and add that line anyway?
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Fixing screentear on second monitor disappears PRIME monitor

Post by roblm »

The 10-nvidia.conf file is correct.
SaberClassMor
Level 1
Level 1
Posts: 26
Joined: Sun Jun 13, 2021 10:50 am

Re: Fixing screentear on second monitor disappears PRIME monitor

Post by SaberClassMor »

roblm wrote: Sun Jun 13, 2021 1:11 pm The 10-nvidia.conf file is correct.
That's totally fixed my second screen!
I still have my PRIME display screentear to fix but since the title problem is solved I'll mark it as such. Thanks roblm!
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: <SOLVED> Fixing screentear on second monitor disappears PRIME monitor

Post by roblm »

Open the nvidia-kms.conf file: xed admin:///lib/modprobe.d/nvidia-kms.conf

Change the value from 0 to 1 in this line: options nvidia-drm modeset=0
SaberClassMor
Level 1
Level 1
Posts: 26
Joined: Sun Jun 13, 2021 10:50 am

Re: <SOLVED> Fixing screentear on second monitor disappears PRIME monitor

Post by SaberClassMor »

roblm wrote: Sun Jun 13, 2021 1:17 pm Open the nvidia-kms.conf file: xed admin:///lib/modprobe.d/nvidia-kms.conf
This file does not exist for me. Should I add this to nvidia-graphics-drivers.conf instead?
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: <SOLVED> Fixing screentear on second monitor disappears PRIME monitor

Post by roblm »

SaberClassMor wrote: This file does not exist for me. Should I add this to nvidia-graphics-drivers.conf instead?
That’s strange. I advise creating the file: sudo touch /lib/modprobe.d/nvidia-kms.conf

Open the file for editing: xed admin:///lib/modprobe.d/nvidia-kms.conf

Add the line: options nvidia-drm modeset=1

I previously forgot to add this step to update the initial ramdisk and reboot: sudo update-initramfs -u
SaberClassMor
Level 1
Level 1
Posts: 26
Joined: Sun Jun 13, 2021 10:50 am

Re: <SOLVED> Fixing screentear on second monitor disappears PRIME monitor

Post by SaberClassMor »

roblm wrote: Sun Jun 13, 2021 1:29 pm
SaberClassMor wrote: This file does not exist for me. Should I add this to nvidia-graphics-drivers.conf instead?
That’s strange. I advise creating the file: sudo touch /lib/modprobe.d/nvidia-kms.conf

Open the file for editing: xed admin:///lib/modprobe.d/nvidia-kms.conf

Add the line: options nvidia-drm modeset=1

I previously forgot to add this step to update the initial ramdisk and reboot: sudo update-initramfs -u
That seems to have sorted it! Thanks again.
Locked

Return to “Graphics Cards & Monitors”