How to query OpenGL Graphics Memory Utilization at Runtime

How to query OpenGL Graphics Memory Utilization at Runtime

Hi All,

I am developing OpenGL Applications on my new Intel(R) HD 4400 (Haswell Architechture) boards. My OpenGL Apps with shaders are working fine. But I need to query the board to get the available Graphics Memory. At runtime I need to know how much memory is utilized so that I can control additional Texture loading in my App.
The GPUdetect sample at Intel Site just gives the maximum available, that too using DirectX. I searched in 4th-gen-core-graphics-dev-guide.pdf but could not find the proper methods.

Can you please tell the APIs I can use to query the graphics memory utilization at runtime?

NVidia/ATI provide APIs that we can use too see the memory utilization when an OpenGL App is running.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

Hi Piyush,

As you may or may not know memory that is used by the GPU is shared with intergrated graphics. It comes from the same DRAM the CPU uses .Thus we have physical memory that is partitioned by the OS, and mapped to virtual addresses as needed. The total allocation is the "committed memory", the one that's currently in dram is called the active working set. If/when the OS runs out of physical backing or as a proactive action it will page out not-so-used app memory to disk, freeing up physical memory. The committed memory doesn't change, but the working set does.

The best you can hope for is to figure out how big is your working set and total allocation is, and how much physical memory there is in the system.All this is OS controlled and therfore the APIs to figure it out at the OS level: GetProcessMemoryInfo.

When you go into the details it quickly becomes overwhelming, because there are a bunch of different types of memory. One that may make sense to look at in our context for "committed" memory is the _PROCESS_MEMORY_COUNTERS_EX.PrivateUsage one.

I hope this helps.


Leave a Comment

Please sign in to add a comment. Not a member? Join today