Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 03-09-09, 08:28 AM   #1
Malvineous
Registered User
 
Join Date: Sep 2006
Posts: 17
Question How do you stop OpenGL tearing?

Hi all,

Since the 170 series I've been having terrible problems with tearing. I run Compiz Fusion, and whenever I rotate the desktop cube it looks terrible. Watching videos isn't great either. I thought enabling Sync to VBlank was meant to fix this, but it doesn't seem to help - I have these options enabled:

ccsm | General Options | Display Settings | Sync To VBlank - ticked
nvidia-settings | OpenGL Settings | Sync to VBlank - ticked (also "Allow Flipping" is ticked)

I have this same problem with different Compiz versions (0.7.6 and latest git) on both a GeForce Quadro (sorry, don't have the model handy) and an 8600GT.

Any ideas how to stop the tearing??

If it helps, here's my nvidia-bug-report.log.
Malvineous is offline   Reply With Quote
Old 03-09-09, 08:44 AM   #2
Malvineous
Registered User
 
Join Date: Sep 2006
Posts: 17
Default Re: How do you stop OpenGL tearing?

Hmm, just discovered something interesting. Although I always used to have this problem with one monitor, now that I have two (set up as separate X screens) it seems that the primary monitor is actually syncing to the refresh rate of the second one!

If I disable sync to vblank on the primary screen then the cube rotation gets *much* smoother, but of course still tears. According to the Compiz benchmark plugin I'm getting 60fps with vblank sync off, but as soon as I enable vblank sync it drops to ~30fps (and becomes very jerky, but still tears.) With the old drivers (before 170) and one monitor, I used to get 60fps with vblank enabled and no tearing. (The second monitor only appeared a couple of weeks ago, before then I didn't have any dual monitors configured in xorg.conf and for months it has been tearing.)

Looks like there's something funky going on with that. Interestingly on the Quadro both monitors are running @ 60Hz in Twinview, and it's very smooth (60fps) but still tears badly.
Malvineous is offline   Reply With Quote
Old 03-09-09, 10:10 AM   #3
Dragoran
Registered User
 
Join Date: May 2004
Posts: 711
Default Re: How do you stop OpenGL tearing?

Disable detect refresh rate in compiz and set it to 60
Dragoran is offline   Reply With Quote
Old 03-09-09, 06:09 PM   #4
Malvineous
Registered User
 
Join Date: Sep 2006
Posts: 17
Default Re: How do you stop OpenGL tearing?

Thanks for the suggestion - I've tried that, but unfortunately it doesn't make any difference :-( With a single monitor it increases the framerate, with dual monitors it doesn't make a difference. Plus it still tears either way.
Malvineous is offline   Reply With Quote
Old 03-09-09, 06:31 PM   #5
mlord
Linux kernel hacker
 
Join Date: Feb 2009
Location: Ottawa, Canada
Posts: 173
Default Re: How do you stop OpenGL tearing?

Quote:
Originally Posted by Malvineous View Post
Hmm, just discovered something interesting. Although I always used to have this problem with one monitor, now that I have two (set up as separate X screens) it seems that the primary monitor is actually syncing to the refresh rate of the second one!
There's a setting for that somewhere in nvidia-settings. I expect that both displays will have to use identical refresh rates for what you are doing to work without tearing.

Cheers
mlord is offline   Reply With Quote
Old 05-23-09, 08:08 PM   #6
Malvineous
Registered User
 
Join Date: Sep 2006
Posts: 17
Default Re: How do you stop OpenGL tearing?

Well I think I figured this one out. None of the sync to vblank options work through the GUI, but if I put the command "export __GL_SYNC_TO_VBLANK=1" in my ~/.xsession file (so that it runs before Compiz loads) then sync to vblank is actually enabled, and I don't get tearing any more! Unfortunately it only works on the primary monitor, the second monitor still tears but because I don't use that for watching video I can live with it...
Malvineous is offline   Reply With Quote
Old 05-26-09, 02:20 PM   #7
mocharhw
Registered User
 
Join Date: May 2008
Posts: 113
Default Re: How do you stop OpenGL tearing?

Quote:
Originally Posted by Malvineous View Post
Well I think I figured this one out. None of the sync to vblank options work through the GUI, but if I put the command "export __GL_SYNC_TO_VBLANK=1" in my ~/.xsession file (so that it runs before Compiz loads) then sync to vblank is actually enabled, and I don't get tearing any more! Unfortunately it only works on the primary monitor, the second monitor still tears but because I don't use that for watching video I can live with it...
Try __GL_SYNC_DISPLAY_DEVICE=DFP-0 replace the "DFP-0" part with whatever your secondary monitor is named.
mocharhw is offline   Reply With Quote
Old 05-26-09, 07:19 PM   #8
psychok9
Registered User
 
Join Date: Dec 2008
Posts: 55
Default Re: How do you stop OpenGL tearing?

Can I sync both monitors?
2 LCD with 60Hz refresh...
I'm using the 2nd for view video/movie on fullscreen...
psychok9 is offline   Reply With Quote

Old 05-27-09, 03:57 AM   #9
mocharhw
Registered User
 
Join Date: May 2008
Posts: 113
Default Re: How do you stop OpenGL tearing?

Quote:
Originally Posted by psychok9 View Post
Can I sync both monitors?
2 LCD with 60Hz refresh...
I'm using the 2nd for view video/movie on fullscreen...
The short answer is no, not at the same time. What I normally do is specify my main monitor (DFP-0) to sync at bootup. Then for specific programs that I want to sync to the other monitor I use a script to change the environment variable temporairily, something like this:

#!/bin/bash
export __GL_SYNC_TO_VBLANK=1
export __GL_SYNC_DISPLAY_DEVICE=TV-0
mythfrontend
mocharhw is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenGL book Airstrip1 Software Development 2 08-12-12 09:55 AM
Major WineX prob... I think it has to do with the vidcard... Linewbie NVIDIA Linux 20 10-09-02 10:58 PM
Refresh rate fix for opengl? Zarich NVIDIA Windows Graphics Drivers 1 08-29-02 03:47 PM
linux opengl extension chijacky NVIDIA Linux 5 08-23-02 12:16 PM
Slow OpenGL on 7.3 kl899 NVIDIA Linux 1 08-04-02 08:58 PM

All times are GMT -5. The time now is 04:22 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.