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

Newegg Daily Deals

Reply
 
Thread Tools
Old 10-27-09, 06:44 AM   #1
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default VSYNC Frame Counter

Who mantains the VSYNC Frame Counter? Is it determined in the driver alone or is it maintained on the video card?

I'm trying to use glXWaitVideoSyncSGI(..,..,&count). I'm running at 60Hz, but when I look at "count" at 100ms since the last time I checked it, it simply is one more than last time.

During this 100ms, I'm either retrieving a texture from the GPU (and pulling to the CPU) or storing a texture on the GPU (from the CPU).

I would have expected the GPU to still increment this frame count (multiple times) even if I'm keeping the driver busy with something.

I have a G-SYNC card and tried glXQueryFrameCountNV() but it seems to be returning garbage for the frame count.

Am I missing something?

I'm using a Quadro FX 5600 with 185.18.14. I see 185.18.31 fixes some other glXWaitVideoSyncSGI problem. I'll get a sys-admin to install this driver but will it fix this problem?
Paul1492 is offline   Reply With Quote
Old 10-27-09, 10:00 AM   #2
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default Re: VSYNC Frame Counter

Here is the bug report..
Attached Files
File Type: gz nvidia-bug-report.log.gz (28.9 KB, 100 views)
Paul1492 is offline   Reply With Quote
Old 10-27-09, 12:11 PM   #3
xbobmx
Registered User
 
Join Date: May 2003
Posts: 191
Default Re: VSYNC Frame Counter

Quote:
Originally Posted by Paul1492 View Post
Who mantains the VSYNC Frame Counter? Is it determined in the driver alone or is it maintained on the video card?

I'm trying to use glXWaitVideoSyncSGI(..,..,&count). I'm running at 60Hz, but when I look at "count" at 100ms since the last time I checked it, it simply is one more than last time.

During this 100ms, I'm either retrieving a texture from the GPU (and pulling to the CPU) or storing a texture on the GPU (from the CPU).

I would have expected the GPU to still increment this frame count (multiple times) even if I'm keeping the driver busy with something.

I have a G-SYNC card and tried glXQueryFrameCountNV() but it seems to be returning garbage for the frame count.

Am I missing something?

I'm using a Quadro FX 5600 with 185.18.14. I see 185.18.31 fixes some other glXWaitVideoSyncSGI problem. I'll get a sys-admin to install this driver but will it fix this problem?
The two counts (from glXWaitVideoSyncSGI() and glXQueryFrameCountNV()) are unrelated. The former is only valid for a single monitor, while the latter gets its count from the gsync hardware and is valid across your entire framelock cluster. However, you need to enable framelock in nvidia-settings for the count from glXQueryFrameCountNV() to change (otherwise, it will remain constant).
xbobmx is offline   Reply With Quote
Old 10-27-09, 03:01 PM   #4
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default Re: VSYNC Frame Counter

I believe I had Framelock on when I used glXQueryFrameCountNV() and didn't see the value change.
Paul1492 is offline   Reply With Quote
Old 10-29-09, 10:17 AM   #5
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default Re: VSYNC Frame Counter

I've enabled FRAMELOCK (and toggled the test signal). I then do this:
Quote:
static void do_FrameCount(Display *dpy)
{
int loop = 100000000;
GLuint count;
while (loop > 0)
{
GLuint lastcount = count;
glXQueryFrameCountNV(dpy, XDefaultScreen(dpy), &count);
if (count != lastcount)
fprintf(stderr, "COUNT = %u\n", count);
--loop;
}
}
With my output being the following over a minute time period:
Quote:
COUNT = 138816840
COUNT = 7845976
COUNT = 138816840
COUNT = 7845976
COUNT = 138816840
COUNT = 7845976
COUNT = 138816840
COUNT = 7845976
COUNT = 138816840
I tried this on a couple of my systems with the same result.

Any idea what is going on?
Paul1492 is offline   Reply With Quote
Old 11-23-09, 02:39 PM   #6
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default Re: VSYNC Frame Counter

Any reason why glXWaitVideoSyncSGI() isn't working when I'm moving large textures between the CPU/GPU? See original post for details.
Paul1492 is offline   Reply With Quote
Old 11-25-09, 02:23 PM   #7
karl.cary
Registered User
 
Join Date: Mar 2009
Posts: 18
Default Re: VSYNC Frame Counter

We seem to be having the same issue. But we noticed that if we take focus away from our application that the frame count magically starts increasing. As soon as we refocus, it pauses and gets the same framecount again. Any ideas would be very much appreciated.
karl.cary is offline   Reply With Quote
Old 12-22-09, 07:52 AM   #8
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default Re: VSYNC Frame Counter

I seem to have gotten glXQueryFrameCountNV() to work but with 190.42 this call seems to take around 13ms to return. I didn't see this problem (took 2-3ms, still long), but I saw other video issues. Any idea what is going on or how to fix it?
Paul1492 is offline   Reply With Quote

Old 05-11-10, 12:49 PM   #9
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default Re: VSYNC Frame Counter

Let me try this again... I'm at a loss on this..

Why does it take 13ms for glXQueryFramCountNV() to return?

When fetching or storing from/to a large textures on the video card, why does glXWaitVideoSyncSGI() appear to sometimes return an incorrect frame count (i.e. frame count seems to be incremented by 1 but time several hundred milliseconds in time have passed)?

Any help would be appreciated.. I'm at a loss on how to tell if I have missed VSYNC.

I'm using 185.18.14 (newer versions of the driver caused me other video problems) on a Quadro FX 5600.

Paul P.
Paul1492 is offline   Reply With Quote
Old 05-11-10, 03:49 PM   #10
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: VSYNC Frame Counter

glXQueryFrameCountNV has to read the frame count from the gsync device over a very slow data link.

glXWaitVideoSyncSGI could be getting confused by on-demand vblank interrupts. Please try disabling that option to see if it returns better numbers.

If you continue to have trouble, please contact developer relations through the NVIDIA developer program, since they'll be better equipped to help you.
AaronP is offline   Reply With Quote
Old 05-12-10, 11:55 AM   #11
Paul1492
Registered User
 
Join Date: Feb 2007
Posts: 25
Default Re: VSYNC Frame Counter

WOW!! Thanks for the help.. One short response pointed me in the right direction after many months (off and on) of looking at this.

I set Option "OnDemandVBlankInterrupts" "false" in my /etc/X11/xorg.conf file and now it appears glXWaitVideoSyncSGI() is now working correctly. I didn't have an OnDemandVBlankInterrupts option previously.

But I'm a little confused. The README file says OnDemandVBlankInterrupts is off by default. So why do I need to set it to false explicitly?

Paul P.
Paul1492 is offline   Reply With Quote
Old 05-28-10, 08:18 AM   #12
bobo1on1
Registered User
 
Join Date: Dec 2006
Posts: 5
Default Re: VSYNC Frame Counter

I'm using glXGetVideoSyncSGI right after glXWaitVideoSyncSGI and that way the vblank counter is always correct.
I did notice that glXWaitVideoSyncSGI doesn't wait anymore when you change the displaymode through randr, as a workaround you can detach and attach the gl context when the vblank counter doesn't update after a call to glXWaitVideoSyncSGI.

You can see my code here starting on line 431: http://xbmc.svn.sourceforge.net/view...55&view=markup
bobo1on1 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


All times are GMT -5. The time now is 03:51 PM.


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