RAPL DRAM

225 views
Skip to first unread message

Brian Gravelle

unread,
Feb 15, 2022, 11:15:45 AM2/15/22
to ptools-perfapi

Hi folks,

I'm attempting to measure power on an Intel Cascadelake node using RAPL counters. The package counters (rapl::RAPL_ENERGY_PKG:cpu=0) work fine but the DRAM counters (rapl::RAPL_ENERGY_DRAM:cpu=0) do not. I get an error indicating syntax error or similar.

The output of the event chooser is below; I'm not sure what to make of that either. I'd appreciate any suggestions on how to diagnose or resolve this error.

Thanks,
Brian

papi_event_chooser NATIVE rapl::RAPL_ENERGY_DRAM:cpu=0
Event Chooser: Available events which can be added with given events.
--------------------------------------------------------------------------------
PAPI version             : 5.7.0.0
Operating system         : Linux 4.18.0-305.19.1.el8_4.x86_64
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : Intel(R) Xeon(R) Platinum 8260 CPU @ 2.40GHz (85, 0x55)
CPU revision             : 7.000000
CPUID                    : Family/Model/Stepping 6/85/7, 0x06/0x55/0x07
CPU Max MHz              : 3132
CPU Min MHz              : 3132
Total cores              : 96
SMT threads per core     : 2
Cores per socket         : 24
Sockets                  : 2
Cores per NUMA region    : 48
NUMA regions             : 2
Running in a VM          : no
Number Hardware Counters : 10
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

Event rapl::RAPL_ENERGY_DRAM:cpu=0 can't be counted with others -1



Giuseppe Congiu

unread,
Feb 15, 2022, 11:23:36 AM2/15/22
to Brian Gravelle, ptools-perfapi
Hi Brian,

papi_event_chooser should tell you what other events are compatible with rapl::RAPL_ENERGY_DRAM:cpu=0. In this case the utility seems to indicate that event can only be measured alone. What does PAPI_strerror() says about the error code? Did you try adding only that event to the eventset?

Thanks,
Giuseppe

--
You received this message because you are subscribed to the Google Groups "ptools-perfapi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ptools-perfap...@icl.utk.edu.
To view this discussion on the web visit https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/e1078c79-8f44-4462-af33-120c51b4f75bn%40icl.utk.edu.

Heike Jagode

unread,
Feb 15, 2022, 11:33:34 AM2/15/22
to Brian Gravelle, Giuseppe Congiu, ptools-perfapi
Can you also use a more recents PAPI version so that we can provide better support?
Your current version is from early 2019. Please clone the latest version from the git master:

git clone https://bitbucket.org/icl/papi.git

Heike



--
______________________________________
Heike Jagode, Ph.D., Research Asst. Professor
Innovative Computing Laboratory, University of Tennessee Knoxville
http://icl.utk.edu/~jagode/

Brian Gravelle

unread,
Feb 15, 2022, 12:16:07 PM2/15/22
to ptools-perfapi, Heike Jagode, ptools-perfapi, gco...@icl.utk.edu
Using a fresh git pull of papi I get these results from event chooser. Note the difference between the PKG and RAM results.

./bin/papi_event_chooser NATIVE rapl::RAPL_ENERGY_PKG:cpu=0

Event Chooser: Available events which can be added with given events.
--------------------------------------------------------------------------------
PAPI version             : 6.0.0.1

Operating system         : Linux 4.18.0-305.19.1.el8_4.x86_64
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : Intel(R) Xeon(R) Platinum 8260 CPU @ 2.40GHz (85, 0x55)
CPU revision             : 7.000000
CPUID                    : Family/Model/Stepping 6/85/7, 0x06/0x55/0x07
CPU Max MHz              : 1404
CPU Min MHz              : 1404

Total cores              : 96
SMT threads per core     : 2
Cores per socket         : 24
Sockets                  : 2
Cores per NUMA region    : 48
NUMA regions             : 2
Running in a VM          : no
Number Hardware Counters : 10
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

-------------------------------------------------------------------------
Total events reported: 0

./bin/papi_event_chooser NATIVE rapl::RAPL_ENERGY_DRAM:cpu=0

Event Chooser: Available events which can be added with given events.
--------------------------------------------------------------------------------
PAPI version             : 6.0.0.1

Operating system         : Linux 4.18.0-305.19.1.el8_4.x86_64
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : Intel(R) Xeon(R) Platinum 8260 CPU @ 2.40GHz (85, 0x55)
CPU revision             : 7.000000
CPUID                    : Family/Model/Stepping 6/85/7, 0x06/0x55/0x07
CPU Max MHz              : 1945
CPU Min MHz              : 1945

Total cores              : 96
SMT threads per core     : 2
Cores per socket         : 24
Sockets                  : 2
Cores per NUMA region    : 48
NUMA regions             : 2
Running in a VM          : no
Number Hardware Counters : 10
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

Event rapl::RAPL_ENERGY_DRAM:cpu=0 can't be counted with others -1

I will try to rerun and get the std error, but I'm not using papi directly (I'm using Caliper), so it will take some time to get setup to do so.

THanks,
Brian

Heike Jagode

unread,
Feb 15, 2022, 1:14:12 PM2/15/22
to Brian Gravelle, ptools-perfapi, gco...@icl.utk.edu
Thank you!

If you get a chance, please also send the papi_native_avail and papi_component_avail output from your machine. Thanks again!

Brian Gravelle

unread,
Feb 15, 2022, 1:52:31 PM2/15/22
to ptools-perfapi, Heike Jagode, ptools-perfapi, gco...@icl.utk.edu
Attached. Thanks!

B
papi_component_avail.txt
papi_native_avail.txt

Heike Jagode

unread,
Feb 15, 2022, 3:41:31 PM2/15/22
to Brian Gravelle, ptools-perfapi, gco...@icl.utk.edu
Thanks, Brian! That's a bit strange. I am not able to reproduce the issue on our Cascadelake Server (same Family/Model/Stepping 6/85/7 as yours). See details below. The rapl::RAPL_ENERGY_DRAM:cpu=0 event works as expected.


bin>./papi_command_line rapl::RAPL_ENERGY_DRAM:cpu=0

This utility lets you add events from the command line interface to see if they work.

Successfully added: rapl::RAPL_ENERGY_DRAM:cpu=0

rapl::RAPL_ENERGY_DRAM:cpu=0 : 1986723840




bin>./papi_event_chooser NATIVE rapl::RAPL_ENERGY_DRAM:cpu=0

Event Chooser: Available events which can be added with given events.
--------------------------------------------------------------------------------
PAPI version             : 6.0.0.1
Operating system         : Linux 3.10.0-1160.53.1.el7.x86_64

Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz (85, 0x55)

CPU revision             : 7.000000
CPUID                    : Family/Model/Stepping 6/85/7, 0x06/0x55/0x07
CPU Max MHz              : 4000
CPU Min MHz              : 1200
Total cores              : 72

SMT threads per core     : 2
Cores per socket         : 18
Sockets                  : 2
Cores per NUMA region    : 36

NUMA regions             : 2
Running in a VM          : no
Number Hardware Counters : 10
Max Multiplex Counters   : 384
Fast counter read (rdpmc): no
--------------------------------------------------------------------------------
Total events reported: 0


Heike

Vince Weaver

unread,
Feb 15, 2022, 4:43:14 PM2/15/22
to Brian Gravelle, ptools-perfapi, Heike Jagode, gco...@icl.utk.edu

have you actually tried mearusing the event combo you are looking for?

the papi_event_chooser program does not seem to be working 100% with
native events, and doesn't seem to work at all with uncore events like the
rapl ones. I don't know if the perf_event_chooser has seen much testing
reently.

You might be better off just using papi_command_line with the events you
are interested in.

If you're having trouble getting the RAPL events to work together in PAPI,
one thing to try is to see if they work together under the perf tool.

Vince
> >>>> <https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/e1078c79-8f44-4462-af33-120c51b4f75bn%40icl.utk.edu?utm_medium=email&utm_source=footer>
> >>>> .
> >>>>
> >>>>
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "ptools-perfapi" group.
> >>>> To unsubscribe from this group and stop receiving emails from it, send
> >>>> an email to ptools-perfap...@icl.utk.edu.
> >>>>
> >>> To view this discussion on the web visit
> >>>> https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/09EC6C19-04BA-4613-AC15-4B9B07CDF780%40icl.utk.edu
> >>>> <https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/09EC6C19-04BA-4613-AC15-4B9B07CDF780%40icl.utk.edu?utm_medium=email&utm_source=footer>
> >>>> .
> >>>>
> >>>
> >>>
> >>> --
> >>> ______________________________________
> >>> Heike Jagode, Ph.D., Research Asst. Professor
> >>> Innovative Computing Laboratory, University of Tennessee Knoxville
> >>> http://icl.utk.edu/~jagode/
> >>>
> >>
> >
> > --
> > ______________________________________
> > Heike Jagode, Ph.D., Research Asst. Professor
> > Innovative Computing Laboratory, University of Tennessee Knoxville
> > http://icl.utk.edu/~jagode/
> >
>
> --
> You received this message because you are subscribed to the Google Groups "ptools-perfapi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ptools-perfap...@icl.utk.edu.
> To view this discussion on the web visit https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/cf4c40f4-8718-41bc-80ac-6d3a9967a754n%40icl.utk.edu.
>

Vince Weaver
vincent...@maine.edu
Associate Professor, Electrical and Computer Engineering
http://web.eece.maine.edu/~vweaver/

Brian Gravelle

unread,
Feb 15, 2022, 5:20:22 PM2/15/22
to ptools-perfapi, vincent.weaver, ptools-perfapi, Heike Jagode, gco...@icl.utk.edu
This is the command line output for RAPL DRAM
./bin/papi_command_line rapl::RAPL_ENERGY_DRAM:cpu=0


This utility lets you add events from the command line interface to see if they work.

Failed adding: rapl::RAPL_ENERGY_DRAM:cpu=0
because: Invalid argument
No events specified!
Try running something like: ./bin/papi_command_line PAPI_TOT_CYC



Vince, I'm not trying to measure a combination, just the ENERGY_DRAM by itself which is why I find the event chooser output so confusing. I did try to measure the event with Caliper, but get the below error:
== CALIPER: (27): papi: Error: PAPI_add_events(): Invalid argument
== CALIPER: (27): default: papi: Failed to initialize event sets, dropping papi service
(this is from the older papi build not the new one)

Vince Weaver

unread,
Feb 16, 2022, 12:56:46 AM2/16/22
to Brian Gravelle, ptools-perfapi, vincent.weaver, Heike Jagode, gco...@icl.utk.edu
On Tue, 15 Feb 2022, Brian Gravelle wrote:

> This is the command line output for RAPL DRAM
> ./bin/papi_command_line rapl::RAPL_ENERGY_DRAM:cpu=0
>
> This utility lets you add events from the command line interface to see if
> they work.
>
> Failed adding: rapl::RAPL_ENERGY_DRAM:cpu=0
> because: Invalid argument
> No events specified!

could you try testing with perf, something like
perf stat -e power/energy-ram/ sleep 1

Vince

Brian Gravelle

unread,
Feb 21, 2022, 11:40:00 AM2/21/22
to ptools-perfapi, vincent.weaver, ptools-perfapi, Heike Jagode, gco...@icl.utk.edu
Here is the output for power/energy-ram and power/energy-pkg. I added _ to try to delineate the output
BTW, perf list power only lists power/energy-pkg

Thanks,
Brian


_________________________________________________________________

perf stat -e power/energy-ram/ sleep 1
event syntax error: 'power/energy-ram/'
                           \___ unknown term 'energy-ram' for pmu 'power'

valid terms: event,config,config1,config2,name,period,percore

Initial error:
event syntax error: 'power/energy-ram/'
                           \___ unknown term 'energy-ram' for pmu 'power'

valid terms: event,config,config1,config2,name,period,percore
Run 'perf list' for a list of valid events

 Usage: perf stat [<options>] [<command>]

    -e, --event <event>   event selector. use 'perf list' to list available events

_________________________________________________________________

perf stat -e power/energy-pkg/ sleep 1

 Performance counter stats for 'system wide':

            113.19 Joules power/energy-pkg/                                          

       1.007995573 seconds time elapsed


Vince Weaver

unread,
Mar 4, 2022, 4:05:05 PM3/4/22
to Brian Gravelle, ptools-perfapi, Heike Jagode, gco...@icl.utk.edu

sorry for the delay responding.

It looks like your machine does not support measuring DRAM power.

Probably your Linux kernel does not support it, you might want to check
your boot messages (in dmesg) and search for perf related messages to see
if it says. I'm not sure when cascade lake DRAM RAPL support got added to
the Linux kernel, it gets a bit complicated because vendors will often
backport things like that so just having a kernel version isn't
necessarily enough info.

Vince
Reply all
Reply to author
Forward
0 new messages