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 Question (http://www.nvnews.net/vbulletin/showthread.php?t=88186)

jesmith 03-15-07 02:08 PM

VSync Question
 
2 Attachment(s)
We're porting our app to Linux and trying to get it to run well with a couple HD monitors. One monitor is 1366x768p@60Hz and the other is 1920x1080p@49Hz. I've followed various NVIDIA advice to create modelines for these monitors which exactly match the timings being used in Windows.

The xorg.conf and nvidia-bug-report.log are attached.

My application is using JOGL (Java/OpenGL). We ordinarily call gl.setSwapInterval(1) to limit our frame rate to monitor refresh, to avoid tearing. When I show a trivial scene in Windows, I get 60FPS. If I call gl.setSwapInterval(0) to allow gl to run as fast as it can I get 300-340 FPS.

Now running that same app in Linux on the same hardware, I'm getting 55FPS, regardless of whether I ask GL to wait for vsync or not. It consistently tears since 55!=60 (on the first monitor), and 55!=49 (on the second monitor).

I've tried export __GL_SYNC_TO_VBLANK=1 and =0, and it has no effect.

It seems that *something* is trying to sync to vblank, and that something is convinced that we're running at about 55Hz.

Any ideas?

-Joshua

netllama 03-15-07 02:34 PM

Re: VSync Question
 
You can only sync to one display device at a time. If you're using two, and they do not have the same mode, I'd expect there to be tearing on whichever isn't being sync'ed to.

However, according to your bug report, you're only using a single display device. Are you stating that if you export __GL_SYNC_TO_VBLANK=1 and run glxgears you're seeing a FTPS number significantly larger than 60?

Also, 1.0-9629 is no longer supported, please retest with 1.0-9755.

jesmith 03-15-07 03:24 PM

Re: VSync Question
 
Sorry if I wasn't clear. I'm only using one display device at a time. I'm just seeing the same problem with each monitor when I test them separately.

I just ran glxgears and it reports crazy high FPS numbers regardless of the setting of that environment variable. Note that this is inconsistent with my JOGL application, which is running at a steady 55FPS, regardless of the setting.

I'll look into updating my drivers, and try these tests again...

-Joshua

netllama 03-15-07 03:29 PM

Re: VSync Question
 
If updating the driver does not help, I'd like to see the output from 'env'.

Thanks,
Lonni

jesmith 03-22-07 01:49 PM

Re: VSync Question
 
1 Attachment(s)
OK, I'm finally running the latest drivers and the behavior I'm seeing is still weird. To keep things simple let's first figure out why glxgears is running at 18,000FPS despite the fact that I have __GL_SYNC_TO_VBLANK=1.

I've attached the new debug log, along with the output of env. Note that I'm doing export __GL_SYNC_TO_VBLANK=1 early in the boot process, before the NVIDIA drivers are even loaded.

So, using the latest drivers, what is the magic formula so that glxgears will report 60FPS on my 60Hz monitor?

netllama 03-22-07 02:33 PM

Re: VSync Question
 
What happens if you run the following command (all in one line):
__GL_SYNC_TO_VBLANK=1 glxgears

jesmith 03-22-07 02:44 PM

Re: VSync Question
 
Script started on Thu Mar 22 14:26:54 2007
sh-3.1# __GL_SYNC_TO_VBLANK=1 glxgears
92349 frames in 5.0 seconds = 18465.003 FPS

sh-3.1# exit

Script done on Thu Mar 22 14:27:19 2007

netllama 03-22-07 02:59 PM

Re: VSync Question
 
On your system, is glxgears a binary or a shell script?

jesmith 03-22-07 03:09 PM

Re: VSync Question
 
Binary. file glxgears says:

ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped

netllama 03-22-07 03:11 PM

Re: VSync Question
 
You're running this locally, not over ssh or over an exported X display?

Beyond that, I'm not sure what else to suggest, as no one else is reporting this problem, and I cannot reproduce it here either.

jesmith 03-22-07 03:20 PM

Re: VSync Question
 
Yup, locally.

Since the whole point of this exercise is to create a bootable USB linux distro (I'm using SLAX as the starting point, which is Slackware 11 with an updated kernel and linux live scripts), I can snail mail you a USB key you can boot to see the issue.

-Joshua

netllama 03-22-07 03:22 PM

Re: VSync Question
 
Sure, I'll send you a PM with my shipping address.

thanks,
Lonni


All times are GMT -5. The time now is 01:43 PM.

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