retrieve use GPU/ video memory in use

Started by
2 comments, last by cozzie 10 years, 11 months ago

Hi,

Do you know if there's a API call in D3D9/DX9 which gives back the physical video memory that's in use? (I know there's one in OpenGL)

I know I could make a 'guestimation' by keeping track of it myself when creating surfaces, textures, vertexbuffers etc., but I'm just curious if there's an easy way just to check. Retrieving available texturememory (GetAvailableTexMem) gives me an answer, but that's probably including AGP/ shared/ system memory. For example it returns "4226809856", around 4GB, where my graphics card has 2GB.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Advertisement

Search for GetAvailableVidMem / DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM.

I hope you're not indending to use this figure to make a quality-related tradeoff, for several reasons.

On systems with virtualized video RAM you may or may not get a figure based on the amount of virtualized RAM, rather than real physical RAM.

On systems with shared video RAM you may or may not get a figure based on the amount of shared RAM, rather than real physical RAM.

If you're using managed pool resources, on any given frame any given resource may or may not be resident in video RAM - the figure can therefore vary from frame to frame.

In other words, and even if the first two reasons don't apply, the last reason is sufficient to render any figure you might get quite meaningless. It's better to have a good idea of the kind of load your game needs and set a minimum specification based on that. Use different quality levels if appropriate.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks, that sounds like there's no 80/20 approach to check minimum video memory requirements, for my own app.
Say I wanted to take it a step further and get a better estimate, I could keep track off:

- textures, find a way to calculate decompressed size, including mipmaps
- surfaces, backbuffer, rendertarget, depthbuffer, stencil etc.
- vertexbuffers
- shaders/ created effects
- .....

Add them all up, giving me a minimum video memory requirement for that situation?

My gut feeling says that this will also be a rough guesstimate. On the other hand what does a minimum required amount of videomemory say, if a big group of users also use shared or virtualized video ram.

Never the less, it's anyway ysefull to keep track on objects in (videomemory), and create a basic memorymanager in my engine.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement