Sign in to follow this  
n00body

Effective GPU memory size

Recommended Posts

Okay, this has had me a bit concerned for some time, so I thought I'd ask. How much video memory do I really have available for my data (Textures/RTs, Geometry, Shaders)? Say I have 256MB on my graphics card. Do I have full reign of that, or does the driver use part of that for it's own purposes? If so, does that include the front & back buffers, or do they go into the amount available to me? Any help would be appreciated. EDIT: I forgot to mention, this is also assuming XP drivers. [Edited by - n00body on September 9, 2009 10:36:30 AM]

Share this post


Link to post
Share on other sites
Quote:

Any help would be appreciated.


I wouldn't count too much on avaiable video memory. The driver, which has access to video memory and system memory, will dynamically swap texture/data between video and system memory. It is just a matter of performace. You could have 700 mb of textures uploaed and only a graphics card with 256mb available and almost any performance hit at all, if you only access a limited selection of textures concurrently. On the other hand, if you try to access all textures in a single frame swapping will most likely decrease performance.

Best to use some scaling mechanism for memory consumption. I.e. provide different textures in different resolutions or downsample textures dynamically while loading.


--
Ashaman

Share this post


Link to post
Share on other sites
You can calculate your expected working set heuristically as the sum of your texture size, FBOs and vertex buffers. Take into account that multisampled buffers take more memory and add an amount for driver overhead and housekeeping (e.g. 32MB).

Don't worry about the exact numbers, the drivers are reasonably efficient in swapping data as necessary. You only need a rough idea of the amount of data you can access without a significant performance penalty in a single frame. For example, if your scene uses 400MB of textures per frame, 256MB cards will probably perform much worse than 512MB cards.

You can use this as a rough guideline to create different profiles for different cards (low/medium/high quality), but allow your user to override this decision if necessary. Again, exact numbers are not necessary, unless you are building a "hard" simulation (think military-class flight simulators). Chances are, different game levels will have different requirements (think snow levels in Crysis), so you'll need to profile and solve those specific issues as they come up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this