Jump to content
  • Advertisement
Sign in to follow this  
akira32

How to get the rest of video memory

This topic is 3988 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

How to get the rest of video memory? Is it the function of GetAvailableTextureMem? UINT aa=pd3dDevice->GetAvailableTextureMem();

Share this post


Link to post
Share on other sites
Advertisement
As the documentation states, what that function returns is merely an estimate. You shouldn't use it to make "should I or should I not allocate this?" decisions. If you need to know precise numbers for debugging purposes, I believe the IHV's have special drivers and tools that can tell you (although I've never used these tools myself).

Share this post


Link to post
Share on other sites
As MJP said; you shouldn't need to know this usually. The reason is that "video memory" doesn't mean anything. Where does AGP memory come in? It's used by the graphics card, but it's in system memory. Likewise, some integrated chipsets don't have any real video memory and just use system memory - should they report that they have 0 bytes of video memory?

Is there something specific you're trying to achieve?

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Is there something specific you're trying to achieve?


I have three computers. Theirs graphic card are
NVIDIA GeForce 7900 GT/GTO with 256MB
NVIDIA GeForce 8600 GT with 256MB
NVIDIA GeForce Go 7300 GTS with 256MB

My adpative shadow maps program only runs with the error of "out of video memory" in the computer with "NVIDIA 7900 GT/GTO with 256MB".
I guess the computer may waste some video memory in somewhere.
So I want to calculate the rest of video memory.

Share this post


Link to post
Share on other sites
You've already got your solution really - catch that "out of memory" error and downgrade/disable the effects accordingly. Yes, it'd be nice to be able to detect this ahead of time but as has been hinted the memory model for Direct3D is non-trivial such that a single value is almost meaningless.

DXGI on Windows Vista exposes 3 measurements for RAM - dedicated, shared and something else that I've forgotten.

Nvidia drivers allocate something like 256mb of system RAM to shadow the working set on the GPU amongst other things. You might even have one of the cheap devices that claims 256mb VRAM but actually just reserves 256mb of system RAM instead.

hth
Jack

Share this post


Link to post
Share on other sites
You should also make sure you're allocating things in the right order - render targets and other default pool only resources first before any managed pool data. That will minimize the chances of running out of video RAM. See the FAQ for details.

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!