Mesa To Expose AMD Performance Monitor Extension
Written by Michael Larabel in AMD on 12 April 2013 at 04:39 PM EDT. 1 Comment
AMD --
While Mesa has some level of support for GL_ARB_debug_output, Intel developers are implementing support within Mesa for AMD's OpenGL performance monitor extension to assist game developers and others with monitoring the performance of their software.

The GL_AMD_performance_monitor extension allows for capturing and reporting of performance monitors. These counters can hold arbitrary counted data, usually about the performance of the graphics processor and other hardware. The specification on this AMD-spawned GL extension can be found at

Implementing this extension has been talked about before for Mesa, but a patch surfaced on Friday by Intel's Kenneth Graunke to provide the actual implementation. Intel implemented support for this AMD-developed extension (though it's already been implemented elsewhere) rather than Intel's own performance counter extension since the company hasn't submitted a specification for their extension to the Khronos registry.
This provides an interface for applications (and OpenGL-based tools) to access GPU performance counters. Since the exact performance counters available vary between vendors and hardware generations, the extension provides an API the application can use to get the names, types, and minimum/maximum values of all available counters. Counters are also organized into groups.

Applications create "performance monitor" objects, select the counters they want to track, and Begin/End monitoring, much like OpenGL's query API. Multiple monitors can be in flight simultaneously.

We chose not to implement the similar GL_INTEL_performance_queries extension because Intel has not bothered to publish a specification in the OpenGL registry.
The patch providing this Mesa support can be found for now on the mesa-dev list but will likely be merged into mainline Mesa in the near future. The patch is 850 lines of new code.
Related News
About The Author
Author picture

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter or contacted via

Popular News This Week