Is there a way i can find how much video memory my program is using and...

Started by
20 comments, last by Numsgil 15 years, 8 months ago
Is there a way i can find how much video memory my program is using and how much video memory is available?
Advertisement
nVidia PerfHUD should be able to tell you this, and a lot more besides.

GPU PerfStudio is a similar tool from ATI/AMD.
A quick and dirty way to find the amount of VRAM available when your program starts is to make 1 meg textures/render targets until it fails. If you can make 64 1meg textures, your card is 64MB.
[size=2]Darwinbots - [size=2]Artificial life simulation
Quote:Original post by beebs1
nVidia PerfHUD should be able to tell you this, and a lot more besides.

GPU PerfStudio is a similar tool from ATI/AMD.


I use an nvidia card and certainly looked at PerfHUD but that's only for D3D applications. I could not find a total amount of memory used by the program with gDebugger either(could have missed the feauture though, there is a lot of info there)
Quote:Original post by Numsgil
A quick and dirty way to find the amount of VRAM available when your program starts is to make 1 meg textures/render targets until it fails. If you can make 64 1meg textures, your card is 64MB.


I tested an application that was using(about 70mb) more than the maximum video memory of the video card(32mb) and it worked but very slowly, the textures were loaded okay, only it worked very slowly(guess it was running in software). So i'm not sure this may be of help...

[Edited by - Deliverance on August 12, 2008 4:15:23 PM]
Quote:Original post by Numsgil
A quick and dirty way to find the amount of VRAM available when your program starts is to make 1 meg textures/render targets until it fails. If you can make 64 1meg textures, your card is 64MB.


Ya that won't work. Your graphics driver will regularly move textures in and out of vram. So it is possible to allocate more texture memory that there is vram.

Your method would probably work if you used a feature that is guaranteed to be located in vram, such as pbuffers. However, that doesn't make this technique an less offensive (for obvious reasons).
There's something that will fail if you're out of VRAM. I though it was textures but I might be wrong. Try creating a hardware buffer. I know for sure those fail. The trick is to find something that can only be done in VRAM, and create a couple of them until it fails, and then calculate the amount of VRAM from that.

Incidentally this trick comes from Game Coding Complete 2nd Edition. If anyone can think of a better way to have a nice dialog pop up when the user tries to run your game that says "sorry chump, you need more VRAM", I'd like to hear it, too :)
[size=2]Darwinbots - [size=2]Artificial life simulation
I tried nviddia PerfSDK, because the HUD is only for D3D. The problem is it cannot display the amount of video memory used. I says 0 all the time. Here's a similar post with the same problem:http://developer.nvidia.com/forums/index.php?showtopic=233. So are we both doing something wrong? I tried collecting the info with Perfmon solution and it too does say 0 for video memory usage.
Which GPU do you have? PerfHUD has different capabilities for different hardware.
Quote:Original post by MJP
Which GPU do you have? PerfHUD has different capabilities for different hardware.


I own a Geforce 9600 GT.

This topic is closed to new replies.

Advertisement