PAPI on aarch64

481 views
Skip to first unread message

abayomi adekanmbi

unread,
Jul 5, 2022, 10:56:08 AM7/5/22
to ptools-...@icl.utk.edu, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh
Hello,

I am a newbie using PAPI, and I have difficulties accessing the hardware performance counter on my machine. This is the error I see and please, I will appreciate any help that can help me triage this issue.

Also, is there support for PAPI using ARM processors?



Available components and hardware information.

--------------------------------------------------------------------------------

PAPI version             : 6.0.0.1

Operating system         : Linux 4.9.140-tegra

Vendor string and code   : ARM_UNKNOWN (0, 0x0)

Model string and code    :  (0, 0x0)

CPU revision             : 0.000000

CPU Max MHz              : 1907

CPU Min MHz              : 115

Total cores              : 6

SMT threads per core     : 1

Cores per socket         : 2

Sockets                  : 3

Cores per NUMA region    : 6

NUMA regions             : 0

Running in a VM          : no

Number Hardware Counters : 0

Max Multiplex Counters   : 384

Fast counter read (rdpmc): no

--------------------------------------------------------------------------------

Compiled-in components:

Name:   perf_event              Linux perf_event CPU counters

   \-> Disabled: Error libpfm4 no default PMU found

Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge

   \-> Disabled: No uncore PMUs or events found

 Active components:
 
Thank you,
Abayomi.






Giuseppe Congiu

unread,
Jul 5, 2022, 11:03:57 AM7/5/22
to ptools-perfapi, abayomi adekanmbi, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh
Hi Abayomi,

PAPI supports ARM CPUs. Can you provide some more information about your system? One explanation is that PAPI (and libpfm4) does not yet support the specific PMU of your CPU (as reported by the output of papi_component_avail). Can you attach the output of lscpu or cat /proc/cpuinfo?

Thank you,
Giuseppe

William Cohen

unread,
Jul 6, 2022, 10:22:31 AM7/6/22
to Giuseppe Congiu, ptools-perfapi, wco...@redhat.com, abayomi adekanmbi, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh
On 7/5/22 11:03, Giuseppe Congiu wrote:
> Hi Abayomi,
>
> PAPI supports ARM CPUs. Can you provide some more information about your system? One explanation is that PAPI (and libpfm4) does not yet support the specific PMU of your CPU (as reported by the output of papi_component_avail). Can you attach the output of lscpu or cat /proc/cpuinfo?
>
> Thank you,
> Giuseppe

Yes, that information would be helpful. Also would be useful to know which linux distribution is being used. Whether this is locally built papi and how it was built.

One other suggestion would be to see whether linux perf works on the machine. From the "Operating system" it looks like this is a NVidia tegra processor, but that could be one of several microarchitectures. Knowing that the kernel supports the performance monitoring hardware is a useful data point. Using linux perf would be a quick check to see whether there are any issues with the kernel supporting the performance monitoring hardware. You should be able to do something like following and see events like instructions and cycles counted:

$ perf stat true

Performance counter stats for 'true':

2.24 msec task-clock:u # 0.052 CPUs utilized
0 context-switches:u # 0.000 /sec
0 cpu-migrations:u # 0.000 /sec
37 page-faults:u # 16.542 K/sec
635,014 cycles:u # 0.284 GHz
122,399 instructions:u # 0.19 insn per cycle
<not supported> branches:u
2,527 branch-misses:u

0.043399590 seconds time elapsed

0.008417000 seconds user
0.000000000 seconds sys


-Will
> --
> 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 <mailto: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/b8a57836-644f-48be-a2da-f6f61b31f86en%40icl.utk.edu <https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/b8a57836-644f-48be-a2da-f6f61b31f86en%40icl.utk.edu?utm_medium=email&utm_source=footer>.

abayomi adekanmbi

unread,
Jul 6, 2022, 11:44:04 AM7/6/22
to William Cohen, Giuseppe Congiu, ptools-perfapi, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh
Hi Will,

Thank you for the response. I have attached the logs and PAPI was built locally from source.


nvidia@master1:~$ perf stat true

Performance counter stats for 'true':

          3.154240      task-clock (msec)         #    0.353 CPUs utilized         

                11      context-switches          #    0.003 M/sec                 

                 0      cpu-migrations            #    0.000 K/sec                 

                61      page-faults               #    0.019 M/sec                 

         3,179,681      cycles                    #    1.008 GHz                   

           951,368      instructions              #    0.30  insn per cycle        

   <not supported>      branches                                                   

            19,505      branch-misses                                              

       0.008936623 seconds time elapsed

 

nvidia@master1:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 18.04.6 LTS

Release: 18.04

Codename: bionic

nvidia@master1:~$ uname -a

Linux master1.dell.com 4.9.140-tegra #1 SMP PREEMPT Thu Aug 20 10:58:23 CST 2020 aarch64 aarch64 aarch64 GNU/Linux

nvidia@master1:~$

 


- Abayomi.

abayomi adekanmbi

unread,
Jul 6, 2022, 11:44:07 AM7/6/22
to Giuseppe Congiu, ptools-perfapi, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh
Hi Giuseppe,

Thanks for the response. I have attached the output below.

Abayomi.

nvidia@master1:~$ lscpu

Architecture:         aarch64

Byte Order:           Little Endian

CPU(s):               6

On-line CPU(s) list:  0-3

Off-line CPU(s) list: 4,5

Thread(s) per core:   1

Core(s) per socket:   2

Socket(s):            2

Vendor ID:            Nvidia

Model:                0

Model name:           ARMv8 Processor rev 0 (v8l)

Stepping:             0x0

CPU max MHz:          1907.2000

CPU min MHz:          115.2000

BogoMIPS:             62.50

L1d cache:            64K

L1i cache:            128K

L2 cache:             2048K

L3 cache:             4096K

Flags:                fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp

nvidia@master1:~$ cat /proc/cpuinfo

processor : 0

model name : ARMv8 Processor rev 0 (v8l)

BogoMIPS : 62.50

Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp

CPU implementer : 0x4e

CPU architecture: 8

CPU variant : 0x0

CPU part : 0x004

CPU revision : 0

MTS version : 50168445

 

processor : 1

model name : ARMv8 Processor rev 0 (v8l)

BogoMIPS : 62.50

Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp

CPU implementer : 0x4e

CPU architecture: 8

CPU variant : 0x0

CPU part : 0x004

CPU revision : 0

MTS version : 50168445

 

processor : 2

model name : ARMv8 Processor rev 0 (v8l)

BogoMIPS : 62.50

Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp

CPU implementer : 0x4e

CPU architecture: 8

CPU variant : 0x0

CPU part : 0x004

CPU revision : 0

MTS version : 50168445

 

processor : 3

model name : ARMv8 Processor rev 0 (v8l)

BogoMIPS : 62.50

Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp

CPU implementer : 0x4e

CPU architecture: 8

CPU variant : 0x0

CPU part : 0x004

CPU revision : 0

MTS version : 50168445

 


Giuseppe Congiu

unread,
Jul 6, 2022, 11:44:57 AM7/6/22
to abayomi adekanmbi, ptools-perfapi, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh
Abayomi,

Although you have a 64-bit ARM CPU, PMU might not be supported by libpfm4.

Can you try running showevtinfo in papi/src/libpfm4/examples?

You should get an output that has a list of supported PMUs for ARM:

Supported PMU models:
        [51, perf, "perf_events generic PMU"]
        [114, perf_raw, "perf_events raw PMU"]
        [151, arm_ac57, "ARM Cortex A57"]
        [152, arm_ac53, "ARM Cortex A53"]
        [156, arm_xgene, "Applied Micro X-Gene"]
        [436, arm_thunderx2, "Cavium ThunderX2"]
        ...

Followed by a list of detected PMUs:

Detected PMU models:
        [51, perf, "perf_events generic PMU", 82 events, 1 max encoding, 0 counters, OS generic PMU]
        [114, perf_raw, "perf_events raw PMU", 1 events, 1 max encoding, 0 counters, OS generic PMU]
        [151, arm_ac57, "ARM Cortex A57", 82 events, 1 max encoding, 6 counters, core PMU]
Total events: 1686 available, 165 supported

In my case libpfm4 has detected an arm_ac57 core PMU. If you have nothing besides the OS generic PMUs then your PMU is not supported and that is the reason you are not given any event.

Best, 
Giuseppe

abayomi adekanmbi

unread,
Jul 6, 2022, 12:18:12 PM7/6/22
to Giuseppe Congiu, ptools-perfapi, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh

I get this and It seems a little strange because I also can see the detected PMUs.

Supported PMU models:
[51, perf, "perf_events generic PMU”]
[114, perf_raw, "perf_events raw PMU”]
[151, arm_ac57, "ARM Cortex A57”]
[152, arm_ac53, "ARM Cortex A53”]
[156, arm_xgene, "Applied Micro X-Gene”]
[436, arm_thunderx2, "Cavium ThunderX2”]
[438, tx2_dmc0, "Marvell ThunderX2 Node0 DMC”]
[439, tx2_dmc1, "Marvell ThunderX2 Node1 DMC”]
[440, tx2_llc0, "Marvell ThunderX2 node 0 LLC”]
[441, tx2_llc1, "Marvell ThunderX2 node 1 LLC”]
[442, tx2_ccpi0, "Marvell ThunderX2 node 0 Cross-Socket Interconnect”]
[443, tx2_ccpi1, "Marvell ThunderX2 node 1 Cross-Socket Interconnect”]

Detected PMU models:
[51, perf, "perf_events generic PMU", 82 events, 1 max encoding, 0 counters, OS generic PMU]
[114, perf_raw, "perf_events raw PMU", 1 events, 1 max encoding, 0 counters, OS generic PMU]
Total events: 482 available, 83 supported


Thank you!
Abayomi.

John Linford

unread,
Nov 22, 2022, 1:00:57 PM11/22/22
to ptools-perfapi, abayomi adekanmbi, ptools-perfapi, Wyatt Spear, Kim, Yongho, Sankaran, Rajesh, gco...@icl.utk.edu
Hi,

I've written patches for PAPI and libpfm4 that will fix this.  I'm not yet sure about the timeline for upstreaming, but please watch the repos for updates.  Cheers,

Message has been deleted

William Cohen

unread,
Jul 17, 2023, 4:05:36 PM7/17/23
to MEGHA K, ptools-perfapi, wco...@redhat.com, John Linford
On 7/6/23 05:59, MEGHA K wrote:
> Hi John,
> where i can found the repos for Patches for PAPI and libpfm4 that to fix

Hi,

The current development papi git repo is available at:

https://github.com/icl-utk-edu/papi

Look for changes in papi's src/papi_events.csv file. There should be relatively little else from the presets that would be needed.

There is a bundled libpfm in papi git repos src/libpfm4. However, this might be missing a few patches that are in the upstream libpfm4. For libpfm the upstream repostiory is:

https://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/

-Will
> --
> 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 <mailto: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/d6b0a358-fe8e-48a7-ab71-d21e8f44326cn%40icl.utk.edu <https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/d6b0a358-fe8e-48a7-ab71-d21e8f44326cn%40icl.utk.edu?utm_medium=email&utm_source=footer>.

John C. Linford

unread,
Jul 18, 2023, 10:33:52 AM7/18/23
to William Cohen, MEGHA K, ptools-perfapi
Hi,

Thanks Will for replying.  Megha, my apologies for missing your first message.  

All the patches -- including the patches for libpfm4 -- have been added to PAPI mainline.  Simply clone the PAPI repo and you're good to go.  For example: 

cd papi/src
./configure --prefix=$PWD/..
make -j
make install

Cheers,


Reply all
Reply to author
Forward
0 new messages