Overview of System-Wide Power Profile
The AMD uProf profiler offers live power profiling to monitor the behavior of the systems based on AMD CPUs and APUs. It provides various counters to monitor power and thermal characteristics.
These counters are collected from various resources such as RAPL and MSRs. They are collected at regular time intervals and either reported as a text file or plotted as line graphs. They can also be saved into the database for future analysis.
GUI to configure and monitor the supported power metrics.
TIMECHART page to monitor and analyze:
Logical Core level metrics – Core Effective Frequency and P-State
Physical Core level metrics – RAPL based Core Power
Package level metrics – RAPL based Package Power and Temperature
AMDuProfCLI timechart command to collect system metrics and write into a text file or comma-separated-value (CSV) file.
API library to configure and collect the supported system level performance, thermal, and power metrics of AMD CPU/APUs.
Store the collected live profile data in the database for future analysis.
The supported metrics depend on the processor family and model and are broadly grouped under various categories. The supported counter categories by processor families are listed here.
Applies to the following processor families.
Family 17h Model 00h – 0Fh (AMD Ryzen™, AMD Ryzen ThreadRipper™, and 1st Gen AMD EPYC™)
Family 17h Model 10h – 1Fh (AMD Ryzen™ and AMD Ryzen™ PRO APU)
Family 17h Model 70h – 7Fh (3rd Gen AMD Ryzen™)
Family 17h Model 30h – 3Fh (EPYC 7002)
Family 19h Model 0h – 2Fh (EPYC 7003 and EPYC 9000)
Family 1Ah Model 00h-0Fh
Family 1Ah Model 10h-1Fh
Family 1Ah Model 20h-2Fh
Family 1Ah Model 40h-4Fh
Family 1Ah Model 60h-63h
Family 1Ah Model 68h-6Fh
The supported counter categories are listed here.
Power Counter Category |
Description |
|---|---|
Frequency |
CPU Core Effective Frequency for the sampling period, reported in MHz. |
P-State |
CPU P-State at the time when sampling was performed. |
Power |
Average Power for the sampling period, reported in Watts. This is an estimated consumption value based on the platform activity levels. It is available for Core and Package. |
Temperature |
Average temperature for the sampling period, reported in Celsius. The temperature reported is with reference to Tctl. It is available for Package. |
This profile type is used to perform the power analysis where the metrics are plotted in a live timeline graph and/or saved in a database. Complete the following steps to configure and start the profile:
To configure a profile:
Click the PROFILE tab at the top navigation bar or one of the following on the Welcome page:
Profile entire System
See What’s guzzling power in your system
The Select Profile Target page is displayed.
Click Next.
The Select Profile Type page is displayed.
From the Select Profile Configuration screen, select the Live Power Profile tab.
All live profiling options and available counters are displayed in the respective panes.
Figure 12.1 Live System-wide Power Profile#
Under Counters, select the required counter category and the respective options.
Note
You can configure multiple counter categories.
You can render the graphs live during profiling.
Click Start Profile.
For this profile type, profile data will be generated as line graphs in the TIMECHART page for further analysis.
The CLI command is displayed for all the options selected from the GUI for Live Power Profiling.
After the required counters are selected and the profile data collection begins, the metrics will be plotted in the live timeline graphs under the TIMECHART tab.
Figure 12.2 Timechart#
The TIMECHART page displays the metrics plotted in live timeline graphs - grouped together and plotted based on the category.
The data table adjacent to each graph displays the current value of the counters.
Choose the graph you want to display from the Graph Visibility pane.
When plotting is in progress, you can:
Click Pause Graphs to pause the graphs without pausing the data collection. Click Play Graphs to resume.
Click Stop Profiling to stop the profiling without closing the view. This will stop the collection of profile data.
Click Close View to stop profiling and close the view.
Use the AMDuProfCLI timechart command to collect the system metrics and write them into a text file or comma-separated-value (CSV) file. Complete the following procedure to collect power profile counter values:
Run the command with --list option to get the list of supported counter categories.
Use the command to specify the required counters with -e or --event option to collect and report the required counters.
The timechart run to list the supported counter categories is given here:
Figure 12.3 –list Command Output#
Figure 12.4 Timechart Run#
The run will collect the power and frequency counters on all the devices on which these counters are supported and writes them in the output file specified with the -o option. Before the profiling begins, the given application will be launched and the data will be collected till the application terminates.
Collect all the power counter values for a duration of 10 seconds with a sampling interval of 100 milliseconds.
C:\> AMDuProfCLI.exe timechart --event power --interval 100 --duration 10
Collect all frequency counter values for 10 seconds, sampling them every 500 milliseconds and adding the results to a csv file.
C:\> AMDuProfCLI.exe timechart --event frequency -o C:\Temp\Poweroutput --interval 500 -- duration 10
Collect all the frequency counter values at core 0 to 3 for 10 seconds, sampling them every 500 milliseconds and adding the results to a text file.
C:\> AMDuProfCLI.exe timechart --event core=0-3,frequency -o C:\Temp\Poweroutput
--interval 500 --duration 10 --format txt
Collect socket temperature when workload is running, set the sampling interval to 500 milliseconds.
C:\> AMDuProfCLI timechart --event socket,temperature --interval 500 <command to execute workload>
Collect all the power counter values for a duration of 10 seconds with a sampling interval of 100 milliseconds.
$ ./AMDuProfCLI timechart --event power --interval 100 --duration 10
Collect all the frequency counter values for 10 seconds, sampling them every 500 milliseconds and adding the results to a csv file.
$ ./AMDuProfCLI timechart --event frequency -o /tmp/PowerOutput --interval 500 --duration 10
Collect all the frequency counter values at core 0 to 3 for 10 seconds, sampling them every 500 milliseconds and adding the results to a text file.
$ ./AMDuProfCLI timechart --event core=0-3,frequency -o /tmp/PowerOutput --interval 500 --duration 10 --format txt
Use the API library to configure and collect the supported power profiling counters on various AMD platforms directly without using AMD uProf GUI or CLI. The AMDPowerProfileAPI library is used to analyze the power efficiency of systems based on AMD CPUs and APUs.
These APIs provide interface to read the power, thermal, and frequency characteristics of AMD CPUs and APUs and their subcomponents. These APIs are targeted for software developers who want to write their own application to sample the power counters based on their specific use case(s).
For detailed information on these APIs, see the AMDPowerProfilerAPI.pdf under the <AMDuProf-install-dir>/help/ folder.
Refer the sample program CollectAllCounters.cpp to learn how to use these APIs. The program must be linked with the AMDPowerProfileAPI library while compiling. The power profiling driver must be installed and running.
A sample program CollectAllCounters.cpp that uses these APIs is available in the directory:<AMDuProf-install-dir>/Examples/CollectAllCounters/. To build and execute the sample application, complete the following OS-specific steps:
A Visual Studio 2022 solution file CollectAllCounters.sln is available in the directory: C:/Program Files/AMD/AMDuProf/Examples/CollectAllCounters/ to build the sample program.
Command to build:
$ cd <AMDuProf-install-dir>/Examples/CollectAllCounters
$ g++ -O -std=c++11 CollectAllCounters.cpp -I<AMDuProf-install-dir>/include -l AMDPowerProfileAPI -L<AMDuProf-install-dir>/lib -Wl,-rpath <AMDuProf-install-dir>/bin -o CollectAllCounters
Command to execute:
$ export LD_LIBRARY_PATH=<AMDuProf-install-dir>/lib
$ ./CollectAllCounters
The limitations are listed here:
Only one power profile session can run at a time.
Minimum supported sampling period in CLI is 100 ms. It is recommended to use a large sampling period to reduce the sampling and rendering overhead.
When Microsoft Hypervisor is enabled on host, temperature counter is not supported.