nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   VSYNC Frame Counter (http://www.nvnews.net/vbulletin/showthread.php?t=140541)

Paul1492 10-27-09 07:44 AM

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 10-27-09 11:00 AM

Re: VSYNC Frame Counter
 
1 Attachment(s)
Here is the bug report..

xbobmx 10-27-09 01:11 PM

Re: VSYNC Frame Counter
 
Quote:

Originally Posted by Paul1492 (Post 2111888)
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).

Paul1492 10-27-09 04:01 PM

Re: VSYNC Frame Counter
 
I believe I had Framelock on when I used glXQueryFrameCountNV() and didn't see the value change.

Paul1492 10-29-09 11:17 AM

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 11-23-09 03:39 PM

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.

karl.cary 11-25-09 03:23 PM

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.

Paul1492 12-22-09 08:52 AM

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 05-11-10 01:49 PM

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.

AaronP 05-11-10 04:49 PM

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.

Paul1492 05-12-10 12:55 PM

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.

bobo1on1 05-28-10 09:18 AM

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


All times are GMT -5. The time now is 07:03 AM.

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