Screen tearing optimus laptop - Asus TUF A15 2021

Goodnight:

I have tearing problems with my RTX 3060 mobile graphic, I use the Arch Linux operating system and I have the latest drivers available to date.

I have already placed a file in /etc/modprobe.d with the content options nvidia-drm modeset = 1 and confirmed that the query in / sys / module / nvidia_drm / parameters / modeset returns a Y so theoretically prime sync should be activated, however, I still keep tearing. Please if someone could give me a hand with my problem. Thanks a lot.
nvidia-bug-report.log.gz (339.9 KB)

[mario@Asus-Arch modprobe.d]$ neofetch 
                   -`                    mario@Asus-Arch 
                  .o+`                   --------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: ASUS TUF Gaming A15 FA506QM_FA50 
               `+oooooo:                 Kernel: 5.15.10-zen1-1-zen 
               -+oooooo+:                Uptime: 23 mins 
             `/:-:++oooo+:               Packages: 999 (pacman) 
            `/++++/+++++++:              Shell: bash 5.1.12 
           `/++++++++++++++:             Resolution: 1920x1080 
          `/+++ooooooooooooo/`           DE: Cinnamon 5.0.7 
         ./ooosssso++osssssso+`          WM: Mutter (Muffin) 
        .oossssso-````/ossssss+`         WM Theme: Mint-Y-Dark-Grey (Mint-Y) 
       -osssssso.      :ssssssso.        Theme: Mint-Y-Dark-Grey [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Papirus-Dark [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: gnome-terminal 
   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 7 5800H with Radeon Gra 
  `+sso+:-`                 `.-/+oso:    GPU: AMD ATI 05:00.0 Cezanne 
 `++:.                           `-/+/   GPU: NVIDIA GeForce RTX 3060 Mobile /  
 .`                                 `/   Memory: 2740MiB / 23501MiB 

                                                                 
                                                                 


[mario@Asus-Arch modprobe.d]$ 

[mario@Asus-Arch modprobe.d]$ sudo cat /sys/module/nvidia_drm/parameters/modeset 
Y
[mario@Asus-Arch modprobe.d]$ 







[mario@Asus-Arch modprobe.d]$ dmesg | grep nvidia
[    0.887171] nvidia: module license 'NVIDIA' taints kernel.
[    0.935355] nvidia-nvlink: Nvlink Core is being initialized, major device number 511
[    0.936230] nvidia 0000:01:00.0: enabling device (0000 -> 0003)
[    0.936401] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[    1.012607] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[    1.053832] nvidia-uvm: Loaded the UVM driver, major device number 509.
[    1.106939] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  495.46  Wed Oct 27 16:22:48 UTC 2021
[    1.135734] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    2.428201] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
[mario@Asus-Arch modprobe.d]$ 

According to the log the amd is primary gpu, the nvidia is only on-demand.
Does tearing also occur if nvidia is primary?

Hi @generix, yes, too.

Here the results:

[mario@Asus-Arch ~]$ sudo cat /sys/module/nvidia_drm/parameters/modeset 
[sudo] password for mario: 
Y
[mario@Asus-Arch ~]$ 

[mario@Asus-Arch ~]$ dmesg | grep nvidia
[    1.459214] nvidia: module license 'NVIDIA' taints kernel.
[    1.498866] nvidia-nvlink: Nvlink Core is being initialized, major device number 509
[    1.499325] nvidia 0000:01:00.0: enabling device (0000 -> 0003)
[    1.499413] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[    1.552498] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  495.46  Wed Oct 27 16:22:48 UTC 2021
[    1.570081] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    2.537160] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
[mario@Asus-Arch ~]$ 
[nvidia-bug-report.log.gz|attachment](upload://5y2o1dvEeAYfkOOkHB93BgyOJ0B.gz) (303.9 KB)


After this image, you can watch the FPS from glxgears.

nvidia-bug-report.log.gz (303.9 KB)

[mario@Asus-Arch ~]$ xrandr --prop
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
	EDID: 
		00ffffffffffff0038704d0000000000
		331d0104a5221378036850985c588e28
		1b505400000001010101010101010101
		010101010101918a8004713832403020
		350058c21000001abd39800471383240
		3020350058c21000001a000000fd0030
		90a3a323010a202020202020000000fe
		004c4d3135364c462d324630330a0035
	GAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	DEGAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	GAMMA_LUT: 0 
		range: (0, 65535)
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	DEGAMMA_LUT: 0 
		range: (0, 65535)
	TearFree: auto 
		supported: off, on, auto
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	vrr_capable: 1 
		range: (0, 1)
	abm level: 0 
		range: (0, 4)
	max bpc: 16 
		range: (8, 16)
	underscan vborder: 0 
		range: (0, 128)
	underscan hborder: 0 
		range: (0, 128)
	underscan: off 
		supported: off, on, auto
	scaling mode: None 
		supported: None, Full, Center, Full aspect
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 78 
		supported: 78
	non-desktop: 0 
		range: (0, 1)
   1920x1080    144.00 +  60.00* 
   1680x1050    144.00  
   1280x1024    144.00  
   1440x900     144.00  
   1280x800     144.00  
   1280x720     144.00  
   1024x768     144.00  
   800x600      144.00  
   640x480      144.00  
HDMI-A-0 disconnected (normal left inverted right x axis y axis)
	GAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	DEGAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	GAMMA_LUT: 0 
		range: (0, 65535)
	CTM: 0 
	DEGAMMA_LUT: 0 
		range: (0, 65535)
	TearFree: auto 
		supported: off, on, auto
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	vrr_capable: 0 
		range: (0, 1)
	max bpc: 8 
		range: (8, 16)
	underscan vborder: 0 
		range: (0, 128)
	underscan hborder: 0 
		range: (0, 128)
	underscan: off 
		supported: off, on, auto
	scaling mode: None 
		supported: None, Full, Center, Full aspect
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 85 
		supported: 85
	non-desktop: 0 
		range: (0, 1)
DP-1-0 disconnected (normal left inverted right x axis y axis)
	PRIME Synchronization: 1 
		supported: 0, 1
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: DisplayPort 
		supported: DisplayPort
	ConnectorType: DisplayPort 
	ConnectorNumber: 4 
	_ConnectorLocation: 4 
	non-desktop: 0 
		supported: 0, 1
DP-1-1 disconnected (normal left inverted right x axis y axis)
	PRIME Synchronization: 1 
		supported: 0, 1
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DisplayPort 
	ConnectorNumber: 4 
	_ConnectorLocation: 4 
	non-desktop: 0 
		supported: 0, 1
[mario@Asus-Arch ~]$ 

I test too with another kernel version, in this new case with linux-lts with the same problem.
I test too with another Desktop Environment, in this case with plasma desktop with the same problem.

This looks like the amd gpu is not emitting any vsync signal. Please switch back to on-demand mode for the nvidia gpu and have the amd gpu primary.
Looking at the xrandr output from your first log, there’s a 144Hz panel running at 60Hz. When back on amd gpu, please switch to 144Hz and run glxgears on the amd and check whether it’s then limited to 144Hz.

Thanks for replying again.

If I set the screen at 144hz in on-demand mode, in fact there is a limitation of 144 FPS. If in on-demand mode I set it at 60 hz there is also a limitation at 60 FPS. With all these details, always with nvidia there is that tear in games.

Now I have realized these details, when I am in nvidia mode my screen application offers me these settings:


As you can see, it offers you configurations with vsync.

Now when it’s in on-demand mode I only see two settings available and neither of them offer vsync.

It’s good to mention that the tearing is only felt in games that run on nvidia. I have not tried many games but I think I could try another. For now I am talking about DOTA2.

The results in GLXGEARS always offer an FPS limitation as I will show in the following images.

Set screen to144hz with primary AMD GPU:

Set screen to 144hz with NVIDIA on demand GPU:

Set screen to 60hz with primary AMD GPU:

Set screen to 60hz with NVIDIA on demand GPU:

PD: Prime run is only a script for run with nvidia:
image

So, having observed this we could say that the vertical sync is working correctly. Even on the desktop or watching videos using the primary I do not see any tear, but just open the game with NVIDIA and the tear appears.

If I open the same “DOTA2” game with the primary AMD the tear disappears.

[mario@Asus-Arch ~]$ xrandr --prop
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
	EDID: 
		00ffffffffffff0038704d0000000000
		331d0104a5221378036850985c588e28
		1b505400000001010101010101010101
		010101010101918a8004713832403020
		350058c21000001abd39800471383240
		3020350058c21000001a000000fd0030
		90a3a323010a202020202020000000fe
		004c4d3135364c462d324630330a0035
	GAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	DEGAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	GAMMA_LUT: 0 
		range: (0, 65535)
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	DEGAMMA_LUT: 0 
		range: (0, 65535)
	TearFree: auto 
		supported: off, on, auto
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	vrr_capable: 1 
		range: (0, 1)
	abm level: 0 
		range: (0, 4)
	max bpc: 16 
		range: (8, 16)
	underscan vborder: 0 
		range: (0, 128)
	underscan hborder: 0 
		range: (0, 128)
	underscan: off 
		supported: off, on, auto
	scaling mode: None 
		supported: None, Full, Center, Full aspect
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 78 
		supported: 78
	non-desktop: 0 
		range: (0, 1)
   1920x1080    144.00 +  60.00* 
   1680x1050    144.00  
   1280x1024    144.00  
   1440x900     144.00  
   1280x800     144.00  
   1280x720     144.00  
   1024x768     144.00  
   800x600      144.00  
   640x480      144.00  
HDMI-A-0 disconnected (normal left inverted right x axis y axis)
	GAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	DEGAMMA_LUT_SIZE: 4096 
		range: (0, -1)
	GAMMA_LUT: 0 
		range: (0, 65535)
	CTM: 0 
	DEGAMMA_LUT: 0 
		range: (0, 65535)
	TearFree: auto 
		supported: off, on, auto
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	vrr_capable: 0 
		range: (0, 1)
	max bpc: 8 
		range: (8, 16)
	underscan vborder: 0 
		range: (0, 128)
	underscan hborder: 0 
		range: (0, 128)
	underscan: off 
		supported: off, on, auto
	scaling mode: None 
		supported: None, Full, Center, Full aspect
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 85 
		supported: 85
	non-desktop: 0 
		range: (0, 1)
DP-1-0 disconnected (normal left inverted right x axis y axis)
	PRIME Synchronization: 1 
		supported: 0, 1
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: DisplayPort 
		supported: DisplayPort
	ConnectorType: DisplayPort 
	ConnectorNumber: 4 
	_ConnectorLocation: 4 
	non-desktop: 0 
		supported: 0, 1
DP-1-1 disconnected (normal left inverted right x axis y axis)
	PRIME Synchronization: 1 
		supported: 0, 1
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DisplayPort 
	ConnectorNumber: 4 
	_ConnectorLocation: 4 
	non-desktop: 0 
		supported: 0, 1

So my suspicion about the amd gpu was wrong, it’s running vsync’d. Then nvidia gpu in on-demand mode, the frames will just be limited by the compositor but running unsynced.
Please switch back to nvidia as primary but use the amdgpu driver instead of modesetting, then check if glxgears is still running unsync’d.

AMD is using modesetting as default controller, now with nvidia as primary FPS is not capable with screen resolution:
image

In this case 144hz:

I will check how I can change default controller for my AMD device. @generix do you want to say amdgpu-pro?

I checked and I using amdgpu and not modesetting.

I meant the Xsrevr driver (DDX). You have in your xorg.conf
Section “Device”
Identifier “integrated”
Driver “modesetting”
BusID “PCI:5:0:0”
EndSection
Please change
“modesetting” to “amdgpu”
Don’t install amdgpu-pro, this will break the nvidia driver.

1 Like

Ok, this is my xorg.conf config:

Section "Files"
        ModulePath "/usr/lib/nvidia"
        ModulePath "/usr/lib32/nvidia"
        ModulePath "/usr/lib32/nvidia/xorg/modules"
        ModulePath "/usr/lib32/xorg/modules"
        ModulePath "/usr/lib64/nvidia/xorg/modules"
        ModulePath "/usr/lib64/nvidia/xorg"
        ModulePath "/usr/lib64/xorg/modules"
EndSection

Section "ServerLayout"
        Identifier "layout"
        Screen 0 "integrated"
        Inactive "nvidia"
        Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
        Identifier "integrated"
        Driver "amdgpu"
        BusID "PCI:5:0:0"
        Option "TearFree" "true"
        Option "DRI" "3"
EndSection

Section "Screen"
        Identifier "integrated"
        Device "integrated"
EndSection

Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:1:0:0"
        Option "Coolbits" "28"
        Option "TripleBuffer" "true"
EndSection

Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
EndSection

Section "ServerFlags"
        Option "IgnoreABI" "1"
EndSection


PD: In this case I’m using third party app called optimus manager for create this archive.

I do know how I can do this Manually.

Edit:

Wells aparently the problem were in amdgpu config because after add the option tearfree and amdgpu the tearing is fixed.

How I can create this file manually?

Try enable Force Composite Pipeline