Jump to content
  • Advertisement
Sign in to follow this  
halcyon81

Possible To Determine Video Card Memory Usage?

This topic is 4052 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 I am curious if there are any utilities out there (or sample code) that can report back to you how much of your video card's memory is in use at any time? Ideally something similar to windows task manager graph, but I'll take a simple raw number right now too :P Thanks!

Share this post


Link to post
Share on other sites
Advertisement
The DirectDraw API has a function called GetAvailableVidMem(). I don't think you can do it in Direct3D. You can however get the available texture memory from the texture caps.

Share this post


Link to post
Share on other sites
Yes, D3D9 supports memory query but you have got to be careful.

For example, if you have an AGP card with 128MB RAM (some kind of ATI Radeon 9800PRO for example, or 6600GT does not matter), it might show, that you have 192MB ram or more. The same is with 256MB cards, your query might result 384 megs.

Why? Because you can set in BIOS settings that CPU shall extend the video memory configuration for several megs.

You shouldn't be disappointed if you see 192MB instead of "real" 128 because the operating system will give the additional 64 megs free for your game. For example: in case you should load 140 megs of textures but you have just 128 it will still work without a single line of code, because the bios settings will tell Windows that memory can be extended (and it will be, automaticaly).

If you turn the bios setting off, you will se the exact amount of video memory. This kind of querys are very life like but not suitable for log files or configurations. For example: it is funny to tell the user that he has 192MB ram if he know that there is a 128MB card built in.

Share this post


Link to post
Share on other sites
Could you by chance point me to the API function call to retrieve the memory usage in D3D? Hunting through Microsoft's API doc website without knowing where to look is about as fun as cleaning out my grandparent's garage.

Thanks =)

Share this post


Link to post
Share on other sites
This is a fairly common question and the basic answer is "You Don't" [smile]

What do you want to do with this value? The memory managment system is a complex beast and trying to second guess it by micro-managment on your part is unlikely to yield good results for you. Leave the API, XPDM and driver to handle the finer details.

A valid use is to try and "bucket source" the installed GPU as a low, medium or high capacity card thus selecting more/less detailed textures. For this case, IDirect3DDevice9::GetAvailableTextureMem() is sufficient.

hth
Jack

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!