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

Newegg Daily Deals

Reply
 
Thread Tools
Old 04-21-03, 02:31 PM   #1
casey
Registered User
 
Join Date: Apr 2003
Posts: 11
Send a message via ICQ to casey Send a message via AIM to casey
Default Driver bug

It seems that all Nvidia drivers post 28.80 cause image tearing. Im looking for volunteers to verify this. I have included my sample code and config details in the zip file /*sorry about the file extension *.zip this is the format the server requires*/. My program draws a sweeping vertical line and the swapbuffers is told to execute on the vertical retrace so I should only see an image tear when the render time of the graphics card exceeds the 60hz refresh 16.6667msec. It is my belief that the drivers (post 28.80) are running some random code segment every so often which causes this render time to exceed 16.667msec (about 1 out of 20 frames or so). The result, my line tears on my program. More importantly this is universal and all images displayed on an NVidia graphics card will show this tearing as well(when running drivers post 28.80). Or so i think.....

you will probably have to get the glut-3.7 stuff from:
http://www.opengl.org/developers/documentation/glut/
I tried shrink down my glut dir but max attach file size here is 100k er so. sorry. Look out for the Mesa lib calls in the Makefiles.
took me a while to get that solved.

questions? cjlancour@link.com
Attached Files
File Type: zip thing.zip (12.3 KB, 144 views)
casey is offline   Reply With Quote
Old 04-21-03, 05:03 PM   #2
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

Nah, you just need the GL/glut.h file, and libglut installed. Then, compile with gcc -o hello hello.c -lglut -lGLU -lGL -L/usr/X11R6/lib -- that works just fine, no need for the full glut source install.

But I don't see any tearing... what am I looking for? The output is simply various iterations of:

1050962054.632581: delta = 29.924989.

Is this normal?
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 04-22-03, 12:23 PM   #3
casey
Registered User
 
Join Date: Apr 2003
Posts: 11
Send a message via ICQ to casey Send a message via AIM to casey
Default RE: stuff

Thanks for the tip on how to compile that stuff easy.
That 1050962054.632581: delta = 29.924989 output
was code i added so i knew how long the render time was
between frames when a drop frame occurs in milliseconds. The actual tearing to look for is in the vertical sweeping line which will look something like this:

|
| image from new data post swapbuffers event
|
|
| image from data pre swapbuffers event
|


The tear in this example is beween 1st three lines and the last 3 lines. The tear in "hello" is a bit more subtile but it is there none the less (on all the computer's i have tested so far anyway, redhat 2.4-18kern dual ppro, gentoo 2.4.20kern P4). On all tests it seems to occur about 2/3s the way down the screen
and not constant, it comes and goes but you should be able to see it about 3-4 times per sweep (often enough not to be waiting arround for an error).


thanks for taking a look,

-=Casey cjlancour@link.com
casey is offline   Reply With Quote
Old 04-22-03, 12:31 PM   #4
casey
Registered User
 
Join Date: Apr 2003
Posts: 11
Send a message via ICQ to casey Send a message via AIM to casey
Default

This forum deleted the spaces i put in front of the last three vertical lines i put in, how frustrating(suppose PREVIEW would have solved that one!). Guess I should have known. Ok new example:

|
| image post swapbuffers event
|
`|
`| image pre swapbuffers event
`|

*Backticks added for effect only.
**I included the glut.h file here for those who dont have it.
casey is offline   Reply With Quote
Old 04-22-03, 02:00 PM   #5
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

You can use [code] tags to keep the spacing. Not that it matters; I think I know what you mean.

I can't really tell whether or not it's doing that here, though. It doesn't look like it, but then, the bar is moving so fast that I probably wouldn't be able to see it if it did.

Let me try putting a slowdown factor in there (nanosleep(10 ms) or something)...

Hmm, I still don't see anything. Could be that I'm blind, but now every last one of the delta's is 20, every single time...

Maybe it has something to do with the card, or the CPU? I've got an Athlon XP1800 in here, with a GF4 Ti4200 if you think that matters...
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 04-22-03, 03:37 PM   #6
casey
Registered User
 
Join Date: Apr 2003
Posts: 11
Send a message via ICQ to casey Send a message via AIM to casey
Default __GL_SYNC_TO_VBLANK=1

The bar is moving fast b/c you need to have the following environment variable set:

"export __GL_SYNC_TO_VBLANK=1" /* for bash */

You can type that from the bash command prompt to set the variable.

This will tell the computer to swapbuffers on vertical retrace rather than rendering at max speed or swaping buffers when as soon as its done rendering. I tried to mention that in some of the README stuff but it was badly written and done in a hurry, sorry. Set that environment variable and it should slow the line down to a reasonable speed. If you slow it w/ some kinda usleep er somthing, it wont be swaping on the vertical retrace(it will swap whenever), and you will defininitly see the line tearing(which might be a good experement so you know what the image tearing effect looks like). but running sync to vblank is supposed to eliminate this image tearing altogether (unless rendertime exceeds 16.67milliseconds, 60Hz or 13.8msec for 72hz ect.)

THe __GL_SYNC_TO_VBLANK=1 is what we use specificly to prevent image tearing on our realtime application for flight sims.

again, thanks for taking time to look at this. Since most people dont care about a little image tear, I believe this bug has gone unnoticed.

-=Casey cjlancour@link.com
casey is offline   Reply With Quote
Old 04-22-03, 04:59 PM   #7
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

Ah, you're right -- I had that set originally, then didn't when I rebuilt it the second time.

Setting it does slow the bar down, but I (unfortunately) still don't see any tearing at all. The bar does "stutter" once in a while (i.e. a single frame gets skipped), but this doesn't cause any tearing, just two frames with the bar in the same place.
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 04-22-03, 05:47 PM   #8
casey
Registered User
 
Join Date: Apr 2003
Posts: 11
Send a message via ICQ to casey Send a message via AIM to casey
Default

/me scratches head, rubbs eyes, stares at his program again. Humm.... Next question....
Why are my computers doing this?

Could I get a copy of your setup files(see if i have errored in some way):
XF86Config, XF86config.0.log, kernel vers, what driver yer using, ect. Wonder if its in my compiler some how? Are you using GART or NVIDIA's agp stuff?

The tearing is usualy only a few pixels wide. Wonder if speeding up the sweep would make it more obvious. Asuming its there and you dont see it, but its not like its really hard to see either so im guessing your right (/me shruggs).

void moveDisplay(void)
{
i = i + 0.004; /* change increment from 0.002 to 0.004 */
if (i > 1.0) {i = 0.0;}
glutPostRedisplay();
// usleep (16666);
}

As far as the jumping goes, thats normal b/c hello doesnt get exclusive access to the cpu, other progs like crond tones of windomanager apps will wake everyso often and cause that. just moving the mouse arround can do it too. To reduce this we usualy just run "X" no winmanager and kill all processes that we dont need (fakeing a realtime os, b/c we dont like the realtime linux)


thanks for the help,

-=Casey
casey is offline   Reply With Quote

Old 04-22-03, 05:59 PM   #9
bwkaz
Registered User
 
Join Date: Sep 2002
Posts: 2,262
Default

Ah -- I wonder if it's the -preempt patches...

Anyway, my X config is attached. There's really nothing in the log file, but if you still want, I'll attach it to the next post.

Kernel 2.4.20, with the -preempt patch.

I'm using agpgart, with a KT333 motherboard. But it really wouldn't surprise me if it was -preempt.

If you want, you can look around at http://www.kernel.org/pub/linux/kern...t-kernel/v2.4/ for it.
Attached Files
File Type: txt xf86config-4.txt (14.9 KB, 131 views)
__________________
Registered Linux User #219692
bwkaz is offline   Reply With Quote
Old 04-23-03, 12:39 PM   #10
casey
Registered User
 
Join Date: Apr 2003
Posts: 11
Send a message via ICQ to casey Send a message via AIM to casey
Default

after a conversation w/ my partner in crime for our linux builds, it would seem we are using the preempt patch. The investigation continues......
casey 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
GT650M not recognized by 295.59 Driver on Ubuntu 12.04 hvontres NVIDIA Linux 13 06-22-12 01:33 PM
Redhat 8.0 NVIDIA works - INSTRUCTIONS STEEL1 NVIDIA Linux 267 04-15-03 06:48 PM
Getting the proprietary nvidia driver to run with Debian 3.0 r0 (woody) Katchina404 NVIDIA Linux 9 01-12-03 08:49 AM
Nvidia Driver causes crash on Standby/Suspend dasher NVIDIA Linux 5 09-16-02 05:57 PM
Gnome2 lockups due to bug in X driver hobbes NVIDIA Linux 11 07-29-02 04:38 PM

All times are GMT -5. The time now is 05:32 PM.


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