0

我正在关注此处的教程,以获取Performance Application Programming Interface的 python 包装器。

我可以看到papi_avail我的系统确实有硬件计数器 ( Number Hardware Counters: 11) 并且我感兴趣的事件 ( PAPI_SP_OPS) 可用:

Name        Code       Avail Deriv Description (Note)
PAPI_SP_OPS 0x80000067 Yes   Yes   Floating point operations; optimised to count scaled single precision vector operations

现在我运行类似于教程中所示的 python 包装器:

from pyapi import events, papi_high as high

high.start_counters([events.PAPI_SP_OPS]) 

但是我得到了错误pyapi.exceptions.PapiNoEventError: Event does not exist. (PAPI_ENOEVNT)。但显然事件确实存在,如开头所示papi_avail

有小费吗?

4

1 回答 1

0

This means that the event is available but your python code doesn't access to the Counters in the Hardware.

In my experience, you cannot access the counters in the AWS instances, but if you are running in your local machine, then you should give your environment special privileges.

What I have done is set up a docker container, with the flag "--privileged" and that has solved the issue.

于 2021-02-25T19:22:40.377 回答