Screen tearing using Gnome and Nvidia (proprietary)

Hello, I’m using Manjaro with the proprietary drivers and I’m having screen tearing. My laptop is a Lenovo Legion Y740. I don’t have this screen tearing using Windows so I don’t think this is a hardware problem. I’ve tried using nvidia-settings and setting Force composition pipeline and Force full composition pipeline to no avail.

Here’s the output of my inxi -Fazy

System:
  Kernel: 5.9.11-3-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 
  root=UUID=759c5942-a42f-4370-bfe8-fa4cfa3281e8 rw quiet splash apparmor=1 
  security=apparmor resume=UUID=781fe0ae-7244-4c2d-b4e0-3ef218bf3d2a 
  udev.log_priority=3 
  Desktop: GNOME 3.38.1 tk: GTK 3.24.23 wm: gnome-shell dm: GDM 3.38.2 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: LENOVO product: 81UH v: Lenovo Legion Y740-15IRHg 
  serial: <filter> Chassis: type: 10 v: Lenovo Legion Y740-15IRHg 
  serial: <filter> 
  Mobo: LENOVO model: LNVNB161216 v: SDK0R32862 WIN serial: <filter> 
  UEFI [Legacy]: LENOVO v: BVCN11WW(V1.07) date: 07/04/2019 
Battery:
  ID-1: BAT1 charge: 48.6 Wh condition: 48.6/57.4 Wh (85%) volts: 12.9/11.6 
  model: Celxpert L17C3PG2 type: Li-ion serial: <filter> status: Full 
CPU:
  Info: 6-Core model: Intel Core i7-9750H bits: 64 type: MT MCP 
  arch: Kaby Lake family: 6 model-id: 9E (158) stepping: A (10) microcode: DE 
  L2 cache: 12.0 MiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 62431 
  Speed: 4229 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 4319 2: 4469 
  3: 4388 4: 4446 5: 4403 6: 4409 7: 4236 8: 4249 9: 4400 10: 4264 11: 4253 
  12: 4354 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: NVIDIA TU106BM [GeForce RTX 2060 Mobile] vendor: Lenovo 
  driver: nvidia v: 455.45.01 alternate: nouveau,nvidia_drm bus ID: 01:00.0 
  chip ID: 10de:1f51 
  Device-2: Chicony Integrated Camera (1280x720@30) type: USB driver: uvcvideo 
  bus ID: 1-7:5 chip ID: 04f2:b604 serial: <filter> 
  Display: x11 server: X.org 1.20.10 compositor: gnome-shell driver: nvidia 
  resolution: <xdpyinfo missing> 
  OpenGL: renderer: GeForce RTX 2060/PCIe/SSE2 v: 4.6.0 NVIDIA 455.45.01 
  direct render: Yes 
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Lenovo driver: snd_hda_intel 
  v: kernel alternate: snd_soc_skl,snd_sof_pci bus ID: 00:1f.3 
  chip ID: 8086:a348 
  Device-2: NVIDIA TU106 High Definition Audio vendor: Lenovo 
  driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 10de:10f9 
  Sound Server: ALSA v: k5.9.11-3-MANJARO 
Network:
  Device-1: Intel Wireless-AC 9560 [Jefferson Peak] 
  vendor: Bigfoot Networks Killer driver: iwlwifi v: kernel bus ID: 00:14.3 
  chip ID: 8086:a370 
  IF: wlp0s20f3 state: up mac: <filter> 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Lenovo driver: r8169 v: kernel port: 3000 bus ID: 3f:00.0 
  chip ID: 10ec:8168 
  IF: enp63s0 state: down mac: <filter> 
  IF-ID-1: br-6d3840142d80 state: down mac: <filter> 
  IF-ID-2: docker0 state: down mac: <filter> 
Drives:
  Local Storage: total: 953.87 GiB used: 21.66 GiB (2.3%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB1T0HALR-000L2 
  size: 953.87 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s 
  lanes: 4 serial: <filter> rev: 5L1QEXA7 scheme: MBR 
Partition:
  ID-1: / raw size: 919.45 GiB size: 904.02 GiB (98.32%) 
  used: 21.66 GiB (2.4%) fs: ext4 dev: /dev/nvme0n1p1 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 34.41 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/nvme0n1p2 
Sensors:
  System Temperatures: cpu: 47.0 C mobo: N/A gpu: nvidia temp: 42 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 299 Uptime: 14m Memory: 31.28 GiB used: 3.67 GiB (11.7%) 
  Init: systemd v: 246 Compilers: gcc: 10.2.0 Packages: 1270 pacman: 1263 
  lib: 346 flatpak: 0 snap: 7 Shell: Zsh v: 5.8 running in: java inxi: 3.1.08 

Also my /etc/X11/xorg.conf file

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

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

Section "Files"
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      "BOE Technology Group Co., Ltd"
    HorizSync       164.0 - 164.0
    VertRefresh     143.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2060"
EndSection

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

Any help is appreciated

Manjaro uses MHWD hence the proper configuration is in /etc/X11/mhwd.d/nvidia.conf

Remove the /etc/X11/xorg.conf and paste this content in the proper file location:

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      "BOE Technology Group Co., Ltd"
    HorizSync       164.0 - 164.0
    VertRefresh     143.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2060"
EndSection

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

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection

 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Once you save it, run this command from terminal:
sudo mhwd-gpu --setmod nvidia --setxorg /etc/X11/mhwd.d/nvidia.conf

Reboot the system after that and report back.

1 Like

In addition to what @bogdancovaciu said above you might try to use {ForceFullCompositionPipeline=On} instead of {ForceCompositionPipeline=On} in that config.

Never used GNOME however, turning on vsync under compositor in KDE solves tearing. Maybe there is similar setting in GNOME too?

Hello! I just did it and tried also with ForceFullCompositionPipeline but the problem persists specially when I use Pycharm for some reason.

Do you know if there’s any other debugging information I can send to troubleshoot this issue?

I’ve been looking for this, but I can’t seem to find it!

I am a really nutcase ignorant when it comes to the configuration of iNvidia.

I have found the nvidia-settingsapp to be of great help. Setup your config - save it in your home - backup the mhwd confguration - then overwrite your mhwd config with the generated config and reboot.

Maybe this approach works for you too.

Yeah, I tried with different configurations but the flickering persists. Specially if I use something like pycharm or when watching a full screen video.

I’ve seen people reporting similar problems on Windows when using NVIDIA’s latest driver on the same laptop model that I have lenovo y740 screen flickering after driver update-English Community