Choose style:

Author Topic: Screen Tearing NVIDIA GeForce GT 520 and GTX 650 (SOLVED)  (Read 4967 times)

0 Members and 1 Guest are viewing this topic.

Offline GNULINUX

  • Trusted User
  • Member
  • *****
  • Posts: 987
  • Karma: 311
    • View Profile
  • Peppermint version(s): Peppermint Six (x64)
Screen Tearing NVIDIA GeForce GT 520 and GTX 650 (SOLVED)
« on: December 23, 2015, 03:33:54 pm »
Hi,

I've got (mild) screen tearing on my two desktops. Both have nVidia drivers in use.
Code: [Select]
NVIDIA GF119 [GeForce GT 520]
NVIDIA GK107 [GeForce GTX 650]

Following command resolves the problem on both machines:
Code: [Select]
sudo nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

So I edited the config file to make the change definitive:
Code: [Select]
sudo nvidia-xconfig

sudo gedit /etc/X11/xorg.conf

and added:
Code: [Select]
Option         "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

My current xorg.conf-file on the NVIDIA GK107 [GeForce GTX 650] machine:
Code: [Select]
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 352.63  (buildmeister@swio-display-x64-rhel04-11)  Sat Nov  7 22:00:19 PST 2015

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"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

After a restart the screen tearing is back. I checked the config file (on both machines) and the extra option is still there...
What have I missed? Is there another way to make the changes permanent?

Thanks in advance!
« Last Edit: December 29, 2015, 04:35:40 pm by GNULINUX »
Peppermint 6  (x64)   -   Windows 7 Ultimate SP1  (x64)
Running different OS flavors in VirtualBox, just for fun!

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #1 on: December 23, 2015, 10:32:32 pm »
Unfortunately, that's the only way I know of to do it.  Not that there isn't necessarily another way, but that's the only one I know of.  Unfortunately, screen tearing on Linux is a massive issue with Nvidia GPUs, one that Nvidia themselves seems resolute to ignore, rather than address.  Too bad they're not like AMD, which actually has a "tear free" option in their driver settings utility.

Offline GNULINUX

  • Trusted User
  • Member
  • *****
  • Posts: 987
  • Karma: 311
    • View Profile
  • Peppermint version(s): Peppermint Six (x64)
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #2 on: December 24, 2015, 05:11:42 am »
scifidude79, thanks for your answer.  ;)

It's just like the xorg.conf-file is not being used at startup?

But the following commant does the trick and is working, no more screen tearing...
Code: [Select]
sudo nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
Can I make it run at startup in any way?

Thanks in advance!  ;)
Peppermint 6  (x64)   -   Windows 7 Ultimate SP1  (x64)
Running different OS flavors in VirtualBox, just for fun!

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #3 on: December 24, 2015, 10:06:55 am »
I don't know why it's not being run on startup.  :o  It is on my desktop.  Though, you're probably also using a newer driver, which may make a difference.  I'm sure one of the other high speed people around here can help you figure out if it's running at startup and, if not, get it going at startup.  I'm not entirely sure how to do it, beyond creating it and letting the "magic" happen.  ;)

Offline GNULINUX

  • Trusted User
  • Member
  • *****
  • Posts: 987
  • Karma: 311
    • View Profile
  • Peppermint version(s): Peppermint Six (x64)
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #4 on: December 24, 2015, 10:44:21 am »
I'm not entirely sure how to do it, beyond creating it and letting the "magic" happen.  ;)
Yeah, I know the feeling. I think Santa has stolen my "magic"...  :o
Peppermint 6  (x64)   -   Windows 7 Ultimate SP1  (x64)
Running different OS flavors in VirtualBox, just for fun!

Offline GNULINUX

  • Trusted User
  • Member
  • *****
  • Posts: 987
  • Karma: 311
    • View Profile
  • Peppermint version(s): Peppermint Six (x64)
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #5 on: December 27, 2015, 06:08:18 pm »
Ok, after some testing.

NVIDIA GK107 [GeForce GTX 650]
First: kwin (on/of) has no effect on the screen tearing...
Second: NVIDIA X-Server Settings
I unchecked "Sync to VBlank" and the screen tearing was less.
Also unchecked "Allow Flipping" and the screen tearing is completely gone!  :)



NVIDIA GF119 [GeForce GT 520]
First: no kwin on this PC...
Second: NVIDIA X-Server Settings
Unchecking both items just gives me more screen tearing!  :(


Ideally I should have a "script" running at startup but I'm too newbie to pull that off on my own.
What I've tried...
Code: [Select]
#!/bin/bash
sudo nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
The problem is "sudo" (still need to enter the password) and the fact that I'm not capable of making it run at startup by simply adding the file-location...
If I double click the file (screentearing.sh) and choose "Run in Terminal", I can type my password and the screen tearing is gone.

Help is much appreciated!  ;)
« Last Edit: December 28, 2015, 08:31:49 am by GNULINUX »
Peppermint 6  (x64)   -   Windows 7 Ultimate SP1  (x64)
Running different OS flavors in VirtualBox, just for fun!

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #6 on: December 28, 2015, 09:51:06 am »
Yeah, that's part of the problem with Nvidia hardware.  Different GPUs require different things to get them working 100%.  ::)  They make the best gaming chipsets on the planet, in my opinion, but they can be a real pain, especially on Linux.

Maybe somebody can help you write a script to run that command at startup.  Unfortunately, I'm not any good at that sort of thing.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26313
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #7 on: December 28, 2015, 03:59:28 pm »
Have you tried just adding the line
Code: [Select]
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
to /etc/rc.local just above the "exit 0" line

If that doesn't work, bung your script somewhere, remove the "sudo", make it executable, and enter the path to the script in /etc/rc.local

Effectively, everything in /etc/rc.local will get run during boot .. as root
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline GNULINUX

  • Trusted User
  • Member
  • *****
  • Posts: 987
  • Karma: 311
    • View Profile
  • Peppermint version(s): Peppermint Six (x64)
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #8 on: December 29, 2015, 08:42:04 am »
First I've set the NVIDIA X Server Settings back to standard and deleted the xorg.conf file I've made in previous attempts...

1) Changed rc.local to:
Code: [Select]
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
exit 0
2) Changed rc.local to:
Code: [Select]
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/peppermint/Downloads/screentearing.sh
exit 0
Tested on my two machines (to be sure kwin was not the cull-print) and after a reboot... no effect... screen tearing like before...

Content of the screentearing.sh file:
Code: [Select]
#!/bin/bash
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

Extra tests:

I deleted the extra line in the rc.local file and restarted, screen tearing like before.
When I run the same command (with or without "sudo" doesn't seem to mather) in the terminal, the screen goes black for a split second and the screen tearing is gone.
Restarted again so the screen tearing is back.
Double clicked the screentearing.sh file and was asked how to open it and I've chosen "Run in terminal". After that the screen goes black for a split second and the screen tearing is gone again.

I'm impressed by the stubbornness of my machines, what am I missing?  :-\
Thanks for your support PCNetSpec!
Peppermint 6  (x64)   -   Windows 7 Ultimate SP1  (x64)
Running different OS flavors in VirtualBox, just for fun!

Offline GNULINUX

  • Trusted User
  • Member
  • *****
  • Posts: 987
  • Karma: 311
    • View Profile
  • Peppermint version(s): Peppermint Six (x64)
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650
« Reply #9 on: December 29, 2015, 04:34:47 pm »
I'm making a new post because "we did it"!  8)

After good advice here and reading the first 50 (!) search results on the net, I tried "everything" that worked for others... I read somewhere that there's a difference in starting a command/script at boot and at the desktop, that got me thinking! The topic didn't give more information but that could be the reason that it was always working on the desktop but not at startup!
Bingo!


The Solution (in my case):

Create a script, I called it "screentearing.sh". Make sure it's executable for your user.
Code: [Select]
#!/bin/bash
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
Place it somewhere out of your view, I've made a separate directory for it...  ;)
The location in my case:
Code: [Select]
/home/peppermint/StartUp/screentearing.sh
And now the simplest... Just add that location to the Autostart applications for LXSession.
Entering the command in that place doesn't work...



Restart the machine and the script runs and does the job, screen tearing is 100% gone!
Works perfect for both machines.

Thank you scifidude79 and PCNetSpec for your support! (SOLVED)  :)
Peppermint 6  (x64)   -   Windows 7 Ultimate SP1  (x64)
Running different OS flavors in VirtualBox, just for fun!

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26313
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650 (SOLVED)
« Reply #10 on: December 30, 2015, 08:37:56 am »
Nice .. and thanks for taking the time to post your solution, I'm sure it'll help others in the same boat :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline Weyoun9

  • nOOb
  • *
  • Posts: 2
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 8
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650 (SOLVED)
« Reply #11 on: January 25, 2016, 05:49:55 am »
This video helped me solve the same screen tearing issue on an nvidia GTX 580 graphics card:


It also describes how to make the settings permanent for dual monitors.

Youtube URL
Code: [Select]
https://www.youtube.com/watch?v=Xo2jsZVXxYg
« Last Edit: January 25, 2016, 08:06:02 am by PCNetSpec »

Offline GNULINUX

  • Trusted User
  • Member
  • *****
  • Posts: 987
  • Karma: 311
    • View Profile
  • Peppermint version(s): Peppermint Six (x64)
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650 (SOLVED)
« Reply #12 on: January 25, 2016, 08:35:12 am »
Hi and welcome Weyoun9  :)

The video shows a similar fix I tried in my first post on this topic, sadly it didn't work for me.
But maybe it can help others with the same problems on NVIDIA cards!
Thanks for posting your solution.

Greets!
Peppermint 6  (x64)   -   Windows 7 Ultimate SP1  (x64)
Running different OS flavors in VirtualBox, just for fun!

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: Screen Tearing NVIDIA GeForce GT 520 and GTX 650 (SOLVED)
« Reply #13 on: January 25, 2016, 10:09:49 am »
Hi Weyoun9, welcome to the Peppermint community.  Thanks for the video link, I'm sure it'll help some people out  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.