You are not logged in.

#1 2020-03-30 00:02:44

Lenix
Member
Registered: 2020-03-29
Posts: 6

Screen Tearing with NVIDIA GPU on Certain Applications

Hello,

I recently switched over to Archlinux on my main machine. I've been using Archlinux for a few years on nonessential hardware and had no issues. However, with this install, I've notice screen tearing while scrolling on certain applications. So far I've verified it to be present in Firefox, Discord, and Steam.
In Firefox, scrolling is smooth unless I have a separate window playing media (youtube, twitch, etc), where I see screen tearing. In Discord, no matter what I see screen tearing when I scroll (similar to what I see in Firefox, where parts of text seem to look "higher or lower" than other parts of the same text.

My specs (and version numbers) are as follows:
i5-9600k@4.9ghz
16GB Ram
Nvidia GTX 1050Ti
WD Blue 500GB M.2 SSD
Xorg-server Version 1.20.7-1
KDE Plasma Version 5.18.3-1
Nvidia Driver Version 440.64-8
Arch Kernel Version 5.15.3

Here are a few things that I've tried:

1. forcing the Full Composition Pipeline in nvidia-settings
2. Trying different DEs (XFCE, LXDE, Gnome, i3)
3. enabling hardware acceleration in-app
4. using one monitor (my original setup includes 3, using all 3 ports on my card)
5. changing the KDE compositor backend (all options, OpenGL 3.0, 2.1, and Xrender)
6. All of the fixes on the ArchWiki for Nvidia and Firefox screen tearing
7. Verifying that the VDPAU driver (and the nvidia driver in general) is being loaded by Xorg

Here is my xorg.conf (I'm currently only using 1 screen):

 
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 440.64

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

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      "HP LA2205"
    HorizSync       24.0 - 83.0
    VertRefresh     50.0 - 76.0
    Option         "DPMS"
EndSection

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

Section "Screen"

# Removed Option "metamodes" "DVI-D-0: nvidia-auto-select +1680+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3360+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, DP-0: nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

I am willing to provide any more information that is pertinent to my issue. I've been pulling my hair out for days to try and fix this, and any help would be great.
Thanks!

Offline

#2 2020-03-30 01:03:25

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,429

Re: Screen Tearing with NVIDIA GPU on Certain Applications

I'd generally say try without a xorg.conf (or if you do remove the composition pipeline, but use

Option "TripleBuffer" "on"

to enable triple buffering in the driver) and do not keep two compositors running, KWin should usually be sufficient, don't mix that with forcing the composition pipeline. Maybe also post

glxinfo -B #mesa-demos
qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation #Needs qt5-tools

Online

#3 2020-03-30 01:14:03

Lenix
Member
Registered: 2020-03-29
Posts: 6

Re: Screen Tearing with NVIDIA GPU on Certain Applications

Thanks for such a quick reply! unfortunately, removing the xorg.conf file did not fix it for Firefox (Discord seems smoother now, though)

here's the output of

glxinfo -B 
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 4096 MB
    Total available memory: 4096 MB
    Currently available dedicated video memory: 3629 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 1050 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 440.64
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 440.64
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 440.64
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

and

 qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation 
KWin Support Information:
The following information should be used when requesting support on e.g. https://forum.kde.org.
It provides information about the currently running instance, which options are used,
what OpenGL driver and which effects are running.
Please post the information provided underneath this introductory text to a paste bin service
like https://paste.kde.org instead of pasting into support threads.

==========================

Version
=======
KWin version: 5.18.3
Qt Version: 5.14.1
Qt compile version: 5.14.1
XCB compile version: 1.14                                                                                           

Operation Mode: X11 only                                                                                            

Build Options                                                                                                       
=============                                                                                                       
KWIN_BUILD_DECORATIONS: yes                                                                                         
KWIN_BUILD_TABBOX: yes                                                                                              
KWIN_BUILD_ACTIVITIES: yes                                                                                          
HAVE_DRM: yes                                                                                                       
HAVE_GBM: yes                                                                                                       
HAVE_EGL_STREAMS: yes                                                                                               
HAVE_X11_XCB: yes                                                                                                   
HAVE_EPOXY_GLX: yes                                                                                                 
HAVE_WAYLAND_EGL: yes                                                                                               

X11                                                                                                                 
===                                                                                                                 
Vendor: The X.Org Foundation                                                                                        
Vendor Release: 12007000                                                                                            
Protocol Version/Revision: 11/0                                                                                     
SHAPE: yes; Version: 0x11                                                                                           
RANDR: yes; Version: 0x14                                                                                           
DAMAGE: yes; Version: 0x11                                                                                          
Composite: yes; Version: 0x4                                                                                        
RENDER: yes; Version: 0xb                                                                                           
XFIXES: yes; Version: 0x50                                                                                          
SYNC: yes; Version: 0x31                                                                                            
GLX: yes; Version: 0x0                                                                                              

Decoration                                                                                                          
==========                                                                                                          
Plugin: org.kde.breeze                                                                                              
Theme:                                                                                                              
Plugin recommends border size: None                                                                                 
Blur: 0                                                                                                             
onAllDesktopsAvailable: false                                                                                       
alphaChannelSupported: true                                                                                         
closeOnDoubleClickOnMenu: false                                                                                     
decorationButtonsLeft: 0, 2                                                                                         
decorationButtonsRight: 6, 3, 4, 5                                                                                  
borderSize: 0                                                                                                       
gridUnit: 10                                                                                                        
font: Noto Sans,10,-1,0,50,0,0,0,0,0,Regular                                                                        
smallSpacing: 2                                                                                                     
largeSpacing: 10                                                                                                    

Platform                                                                                                            
==========                                                                                                          
Name: KWin::X11StandalonePlatform                                                                                   

Options                                                                                                             
=======                                                                                                             
focusPolicy: 0                                                                                                      
nextFocusPrefersMouse: false                                                                                        
clickRaise: true                                                                                                    
autoRaise: false                                                                                                    
autoRaiseInterval: 0                                                                                                
delayFocusInterval: 0                                                                                               
shadeHover: false                                                                                                   
shadeHoverInterval: 250                                                                                             
separateScreenFocus: false                                                                                          
placement: 4                                                                                                        
focusPolicyIsReasonable: true                                                                                       
borderSnapZone: 10                                                                                                  
windowSnapZone: 10                                                                                                  
centerSnapZone: 0                                                                                                   
snapOnlyWhenOverlapping: false                                                                                      
rollOverDesktops: true                                                                                              
focusStealingPreventionLevel: 1                                                                                     
operationTitlebarDblClick: 5000                                                                                     
operationMaxButtonLeftClick: 5000                                                                                   
operationMaxButtonMiddleClick: 5015                                                                                 
operationMaxButtonRightClick: 5014                                                                                  
commandActiveTitlebar1: 0                                                                                           
commandActiveTitlebar2: 28                                                                                          
commandActiveTitlebar3: 2                                                                                           
commandInactiveTitlebar1: 4                                                                                         
commandInactiveTitlebar2: 28                                                                                        
commandInactiveTitlebar3: 2                                                                                         
commandWindow1: 7                                                                                                   
commandWindow2: 8                                                                                                   
commandWindow3: 8                                                                                                   
commandWindowWheel: 28                                                                                              
commandAll1: 10                                                                                                     
commandAll2: 3                                                                                                      
commandAll3: 14                                                                                                     
keyCmdAllModKey: 16777251                                                                                           
showGeometryTip: false                                                                                              
condensedTitle: false                                                                                               
electricBorderMaximize: true                                                                                        
electricBorderTiling: true                                                                                          
electricBorderCornerRatio: 0.25                                                                                     
borderlessMaximizedWindows: false                                                                                   
killPingTimeout: 5000                                                                                               
hideUtilityWindowsForInactive: true                                                                                 
compositingMode: 1                                                                                                  
useCompositing: true                                                                                                
hiddenPreviews: 1                                                                                                   
glSmoothScale: 1                                                                                                    
xrenderSmoothScale: false                                                                                           
maxFpsInterval: 16666666                                                                                            
refreshRate: 0                                                                                                      
vBlankTime: 6000000                                                                                                 
glStrictBinding: false                                                                                              
glStrictBindingFollowsDriver: true                                                                                  
glCoreProfile: true                                                                                                 
glPreferBufferSwap: 99                                                                                              
glPlatformInterface: 1                                                                                              
windowsBlockCompositing: true                                                                                       

Screen Edges                                                                                                        
============                                                                                                        
desktopSwitching: false                                                                                             
desktopSwitchingMovingClients: false                                                                                
cursorPushBackDistance: 1x1                                                                                         
timeThreshold: 150                                                                                                  
reActivateThreshold: 350                                                                                            
actionTopLeft: 0                                                                                                    
actionTop: 0                                                                                                        
actionTopRight: 0                                                                                                   
actionRight: 0                                                                                                      
actionBottomRight: 0                                                                                                
actionBottom: 0                                                                                                     
actionBottomLeft: 0                                                                                                 
actionLeft: 0                                                                                                       

Screens                                                                                                             
=======                                                                                                             
Multi-Head: no                                                                                                      
Active screen follows mouse:  no                                                                                    
Number of Screens: 1                                                                                                

Screen 0:                                                                                                           
---------                                                                                                           
Name: DVI-D-0                                                                                                       
Geometry: 0,0,1680x1050                                                                                             
Scale: 1                                                                                                            
Refresh Rate: 59.954                                                                                                


Compositing                                                                                                         
===========                                                                                                         
Compositing is active                                                                                               
Compositing Type: OpenGL                                                                                            
OpenGL vendor string: NVIDIA Corporation                                                                            
OpenGL renderer string: GeForce GTX 1050 Ti/PCIe/SSE2                                                               
OpenGL version string: 3.1.0 NVIDIA 440.64                                                                          
OpenGL platform interface: GLX                                                                                      
OpenGL shading language version string: 1.40 NVIDIA via Cg compiler                                                 
Driver: NVIDIA                                                                                                      
Driver version: 440.64                                                                                              
GPU class: Unknown                                                                                                  
OpenGL version: 3.1                                                                                                 
GLSL version: 1.40                                                                                                  
X server version: 1.20.7                                                                                            
Linux kernel version: 5.5.13                                                                                        
Direct rendering: Requires strict binding: no                                                                       
GLSL shaders:  yes                                                                                                  
Texture NPOT support:  yes                                                                                          
Virtual Machine:  no                                                                                                
OpenGL 2 Shaders are used                                                                                           
Painting blocks for vertical retrace:  yes                                                                          

Loaded Effects:                                                                                                     
---------------                                                                                                     
kwin4_effect_sessionquit                                                                                            
kwin4_effect_translucency                                                                                           
zoom                                                                                                                
kwin4_effect_fadingpopups                                                                                           
kwin4_effect_fade                                                                                                   
kwin4_effect_dialogparent                                                                                           
kwin4_effect_morphingpopups                                                                                         
kwin4_effect_frozenapp                                                                                              
kwin4_effect_windowaperture                                                                                         
kwin4_effect_squash                                                                                                 
kwin4_effect_maximize                                                                                               
kwin4_effect_login                                                                                                  
kwin4_effect_logout                                                                                                 
slidingpopups                                                                                                       
slide                                                                                                               
screenshot                                                                                                          
desktopgrid                                                                                                         
colorpicker                                                                                                         
presentwindows                                                                                                      
highlightwindow                                                                                                     
blur                                                                                                                
contrast                                                                                                            
startupfeedback                                                                                                     
screenedge                                                                                                          
kscreen                                                                                                             

Currently Active Effects:                                                                                           
-------------------------                                                                                           
blur                                                                                                                
contrast                                                                                                            

Effect Settings:                                                                                                    
----------------                                                                                                    
kwin4_effect_sessionquit:                                                                                           
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_translucency:                                                                                          
isActiveFullScreenEffect: false                                                                                     

zoom:                                                                                                               
zoomFactor: 1.2                                                                                                     
mousePointer: 0                                                                                                     
mouseTracking: 0                                                                                                    
enableFocusTracking: false                                                                                          
followFocus: true                                                                                                   
focusDelay: 350                                                                                                     
moveFactor: 20                                                                                                      
targetZoom: 1                                                                                                       

kwin4_effect_fadingpopups:                                                                                          
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_fade:                                                                                                  
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_dialogparent:                                                                                          
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_morphingpopups:                                                                                        
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_frozenapp:                                                                                             
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_windowaperture:                                                                                        
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_squash:                                                                                                
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_maximize:                                                                                              
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_login:                                                                                                 
isActiveFullScreenEffect: false                                                                                     

kwin4_effect_logout:                                                                                                
isActiveFullScreenEffect: false                                                                                     

slidingpopups:                                                                                                      
slideInDuration: 150                                                                                                
slideOutDuration: 250                                                                                               

slide:                                                                                                              
duration: 500                                                                                                       
horizontalGap: 45                                                                                                   
verticalGap: 20                                                                                                     
slideDocks: false                                                                                                   
slideBackground: true                                                                                               

screenshot:                                                                                                         

desktopgrid:                                                                                                        
zoomDuration: 300                                                                                                   
border: 10                                                                                                          
desktopNameAlignment: 0                                                                                             
layoutMode: 0
customLayoutRows: 2
usePresentWindows: true

colorpicker:

presentwindows:
layoutMode: 0
showCaptions: true
showIcons: true
doNotCloseWindows: false
ignoreMinimized: false
accuracy: 20
fillGaps: true
fadeDuration: 150
showPanel: false
leftButtonWindow: 1
rightButtonWindow: 2
middleButtonWindow: 0
leftButtonDesktop: 2
middleButtonDesktop: 0
rightButtonDesktop: 0

highlightwindow:

blur:

contrast:

startupfeedback:
type: 1

screenedge:

kscreen:

Hope this helps!

Offline

#4 2020-03-30 06:26:18

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Screen Tearing with NVIDIA GPU on Certain Applications

FF is notorious for tearing w/ smooth scrolling - since it afaiu uses an internal GL context, syncing in the compositor won't matter if the client doesn't sync (the compositor gets content with tear lines to display)
Try to "export __GL_SYNC_TO_VBLANK=1" to FF

Offline

#5 2020-03-30 14:21:51

Lenix
Member
Registered: 2020-03-29
Posts: 6

Re: Screen Tearing with NVIDIA GPU on Certain Applications

Trying "export __GL_SYNC_TO_VBLANK=1" didn't work, but I'm not completely sure I'm doing it right. I've never truly messed with environment variables before, so do I just put that in a terminal, or is there something I have to do with Firefox directly?

Offline

#6 2020-03-30 15:28:46

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Screen Tearing with NVIDIA GPU on Certain Applications

It needs to be exported to the shell that starts FF, so for a quick test open a terminal emulator (konsole), ensure there's no running FF process (ps aux | grep firefox), export the value and the run firefox from that very terminal.
You can export it to plasma from an executable script in ~/.config/plasma-workspace/env (but obviously that won't work w/ other environments)

Offline

#7 2020-03-30 16:03:56

Lenix
Member
Registered: 2020-03-29
Posts: 6

Re: Screen Tearing with NVIDIA GPU on Certain Applications

That makes sense, thanks. While that didn't fix the issue, I did find some messages in the terminal I opened firefox with. They seem to be errors from the media decoder, which could help explain my issue:

[Child 6943, MediaDecoderStateMachine #1] WARNING: Decoder=7f885edd7000 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - RefPtr<MediaSourceTrackDemuxer::SamplesPromise> mozilla::MediaSourceTrackDemuxer::DoGetSamples(int32_t): manager is detached.: file /build/firefox/src/firefox-74.0/dom/media/MediaDecoderStateMachine.cpp, line 3358

Offline

#8 2020-04-09 01:06:42

Lenix
Member
Registered: 2020-03-29
Posts: 6

Re: Screen Tearing with NVIDIA GPU on Certain Applications

Hello,

It's been a week since my last post, and despite constant troubleshooting, I still cannot figure out what the issue is. I'm aware that "bumping" is considered rude here, so I'll include some things that I've tried in hopes that I can get this solved.

I've tried:
1. exporting KWIN_TRIPLE_BUFFER=1
2. keeping my packages updated (on kernel 5.6.3 and Nvidia 440.82-2 now)
3. disabling the compositor completely
4. locking the compositor fps to 60 (under ~/.config/kwinrc)

However, none of these have solved my issue. I decided to just live with it for the past week, but it would be amazing if I could get this figured out.
Thanks!

Offline

#9 2020-04-11 17:18:35

Xakep_SDK
Member
Registered: 2017-09-23
Posts: 61

Re: Screen Tearing with NVIDIA GPU on Certain Applications

1. Disable all anti-tearing solutions
2. Remove xorg.conf
3. Set vsync to "automatic" in kwin settings

I don't have tearing at all
nvidia 440.82
kwin-lowlatency 5.18.4 (i don't have it even in stock kwin)

Last edited by Xakep_SDK (2020-04-11 17:18:51)

Offline

#10 2020-08-14 18:17:48

isavcic
Member
Registered: 2020-02-26
Posts: 1

Re: Screen Tearing with NVIDIA GPU on Certain Applications

Xakep_SDK wrote:

1. Disable all anti-tearing solutions
2. Remove xorg.conf
3. Set vsync to "automatic" in kwin settings

I don't have tearing at all
nvidia 440.82
kwin-lowlatency 5.18.4 (i don't have it even in stock kwin)

This. This has actually fixed the tearing I had, and I had turned every possible knob there is, although I'm still seeing tearing in Firefox while I have mpv playing something.

Last edited by isavcic (2020-08-14 18:19:29)

Offline

Board footer

Powered by FluxBB