To get the best and most accurate data about how much energy your computer platform is using during operation you need a hardware power meter. There are many models available (e.g., NetDAQ Networked Data Acquisition Units from Fluke, or the Yokogawa WT210), but not everyone can afford one and not everyone has need of one for more than a few days out of the year. If you’re developing software applications and you want to optimize your apps for energy efficiency, what options do you have? The answer is to use a software power meter.
This article will describe three such meters for Microsoft Windows (Intel® Power Gadget, Intel® Power Checker, and Joulemeter from Microsoft* Research). Each software meter has different data that is collected. This survey is intended to help developers that do not have access to an external power meter device understand what each tool does and how each might be used within the software optimization cycle.
At the end of each section we have provided links to download each meter application and other documentation that was available. Be sure to consult the documentation of an application you are interested in for more complete details
Intel® Power Gadget 2.0
Intel® Power Gadget 2.0 is a software-based power estimation tool enabled for 2nd Generation Intel® Core™ processors. It includes a Microsoft Windows* sidebar gadget, driver, and libraries to monitor and estimate real-time processor package power information in watts using the energy counters in the processor. The motivation for the gadget is to assist end-users, ISV's, OEM's, developers, etc., in more precise estimation of power from a software level without any H/W instrumentation. Additional functionalities include estimation of power on multi-socket systems as well as externally callable APIs to extract power information within sections of code.
The most common usage of the Intel Power Gadget is through the Windows® 7 Sidebar gadget component. After installation, you simply bring up the gadget to monitor processor power usage when running a workload or with the system idle. The Sampling Resolution (msec) and Max Power (Watt) to be displayed in the gadget can be set within the “Options” pop-up window. You can save the data generated by the gadget by selecting a file location and name for the comma-separated values (CSV) data, from the “Options” window and clicking the “Start Log” button. When you are done recording data, click the “Stop Log” button. The CSV data file will be in the location you have specified.
What data is presented
The Intel Power Gadget GUI provides a graphic record of processor power (Watts) and frequency (MHz) in real-time. The last 110 seconds of data are shown in the display.
Within the CSV log file you will find columns for System Time (at each measurement point), RDTSC (ReaD Time Stamp Counter, the number of clock cycles since the CPU was powered up or reset), CPU Frequency (MHz), and Package Power (Watts). The latter two columns will be duplicated for each socket in the system. That is, in a single socket system, there will be one column for CPU frequency and one for the package power. The column labels will indicate the socket from which the data was measured. The final line in the file will be the value of the Total Processor Energy (mWh).
In order to use Intel Power Gadget, your test platform must be equipped with one (single socket) or more multi-socket) 2nd Generation Intel® Core™ Processors. Previous processors are not supported. The supported operating systems include Microsoft Windows 7*, 32-bit and 64-bit versions, Microsoft Windows* Server 2008, and Microsoft Windows* Server 2008 RC2 (64-bit server platforms). In addition, you will need to have installed the Microsoft* .Net Framework 4 and Microsoft Visual C++ 2010 SP1 Redistributable package (x86 or x64 depending on OS). The presence of these final two installations will be checked at installation time and downloaded as needed.
You can find download links within the article “Intel® Power Gadget 2.0” (http://software.intel.com/en-us/articles/intel-power-gadget).
Other supporting links
A blog on “Accessing Intel® Power Gadget 2.0 library in C++” describes how to use the Intel Power Gadget API and libraries from C++ code.
Intel® Power Checker
Intel® Power Checker provides developers with a quick and easy way to evaluate the idle power efficiency of their applications on mobile platforms with Intel® Core™ processor or Intel® Atom™ technology. Any compiled language application, especially those designed to run on technology based on Intel® products, and Java Framework applications can be analyzed by Intel Power Checker. The checker can be used with or without a supported external power meter.
The 2.0 version of the Intel Power Checker now supports measurement both on battery and with the system plugged into an external AC power source. External power measurement is only supported on Intel® Second Generation Core processors and if the Intel Power Gadget software has been installed.
The Intel Power Checker provides a GUI wizard that leads you through the four steps of power analysis. These four steps in the checker are described below. But before starting the assessment, be sure to know which section of your application (a workload) you want to be measured, as the Power Checker will only measure a 30 second execution. Your workload could be a compute intensive portion or a data-intense section or just some point in execution that typifies the majority of expected usage.
Step 1: Specifying the Power Meter device
If you have an external power meter attached to your test system, you can select the model being used on the first screen of the wizard. The default is that no external device is being used. For this default case, Intel Power Checker will determine if the system is capable of providing power consumption data and if the correct power driver, EzPwr.sys, is installed. (The driver is part of the default installation of Intel Power Gadget.)
Step 2: Measure System Baseline
The first measurement that the Intel® Power Checker will perform is on the next screen within the wizard. This is to measure the baseline power consumption of the hardware without your application running. During this measurement phase you should shut down any unnecessary processes such as operating system updates, Windows Indexing Service, virus scans, media players, and internet browsers.
Once you have a quiescent system, click the “Start” button to begin this phase of the testing. The Intel Power Checker gives you 15 seconds to position your mouse and the keyboard out of any stray contact and to allow the system to come to an idle state before starting the measurements. After the pause, the checker will observe the system for 30 seconds in this idle state. A progress bar will show the time remaining in each part of this phase. Once the baseline data collection is complete, click the “Next” button to proceed to the next phase.
Step 3: Measure Active Application
The wizard will instruct you to start the application you are interested in measuring. Once you have done so, you should click the “Refresh List” button so that your application’s process will be available to select. Use the scroll bar to locate your application in the process list and click on that line to select it. After selecting your application from the list, click “Next” to move on to the data collection for this phase.
Before starting the assessment, be sure you have gotten your application to the desired point of measurement. If your application has some initial setup computations that are not of interest, you will need to get past this point before letting Intel Power Checker begin measurement. After your application workload has started, click the “Start” button to begin capturing measurement data. Always begin capturing data after the workload or critical section has begun and make sure this active execution will run longer than the 30 seconds needed to complete the measurement time.
Step 4: Measure Idle Application
The final phase is to measure your application’s idle power consumption. After your application has reached an idle state, the checker will give the system 15 seconds to calm down fully before taking a final 30 second measurement.
Upon completion of this last data collection phase, you will be able to proceed to the results screen within the Intel Power Checker wizard. After all three phases have been completed, a Tool Report File will be generated containing all of the results for later analysis.
What data is presented
The View Results screen of the Intel Power Checker wizard provides basic information about the software assessment. The type of processor in your system and the type and model of the power source that was used are given. Four numerical values for each of the three measurement phases are presented. These values are:
- Elapsed Time: The exact number of seconds that each of the phases lasted.
- Energy Consumption: The rate that the battery was discharged during each of the three phases.
- Average C3 State Residency: The percentage of time that the system was in the C3 state during the data collection period.
- Platform Timer Period: The number of milliseconds that the platform timer collected
You can use Intel Power Checker on a laptop or netbook based on Intel® Core™ processor or Intel® Atom™ processor technology. A desktop with an external power meter or a desktop that is capable of providing the power consumption information can also be analyzed. A Java* Runtime Environment (JRE) (version 6 update 11 or higher) is required to run the checker. Supported operating systems are Microsoft Windows*XP (Service Pack 3), Microsoft Windows Vista* (Service Pack 2), Microsoft Windows 7 (Service Pack 1[32-bit and 64-bit]), and Microsoft Windows Server 2008 R2.
To download the Intel Power Checker installation package, go to the following link:
/partner/app/software-assessment. Click on the Intel Power Checker tab to move down to the download link.
Other supporting links
There is a video demonstration of using Intel Power Checker, “A Look at Intel Power Checker,” at the link: /en-us/videos/channel/intel-software-partner-program/a-look-at-the-intel-power-checker/1127786023001. Dave Valdovinos and Taylor Kidd, both from Intel, show off the GUI wizard as it measures the power performance of a game-like application.
The Joulemeter is a project from Microsoft Research. It provides a modeling tool to measure the energy usage of virtual machines (VMs), servers, desktops, laptops, and even individual software applications running on a computer. It measures the impact of various components such as the CPU, screen, memory, and storage on total power use. One other advantages of Joulemeter is that it can measure impact of software components ,such as VMs, that do not have a hardware interface that can be measured by hardware power meters.
Before you can take measurements of software impact on power usage, Joulemeter must first calibrate itself to the test system hardware (CPU, disk, memory, screen, etc.). After the battery of the device is sufficiently charged and the system is idle and running on battery power, the calibration step is run. This should take 15-20 minutes and the brightness of the screen will change during the course of the calibration phase. This phase will yield a base level of energy consumption for the test system hardware.
After the calibration has completed, applications can be measured in the “Power Usage” tab. The CPU power consumed by the application, provided by name, will be monitored after the Start button is pressed. After measurements have been completed or the application terminates, clicking the Stop button will end measurement operations. Measurement information can be recorded by providing a file name and location for CSV data via the Browse button. Clicking on the “Start Saving” and “Stop Saving” button will, respectively, begin and end data recording to the given file.
What data is presented
On the “Power Usage” tab, the current component energy usage for CPU (above the baseline idle usage), Monitor, Disk, Base (idle system), and a Total of these values will be updated every second. These values are given in Watts.
Within the CSV log file you will find columns for each of the measures shown on the Joulemeter GUI. Additional columns for a Time Stamp (msec) and the Application usage in Watts are also included. The latter column’s values are part of the CPU values, but were specifically generated by the execution of the application that was monitored.
I have not seen specific requirements for Joulemeter, but it has been run on platforms with both Microsoft Windows 7 and Windows Server 2008 R2 operating systems. Processor models that have successfully run Joulemeter include the Intel® Core® i5-2540M processor, Intel® Xeon® L5520 processor, and Intel® Core® 2 Duo T7500 processor.
The Joulemeter software can be downloaded from the Microsoft Research homepage for Joulemeter, Joulemeter: Computational Energy Measurement and Optimization: http://research.microsoft.com/en-us/projects/joulemeter/default.aspx.
Other supporting links
The fundamental concepts behind how the technology works are available in the paper, Virtual Machine Power Metering and Provisioning. Several use cases are detailed in research publications listed on the Microsoft Research Joulemeter home page.
Even if you don’t own or can’t afford to purchase a power meter to measure the energy used by running software you are developing, there are software options available for those interested in energy efficient performance. In this article we have described three of them above that are available for applications running on Microsoft Windows operating system. Each has different features, different system requirements, and track energy consumption of different hardware and software components. To get the most out of any tool you choose, be sure to consult and read the documentation so that you will be able to get the most information from your measurement executions.