GPU memory check utility functions?

Hi

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

TIA.

http://nasutechtips.blogspot.com/2011/02/how-to-get-gpu-memory-size-and-usage-in.html

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

:slight_smile:
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:

http://www.opengl.org/wiki/Common_Mistakes#glAreTexturesResident_and_Video_Memory

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

Hi

Does someone know if these 2 functions are connected?

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

GLint nCurAvailMemoryInKB = 0;
glGetIntegerv( GL_TEXTURE_FREE_MEMORY_ATI,
&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 http://www.opengl.org/registry/

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.