Measuring GPU Power with the K20 Built-in Sensor

Martin Burtscher, Ivan Zecena, Ziliang Zong
2014 Proceedings of Workshop on General Purpose Processing Using GPUs - GPGPU-7  
GPU-accelerated programs are becoming increasingly common in HPC, personal computers, and even handheld devices, making it important to optimize their energy efficiency. However, accurately profiling the power consumption of GPU code is not straightforward. In fact, we have identified multiple anomalies when using the on-board power sensor of K20 GPUs. For example, we have found that doubling a kernel's runtime more than doubles its energy usage, that kernels consume energy after they have
more » ... ed executing, and that running two kernels in close temporal proximity inflates the energy consumption of the later kernel. Moreover, we have observed that the power sampling frequency varies greatly and that the GPU sensor only performs power readings once in a while. We present a methodology to accurately compute the instant power and the energy consumption despite these issues. Power measurement, energy measurement, GPU power sensor.  We discuss and explain a number of unexpected behaviors when measuring a GPU's power consumption.  We make important observations that should be taken into account when working with K20 power samples.  We present a methodology to accurately compute the true power and energy consumption using sensor data.  We validate our methodology in multiple ways and test it on Kepler-based K20c, K20m, and K20x GPUs.  We make our GPU energy-measurement tool, which implements this methodology, publicly available in open source at The remainder of the paper is organized as follows. Section 2 discusses related work. Section 3 describes our test bed. Section 4 analyzes potential problems with GPU power-sensor measurements. Section 5 presents our approach to 'correct' these measurements. Section 6 discusses validation results. Section 7 summarizes and draws conclusions. RELATED WORK The energy consumption of computer components can be obtained either directly or indirectly. Indirect measurements estimate the power consumption using a model that correlates power with hard-Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from Permissions@acm.org.
doi:10.1145/2588768.2576783 fatcat:q3hzbjdpzbhjrb4t73k5tnlasm