Screen tearing with AMD/Nvidia hybrid graphics

Hello!

I’ve im trying to fix screen tearing when i use my Nvidia gpu. I’ve tried to enable Force full composition pipeline but is is not available in nvidia settings as it says im using a prime display. Im also having trouble trying to enable prime sync. Theres no tearing with my AMD but it’s pretty bad with Nvidia. Any help is greatly appreciated.

System:
  Kernel: 6.5.5-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: hpet available: acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.5-x86_64
    root=UUID=50fd364b-e6d8-49be-bddc-a816cafac0ee rw ... nvidia-drm.modeset=1
    quiet splash udev.log_priority=3
  Desktop: KDE Plasma v: 5.27.8 tk: Qt v: 5.15.11 wm: kwin_x11 vt: 2 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ROG Zephyrus G14 GA401QH_GA401QH v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: GA401QH v: 1.0 serial: <superuser required>
    UEFI: American Megatrends LLC. v: GA401QH.414 date: 07/20/2023
Battery:
  ID-1: BAT0 charge: 72.5 Wh (100.0%) condition: 72.5/76.0 Wh (95.4%)
    volts: 15.8 min: 15.8 model: ASUSTeK ASUS Battery type: Li-ion serial: N/A
    status: not charging
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M325
    serial: <filter> charge: 55% (should be ignored) rechargeable: yes
    status: discharging
CPU:
  Info: model: AMD Ryzen 7 5800HS with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 3 gen: 4 level: v3 note: check built: 2021-22
    process: TSMC n7 (7nm) family: 0x19 (25) model-id: 0x50 (80) stepping: 0
    microcode: 0xA50000C
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB
    desc: 1x16 MiB
  Speed (MHz): avg: 591 high: 2315 min/max: 400/4463 scaling:
    driver: amd-pstate-epp governor: powersave cores: 1: 400 2: 400 3: 400 4: 400
    5: 2315 6: 400 7: 400 8: 400 9: 400 10: 400 11: 400 12: 400 13: 400 14: 400
    15: 1552 16: 400 bogomips: 102249
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow mitigation: safe RET, no microcode
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: ASUSTeK
    driver: nvidia v: 535.129.03 alternate: nouveau,nvidia_drm non-free: 545.xx+
    status: current (as of 2023-11; EOL~2026-12-xx) arch: Turing code: TUxxx
    process: TSMC 12nm FF built: 2018-2022 pcie: gen: 3 speed: 8 GT/s lanes: 8
    link-max: gen: 4 speed: 16 GT/s lanes: 16 ports: active: none empty: DP-1
    bus-ID: 01:00.0 chip-ID: 10de:1f9d class-ID: 0300
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    vendor: ASUSTeK driver: amdgpu v: kernel arch: GCN-5 code: Vega
    process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s ports: active: eDP-1 empty: HDMI-A-1
    bus-ID: 04:00.0 chip-ID: 1002:1638 class-ID: 0300 temp: 51.0 C
  Display: x11 server: X.Org v: 21.1.8 compositor: kwin_x11 driver: X:
    loaded: modesetting,nvidia dri: radeonsi gpu: amdgpu display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 mapped: eDP-1-1 model: ChiMei InnoLux 0x14d5 built: 2016
    res: 1920x1080 hz: 60 dpi: 158 gamma: 1.2 size: 309x173mm (12.17x6.81")
    diag: 354mm (13.9") ratio: 16:9 modes: max: 1920x1080 min: 640x480
  API: EGL Message: No EGL data available.
  API: OpenGL v: 4.6.0 vendor: nvidia v: 535.129.03 glx-v: 1.4
    direct-render: yes renderer: NVIDIA GeForce GTX 1650/PCIe/SSE2
    memory: 3.91 GiB
  API: Vulkan v: 1.3.264 layers: 5 device: 0 type: discrete-gpu
    name: NVIDIA GeForce GTX 1650 driver: nvidia v: 535.129.03
    device-ID: 10de:1f9d surfaces: xcb,xlib device: 1 type: integrated-gpu
    name: AMD Radeon Graphics (RADV RENOIR) driver: mesa radv
    v: 23.1.9-manjaro1.1 device-ID: 1002:1638 surfaces: xcb,xlib
Audio:
  Device-1: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: gen: 3
    speed: 8 GT/s lanes: 8 link-max: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:10fa class-ID: 0403
  Device-2: AMD Renoir Radeon High Definition Audio driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s bus-ID: 04:00.1 chip-ID: 1002:1637 class-ID: 0403
  Device-3: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: ASUSTeK driver: N/A
    alternate: snd_pci_acp3x, snd_rn_pci_acp3x, snd_pci_acp5x, snd_pci_acp6x,
    snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps, snd_sof_amd_renoir,
    snd_sof_amd_rembrandt pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s bus-ID: 04:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-4: AMD Family 17h/19h HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s bus-ID: 04:00.6 chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.5.5-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 0.3.81 status: off with: pipewire-media-session
    status: active tools: pw-cli
  Server-3: PulseAudio v: 16.1 status: active with: pulseaudio-alsa
    type: plugin tools: pacat,pactl
Network:
  Device-1: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
    vendor: AzureWave driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s
    lanes: 1 bus-ID: 02:00.0 chip-ID: 14c3:7961 class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
  IF-ID-1: wg-mullvad state: unknown speed: N/A duplex: N/A mac: N/A
Bluetooth:
  Device-1: IMC Networks Wireless_Device driver: btusb v: 0.8 type: USB
    rev: 2.1 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-4:3 chip-ID: 13d3:3563
    class-ID: e001 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 476.94 GiB used: 22.94 GiB (4.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Intel model: SSDPEKNU512GZ
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 002C temp: 37.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 238.42 GiB size: 233.62 GiB (97.99%) used: 22.9 GiB (9.8%)
    fs: ext4 dev: /dev/nvme0n1p5 maj-min: 259:5
  ID-2: /boot/efi raw-size: 100 MiB size: 96 MiB (96.00%)
    used: 41.5 MiB (43.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 63.8 C mobo: N/A
  Fan Speeds (rpm): cpu: 2600
  GPU: device: nvidia screen: :0.0 temp: 52 C device: amdgpu temp: 52.0 C
Info:
  Processes: 353 Uptime: 25m wakeups: 0 Memory: total: 16 GiB note: est.
  available: 15.03 GiB used: 4.44 GiB (29.5%) Init: systemd v: 254
  default: graphical tool: systemctl Compilers: gcc: 13.2.1 clang: 16.0.6
  Packages: 1198 pm: pacman pkgs: 1191 libs: 351 tools: pamac,yay pm: flatpak
  pkgs: 7 Shell: fish v: 3.6.1 default: Bash v: 5.1.16 running-in: konsole
  inxi: 3.3.31

To see the mhwd profiles in play:

mhwd -l -li

To double check prime is working:

glxinfo | grep 'renderer string'
prime-run glxinfo | grep 'renderer string'

Assuming those are fine… you may try creating this file with the following content:

/etc/X11/xorg.conf.d/99-nvidia-antitear.conf

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

(reboot)

Everything looks installed.

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
video-hybrid-amd-nvidia-prime            2023.03.23               false            PCI


Warning: No installed USB configs!
> 0000:01:00.0 (0300:10de:1f9d) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2023.03.23               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2023.03.23               false            PCI
          video-nvidia            2023.03.23               false            PCI
    video-nvidia-470xx            2023.03.23               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:04:00.0 (0300:1002:1638) Display controller ATI Technologies Inc:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2023.03.23               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2023.03.23               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


OpenGL renderer string: NVIDIA GeForce GTX 1650/PCIe/SSE2
OpenGL renderer string: NVIDIA GeForce GTX 1650/PCIe/SSE2

I created the file with the contents and rebooted but i am still getting screen tearing?

This appears as PRIME is not working … both outputs show nvidia.
(or was it a copy error?)

PS.
As to nvidia settings - does clicking on ‘advanced’ not work?

My bad, that was a copy error.

OpenGL renderer string: AMD Radeon Graphics (renoir, LLVM 16.0.6, DRM 3.54, 6.5.5-1-MANJARO)

In order to get more options on nvidia-settings i have to switch over to nvidia through optimus-manager

When in settings on the X Server Display Configuration tab, if i press advanced it does nothing. I would add an image but it is not allowing me.

It is also named PRIME Display and says it can only be configured by a randr capable tool

I can chime in my 2 cents.
Also prime with AMD and Nvidia.

I gave up on the CompositionPipeline, one of them (the one referenced) did nothing for me and if I tried the full composition my system did not work.

The tearing is there, even for me on a 3090.
I can solve it 2 ways:

  1. Use vsync (it minimizes tearing, but I can sometimes still se it). I don’t have a g/v-sync monitor, so my latency is terrible, but depending on game (if I care or not) this is the easiest/most efficient way.

  2. Pushing more fps than my monitor can produce (I only have a 60hz),
    This obv makes the GPU work harder but the tearing is gone and the latency is insane.
    I have found that more than 100-120fps is unnecessary for MY setup, it doesn’t make my gaming experience better in any way, only consumes more power.

Alright this was helpful. I can’t really do anything about i guess lol so ill just have to accept it.

I think you should try the pipeline, as I said this is how MY setup acts and how I “fixed” it, maybe it is completely different for you!
All I say is “don’t be surprised if it does not fix the tearing”.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.