Jump to content
  • Advertisement
Sign in to follow this  
cozzie

OpenGL retrieve use GPU/ video memory in use

This topic is 2029 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

 

 

Share this post


Link to post
Share on other sites
Advertisement

Search for GetAvailableVidMem /  DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!