Reply to topic

Tearing with proprietary Nvidia drivers

josefr
Registered Member
Posts
4
Karma
0
Hi,

I am using KWin 5.5.3 with the proprietary Nvidia driver on a GTX 960 and see tearing when moving windows or in videos. A also saw this with an older version of KWin but there I was always able to "fix" this temporarily by changing any setting in the compositor settings (I think the settings were not read correctly during boot). But with KWin 5.5.3 this no longer works.

I enabled "sync to vblank" in the Nvidia driver settings and in the compositor setting: Rendering Backend OpenGL 3.1, OpenGL Interface: GLX, vsync automatic.

Is there any way to fix this?

Thanks,
Josef
luebking
Karma
0
That's not been a fix but operating on buggy code which didn't reset some flags.

The problem is likely that you're on double buffering ("grep -i triple /var/log/Xorg.0.log") and don't let the GPU yield using usleep, what causes (caused, maybe time for a re-check) busy waits for the vblank signal in the driver (ie. too high CPU load)

=> You can either enable triple buffering (xorg.conf snippet) or
Code: Select all
export __GL_YIELD="USLEEP"
kwin_x11 --replace &


If you've no preference, use triple buffering. Otherwise you can export that value session wide or use a kwin wrapper script to set it (ask back in doubt)
josefr
Registered Member
Posts
4
Karma
0
Thanks. Both triple buffering and usleep do work by exporting the variable and restarting kwin manually.

Then I created the script /etc/profile.d/kwin.sh and added
Code: Select all
export KWIN_TRIPLE_BUFFER=1

but this did not work. Where does KWin get its environment from?
luebking
Karma
0
Do not enforce triple buffering if it's not really activated (this messes frame time calculations) in xorg.conf.d, eg. /etc/X11/xorg.conf.d/20-nvidia.conf
Code: Select all
Section "Device"
    Identifier "Default nvidia Device"
    Driver      "nvidia"
    Option     "NoLogo"                          "True"
    Option     "CoolBits"                         "1"
    Option     "TripleBuffer"                  "True"
EndSection


Executable scripts in ~/.config/plasma-workspace/env/ are sourced by startkde, i'm at hand not sure whether and how /etc/profile is inherited by the session (could require a sddm or X11 restart)
josefr
Registered Member
Posts
4
Karma
0
Thanks, adding triple buffering to the xorg.conf works. One issue I had with this was that there was no xorg.conf but the nvidia settings tool can generate one, which I then modiefied.
luebking
Karma
0
xorg.conf is deprecated, avoid using it.
Instead add a configlet as posted and have the server incorporate it during the auto-setup-
sanwablo
Registered Member
Posts
2
Karma
0
Hello,

I've also got an Nvidia GTX 960 running with the proprietary nvidia driver version 367.57 on a Lenovo Y700 (which seems to have switchable Intel graphics), and I'm experiencing tearing in windows and videos.

I have tried adding export __GL_YIELD="USLEEP" and export KWIN_TRIPLE_BUFFER=1 to executable files in /etc/profile.d/ and ~/.config/plasma-workspace/env/, but neither of those have worked. I also tried adding Option "TripleBuffer" "True" and Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }" to xorg.conf. Creating /etc/X11/xorg.conf.d/20-nvidia.conf with the code provided by luebking actually made my laptop unable to boot, and I had to delete it from a live-USB environment.

My current xorg.conf file looks like this:

Code: Select all
 Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:[email protected]:2:0"
    Option "AccelMethod" "None"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:[email protected]:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection


Any suggestions?
User avatar int_ua
Registered Member
Posts
16
Karma
0
sanwablo wrote:Any suggestions?

The only thing that worked for me is
Code: Select all
options nvidia_384_drm modeset=1

found here https://ubuntuforums.org/showthread.php?t=2374405

Lenovo B590 (Intel + NVidia), Kubuntu 16.04 + HWE.
With
Code: Select all
Option      "TripleBuffer"   "True"
SDDM stopped starting too.

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Dibo, Google [Bot], Sogou [Bot]