GPU memory check utility functions?


I wonder if OpenGL supports any functions to test GPU memory status which we could use before allocating memory space for buffers?
If I see weird results while drawing using VBOs - how can I know if it’s caused by not enough GPU memory?

P.S. I’m using ATI HD Mobility Radeon card


Thanks! That was fast :)… I will try to use this.

You can also use glGetError to check for out of memory errors. In my current project I was allocating a lot of space for some massive offscreen render targets. And it was becoming unpredictable. Nvidia would give me an out of memory message, ATI would just die with style :stuck_out_tongue:

I just gave up with it. Various graphics cards become unpredictable when u ask for too much memory. My nvidia 9800gt would often give out of memory messages, then it was like russian roulette if it worked or not. In the end I rewrote my renderer as a tile based engine ;p


Does someone know if these 2 functions are connected?

wglGetGPUInfoAMD( uGPUIDs[0],
sizeof( GLuint ),
&uTotalMemoryInMB );

GLint nCurAvailMemoryInKB = 0;
&nCurAvailMemoryInKB );

Do I need to call wglGetGPUInfoAMD first in order to get free memory info ,or simply glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI,&nCurAvailMemoryInKB ) is enough?

I tried to call only the last one ,but returned value does’nt seem logical to me .
I can’t call the first function since I don’t know yet how to update my header files the way that wglGetGPUInfoAMD is recognized…I 'm in big delay so I don’t have a time for it.

Thanks in advance

It says wglGetGPUInfoAMD returns value in MB.
glGetIntegerv returns in KB.

Header files are at

Thanks, my mistake, it returns more less correct values , these functions are not connected, glGetIntegerv(…) is enough.
This ATI HD Mobility Radeon card is driving me nuts.