nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows (http://www.nvnews.net/vbulletin/showthread.php?t=132273)

mdingey 05-01-09 01:20 AM

GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
2 Attachment(s)

I'm encoutering what I think is a bug in the x86_64 Linux driver. When trying to open more than 455 drawables, glXMakeCurrent fails with a GLXBadDrawable error ( Major opcode 144, minor opcode 5).

The attached program, 'example.c', shows this behaviour. Once compiled, run the program with an integer argument of the number of windows you wish it to open (depending on your machine it may appear to freeze your WM for a moment, but it should recover). Running the program with 455 windows works fine, running with 456 fails with the aforementioned error. I have tried this on multiple machines, with the 180.44 and 180.51 drivers.

I'm aware that opening this many windows is not a typical use case, but the software we run needs to open around 1000 or so; possibly more. :)

I should note that using the vesa driver, the error does not occur.

Attached is the example program and the output of the nvidia bug reporting script.

Thank you in advance.

Thunderbird 05-01-09 06:08 AM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
Why do you need so many windows? You are likely just running out of video memory or so. Do you really need Windows, can't you use FBOs or so?

nevion 05-01-09 08:05 PM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
Maybe I'm confusing something but "windows"=drawables in x are different from "clients" (what we loosely count as application~=windows discounting a few exceptions).
But who would use that many windows in an application? Well, my firefox is doing pretty bad, 1461 right now. I must have ~2000 windows system wide. I'd like to have more too though I'm cheating on the windows/drawables since its mostly all gtks fault (gtk is a window addict allocating a ton of not very large one's of them to do its dirty work), the total area of these drawables is only a few times above my screen in area... it should fit in graphics card memory in this day and age. I run a 2560x1600 desktop and thus I only have about 15 megabytes per screen on 32bpp. The point is it's perfectly manageable on modern cards. Still though, gtk should get window abuse under control...

But anyway, I recall having this problem before but it isn't in my .xsession-errors atm, I believe I still get it when opening up firefox for instance :-). And the application may not really call for letting FBOs get into the mix...

mooninite 05-01-09 08:47 PM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
You're running something rather nasty in Firefox because I'm only seeing ~200-300 wins usage. Opening a tab adds 12 wins. Loading a page may or may not add any. I even tried Flash and that didn't add any significant amount. Since I saw you on imdb.com I went to the same page and I only have 268 wins at the moment typing this reply to you.

It's hardly GTK's fault.

nevion 05-02-09 03:09 PM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
Windows vary by site, and I have 80 tabs opened. I have adblock plus, noscript and session manager installed. So of all the sites opened, there are less actual windows than without the extensions since I'm blocking the ads. Opening all the same urls in konqueror who has no such extensions enabled, I only have 444 windows vs 1465. That's less than a 3rd of the windows. 300% more windows than qt/kde has proved to be at least a lower bound on windows needed to do the job means gtk is being fairly wasteful, and this is with konqueror showing all the ads and flash firefox has blocked!

I might try this again later with the extensions disabled to see how much more windows I get.

AaronP 05-02-09 03:32 PM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
Creating a lot of regular X windows isn't usually a problem. If they're not redirected, they don't take up any extra video memory either. However, when you call glXMakeCurrent, the OpenGL driver has to allocate a bunch of extra resources associated with that window such as a back buffer, a depth buffer, multisample buffers, etc. (depending on the chosen visual). You're probably just exhausting your video memory.

nevion 05-02-09 07:29 PM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
Hey AaronP , yes I have compositing enabled and I'm on a 8800gts 320 mb card. The info x resource is reporting is ~260 mB. How much memory on the actual card given the kde composited environment is it really using you think? Or is it just something like the sum over all windows w/ 5*window_dimensions*4 bytespp. I know you guys do some things like caching on the card too... how much memory of the card can that take up?
I'd appreciate your insights.

mdingey 05-03-09 09:09 PM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows

Thanks for your reply. It explains why the failure is on glXMakeCurrent. However, I don't believe it's to do with physical video memory. I've tried this out on a number of nvidia cards and the limit is always at the same number.

My colleagues tell me they have experienced a problem like this in the past (at a lower limit of windows) and that a driver upgrade resolved the issue. I did some digging and found that when running the 100.14.19 driver, the limit was 227 windows (almost exactly half of what the current limit is). At the time, my colleagues upgraded to 169.07 (the next driver) and it resolved their problem.

This leads me to believe that the limit is in the driver itself. Is it possible that when upgrading from 100.14.19 to 169.07, a limit in the driver was simply doubled? If so, could it be increased again? :)

mdingey 10-13-09 07:19 PM

Re: GLXBadDrawable on 180.44 and 180.51 x86_64 after 455 windows
Minor update:

Whilst trying the newest drivers to see if the bug had gone away, we found that enabling Xinerama with more than 1 screen halved the number of drawables we could use.

Not sure if this information is useful or not, but I figured it couldn't hurt :)

All times are GMT -5. The time now is 07:42 PM.

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