528 VI Debugging and Proﬁling
interpret measured results correctly. Furthermore, for less demanding applications,
it is possible to get shorter execution time on some older and less powerful graphics
cards because their lower per formance states may involve much higher frequencies.
37.2 Power Consumption Policies
For many years, graphics card vendors have been developing a highly advanced form
of dynamic power management (DPM). DPM estimates the relative workload and
aggressively conserves power when the workload is low. Power consumption is con-
trolled by changing voltage levels, GPU frequencies, and memory-clock frequencies.
A set of values that deﬁne the current power consumption and performance capabil-
ities of the graphics card is known as a performance state (P-state).
NVIDIA deﬁnes sixteen P-states, where P0 is the highest P-state, and P 15 is the
idle state. Not all P-states are present on a given system. The state P0 is activated
whenever a 3D application is detected. If the utilization is below some threshold for
a certain period of time, the P-state is changed to a lower level.
AMD deﬁnes three P-states, where P0 is the lowest, and P2 is the highest per-
formance state. P0 is the starting state, and it is changed only b y demanding ap-
plications. The latest AMD technology, known as PowerTune [AMD 10], deﬁnes a
whole range of working frequencies in the highest P-state. When the GPU reaches
the thermal design power (TDP) limits, the GPU frequency is gradually decreased
while maintaining the high power state. This enables much better performance for
demanding applications, while preserving acceptable power level.
Having in mind such advanced po wer-management scenarios, a fair comparison
of different rendering algorithms cannot b e done on a frame-rate basis only. If the
same or an even lower frame-rate is achieved in the lower P-state, it certainly qualiﬁes
the algorithm as more efﬁcient, or at least less demanding. That is why P-state
tracking is an important part of proﬁling software. So far, OpenGL doesn’t have a
capability to track P-states; thus, we will take a look at how it can be implemented
using vendor-speciﬁc APIs: NVAPI for NVIDIA and ADL for AMD hardware.
37.3 P-State Tracking Using NVAPI
NVAPI is NVIDIA’s core API that allows direct access to NVIDIA drivers on all
Microsoft Windows platforms [NVIDIA 11c], and it is shipped as a DLL with
NVAPI has to be statically linked to an application; hence, a soft-
ware development kit (SDK) has been released with appropriate static library and
The ofﬁcial documentation states that NVAPI is supported by drivers since Release 81.20 (R81.20),
but there are problems in accessing most of its functionality through the SDK in pre-R195 drivers. The
ﬁrst NVAPI SDK was released with R195 in October 2009. Since R256 drivers, all settings have become
wide open to change with NVAPI.