You are not logged in.

#1 2015-07-06 06:24:58

STREBLO
Member
Registered: 2015-02-15
Posts: 135

[SOLVED] Nvidia Geforce GTX 970 Screen Tearing

July 29th, 2015 Update:
Ok, really wierd. I had marked this as solved after I found adding this to my 20-nvidia.conf fixed the problem

Option  "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

However, I had to reinstall arch and for some reason after the reinstall this will no longer fix the problem.I have gone over everything numerous times now and cannot figure out what is wrong. Running thee command by itself in the terminal also no longer fixes the problem. I have tried re-installing my nvidia drivers and that also does not help. I am wits end and do not know what to do and whats really irritating is the fact that it was working on my other install. Does anyone have any suggestions?
----------------------------------------------------------------------------------
July 31st, 2015 Update:
Ok, even wierder. I couldn't figure out what I had done on my other install to fix things EXCEPT for installing the nouveau drivers and then switching back to nvidia, THEN using:

Option  "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

So I tried switching to he nouveau drivers and then switching back to nvidia and applying the "Option... {FullCompositionPipeline = On}" and FUCK YES NO TEARING!! So I don't know why but unless I do that there is tearing.
----------------------------------------------------------------------------------

Original post:
I have had screen tearing when watching videos, gaming or sometimes scrolling and have tried everything I could find to fix the problem. I am using the proprietary driver and KDE 4 but I have the issue on plasma 5 and GNOME too and I am so tired of this issue i'm considering getting a new video card. I have a GeForce GTX 970. I have tried reinstalling arch and am all out of ideas.

What i've tried:

Adding triplebuffer=1 to /etc/profile.d/kwin.sh.

/etc/profile.d/kwin.sh
-------------------------
#!/bin/bash
export KWIN_TRIPLE_BUFFER=1

Adding export __GL_YIELD="USLEEP":

/etc/profile.d/kwin.sh
-------------------------
#!/bin/bash
export __GL_YIELD="USLEEP"

I have triplebuffering set to true on my /etc/X11/xorg.conf.d/20-nvidia.conf:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
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"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option "TripleBuffer" "true"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

In my nvidia settings I have allow flipping and sync to vblank checked.

Does anyone know how I can fix this?

Last edited by STREBLO (2015-07-31 21:09:05)

Offline

#2 2015-07-06 07:08:48

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Offline

#3 2015-07-06 08:35:57

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

There is something more: system settgins > desktop effects > advanced:
-choose open gl > 3.1
-choose graphic system QT: native
-vsync: on (it should be named something like by itself in english or automatically)

Try it.

Offline

#4 2015-07-06 08:54:41

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Funny, I don't think I've ever had tearing problems with GNOME. For Plasma 5 try going to System Settings -> Display and Monitor -> Compositor and set Tearing Prevention ("vsync"): to Full Screen Repaints.

Offline

#5 2015-07-06 19:07:53

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

firekage wrote:

There is something more: system settgins > desktop effects > advanced:
-choose open gl > 3.1
-choose graphic system QT: native
-vsync: on (it should be named something like by itself in english or automatically)

Try it.

No luck sad

Offline

#6 2015-07-06 20:24:11

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

I'd recommend removing the triplebuffer line.

Hopefully compton thread helps.

Offline

#7 2015-07-06 22:54:27

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

brebs wrote:

I'd recommend removing the triplebuffer line.

Hopefully compton thread helps.

I tried this, no luck...

compton --vsync opengl-oml

Can you replace kwin as your wm in KDE, I can't figure out how or if you can.

Offline

#8 2015-07-06 23:08:51

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

^ For me there is as an "openbox/KDE" session, which will start your KDE session but with openbox instead of kwin. I think you can run compton from within an openbox session.
There doesn't seem to be an option to switch it within system settings.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#9 2015-07-07 00:41:58

cjdood
Member
Registered: 2015-07-07
Posts: 6

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

The easy fix for me was to replace nvidia drivers with nouveau.

https://wiki.archlinux.org/index.php/Nouveau

Offline

#10 2015-07-07 11:47:55

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Except that this easy fix cripples your 3D performance. Maybe it's different with newer hardware, but on mine, I could no longer use mpv with opengl-hq renderer - it would stutter horribly.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#11 2015-07-08 23:23:14

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

cjdood wrote:

The easy fix for me was to replace nvidia drivers with nouveau.

https://wiki.archlinux.org/index.php/Nouveau

Tried that, didn't help and made everything else terrible.

Offline

#12 2015-07-09 11:20:12

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

You don't seem to have tried the solution Head_on_a_Stick linked to (or you just haven't posted you tried it).


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#13 2015-07-13 22:48:54

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Soukyuu wrote:

You don't seem to have tried the solution Head_on_a_Stick linked to (or you just haven't posted you tried it).

No! Must have missed it. I'll give that a go.

Offline

#14 2015-07-13 23:40:43

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

I have no tearing in KDE4 or Plasma 5 with the following setup:

/etc/X11/xorg.conf.d/20-nvidia.conf:

Section "Device"
    Identifier "NVIDIA GPU"
    Driver "nvidia"
    Option "TripleBuffer" "False"
EndSection

Environment for kwin:

export __GL_YIELD="USLEEP"
export KWIN_TRIPLE_BUFFER=0
export KWIN_USE_BUFFER_AGE=0

Gnome also works without tearing. For Gnome, this environment variable hides a bug it has on NVIDIA drivers:

export CLUTTER_PAINT=continuous-redraw

Last edited by Ropid (2015-07-13 23:41:19)

Offline

#15 2015-07-14 02:28:30

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Ropid wrote:

I have no tearing in KDE4 or Plasma 5 with the following setup:

/etc/X11/xorg.conf.d/20-nvidia.conf:

Section "Device"
    Identifier "NVIDIA GPU"
    Driver "nvidia"
    Option "TripleBuffer" "False"
EndSection

Environment for kwin:

export __GL_YIELD="USLEEP"
export KWIN_TRIPLE_BUFFER=0
export KWIN_USE_BUFFER_AGE=0

Gnome also works without tearing. For Gnome, this environment variable hides a bug it has on NVIDIA drivers:

export CLUTTER_PAINT=continuous-redraw

usleep doesn't work for me as i said in my post.


Soukyuu wrote:

You don't seem to have tried the solution Head_on_a_Stick linked to (or you just haven't posted you tried it).

Head_on_a_Stick wrote:

Holy crap this did it! I've been trying to fix this forever, thanks!!

Offline

#16 2015-07-14 04:34:45

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

STREBLO wrote:

usleep doesn't work for me as i said in my post.

You have to use either __GL_YIELD=USLEEP, or triple buffer. You can't use both. Hints about the reason for that is here: https://bugs.kde.org/show_bug.cgi?id=322060

For me, triple buffer had the problem that things for some reason ran at 50 fps on my 60 Hz screen. This would then look like stutter.

When using double buffering, __GL_YIELD=USLEEP is needed. I think kwin tries to detect if USLEEP is enabled or not. If it's not there, it will not try to do tearing prevention.

STREBLO wrote:
Soukyuu wrote:

You don't seem to have tried the solution Head_on_a_Stick linked to (or you just haven't posted you tried it).

Head_on_a_Stick wrote:

Holy crap this did it! I've been trying to fix this forever, thanks!!

This fix had a terrible downside for me, but I don't remember the details anymore.

Offline

#17 2015-07-14 05:50:48

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Ropid wrote:
STREBLO wrote:

usleep doesn't work for me as i said in my post.

You have to use either __GL_YIELD=USLEEP, or triple buffer. You can't use both. Hints about the reason for that is here: https://bugs.kde.org/show_bug.cgi?id=322060

For me, triple buffer had the problem that things for some reason ran at 50 fps on my 60 Hz screen. This would then look like stutter.

When using double buffering, __GL_YIELD=USLEEP is needed. I think kwin tries to detect if USLEEP is enabled or not. If it's not there, it will not try to do tearing prevention.

STREBLO wrote:
Soukyuu wrote:

You don't seem to have tried the solution Head_on_a_Stick linked to (or you just haven't posted you tried it).

Head_on_a_Stick wrote:

Holy crap this did it! I've been trying to fix this forever, thanks!!

This fix had a terrible downside for me, but I don't remember the details anymore.

Yes, I know, I tried both of them separately as I said in my post. Let me know if you recal ghe downside.

Offline

#18 2015-07-14 15:30:10

Malkymder
Member
Registered: 2015-05-13
Posts: 258

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

for proprietary drivers...

Both KDE and Gnome call xrandr on their load up overriding whatever you set in 20-nvidia.conf.... for gnome you can use a startup script to reapply your xorg settings

KDE launches a service at startup that handles monitor changes... you could disable that service and it will keep your settings defined in the 20-nvidia.conf file or you could do the same and call a script to reapply your settings on startup

here is a sample command to do that (adjust it to your current settings)

nvidia-settings --assign CurrentMetaMode="DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline = On}"

Offline

#19 2015-07-14 16:22:43

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Did anyone try this for Plasma 5?

Chazza wrote:

For Plasma 5 try going to System Settings -> Display and Monitor -> Compositor and set Tearing Prevention ("vsync"): to Full Screen Repaints.

Offline

#20 2015-07-14 23:10:17

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Malkymder wrote:

for proprietary drivers...

Both KDE and Gnome call xrandr on their load up overriding whatever you set in 20-nvidia.conf.... for gnome you can use a startup script to reapply your xorg settings

KDE launches a service at startup that handles monitor changes... you could disable that service and it will keep your settings defined in the 20-nvidia.conf file or you could do the same and call a script to reapply your settings on startup

here is a sample command to do that (adjust it to your current settings)

nvidia-settings --assign CurrentMetaMode="DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline = On}"

Yea,  Head_on_s_Stick already mentioned that and as I said it fixed my problem.

Chazza wrote:

Did anyone try this for Plasma 5?

Chazza wrote:

For Plasma 5 try going to System Settings -> Display and Monitor -> Compositor and set Tearing Prevention ("vsync"): to Full Screen Repaints.

I tried it, didn't help me.

Offline

#21 2015-07-29 07:04:30

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Ok, really wierd. I had marked this as solved after I found adding this to my 20-nvidia.conf fixed the problem

Option  "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

However, I had to reinstall arch and for some reason after the reinstall this will no longer fix the problem.I have gone over everything numerous times now and cannot figure out what is wrong. Running thee command by itself in the terminal also no longer fixes the problem. I have tried re-installing my nvidia drivers and that also does not help. I am wits end and do not know what to do and whats really irritating is the fact that it was working on my other install. Does anyone have any suggestions?

Offline

#22 2015-07-30 00:42:46

Malkymder
Member
Registered: 2015-05-13
Posts: 258

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

The only thing that i do to remove tearing is use the fullcomposition ... i dont touch vsync settings anywhere ...
I do run a autostart script to reapply those settings after i log in on most desktop like gnome, kde etc......

this is all i have in my script (i do have multi monitors but removed my actual settings to show just what you posted)

nvidia-settings --assign CurrentMetaMode="DVI-I-1: nvidia-auto-select +0+0 {ForceFullCompositionPipeline = On}"

edit: fixed typo

Last edited by Malkymder (2015-07-30 00:44:08)

Offline

#23 2015-07-30 19:53:54

Goresome
Member
From: Russia
Registered: 2011-12-06
Posts: 67

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

GL_YIELD and KWIN_TRIPPLE_BUFFER are in fact bad, opposite to what devs say. See this https://bugs.kde.org/show_bug.cgi?id=346275

Basically KWIN drops frames without tripple buffering, or simply disables vsync.
There are two ways to workaround that:
1) No xorg.conf setting, no exported variables, log in, wait until vsync breaks and then switch OpenGL3-> OpenGL2 -> Apply -> OpenGL3 -> Apply. Works with everything including 'Re-use screen content".
2) Force triple buffering globally with "Option "TripleBuffer" 1" KWin should detect that automatically.

EDIT: 50Hz problem is known upstream and may or may not been fixed. You can manually specify refresf rate in ~/.config/kwinrc

[Compositing]
RefreshRate=60

Last edited by Goresome (2015-07-30 19:56:40)

Offline

#24 2015-07-31 21:09:24

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Nvidia Geforce GTX 970 Screen Tearing

Ok, even wierder. I couldn't figure out what I had done on my other install to fix things EXCEPT for installing the nouveau drivers and then switching back to nvidia, THEN using:

Option  "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

So I tried switching to he nouveau drivers and then switching back to nvidia and applying the "Option... {FullCompositionPipeline = On}" and FUCK YES NO TEARING!! So I don't know why but unless I do that there is tearing.

Offline

Board footer

Powered by FluxBB