Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

intel pcm error in linux system

karthi127
Novice
1,085 Views

When running pcm as a docker container in a linux system  of Model name: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz. Getting below errors even when i run it as a root. Used https://github.com/intel/pcm/blob/master/doc/DOCKER_README.md as reference.

Where as installing sudo apt install pcm and direct pcm command is running fine without issue. I want to use grafana output for monitoring. 

 

===== Processor information =====
Linux arch_perfmon flag : yes
Hybrid processor : no
IBRS and IBPB supported : yes
STIBP supported : yes
Spec arch caps supported : yes
Max CPUID level : 22
CPU model number : 142
Number of physical cores: 4
Number of logical cores: 8
Number of online logical cores: 8
Threads (logical cores) per physical core: 2
Num sockets: 1
Physical cores per socket: 4
Last level cache slices per socket: 4
Core PMU (perfmon) version: 4
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 2100000000 Hz
IBRS enabled in the kernel : yes
STIBP enabled in the kernel : no
The processor is not susceptible to Rogue Data Cache Load: yes
The processor supports enhanced IBRS : yes
Package thermal spec power: 15 Watt; Package minimum power: 0 Watt; Package maximum power: 0 Watt;

opening /dev/mem failed: errno is 1 (Operation not permitted)
Can not read memory controller counter information from PCI configuration space. Access to memory bandwidth counters is not possible.
You must be root to access these SandyBridge/IvyBridge/Haswell counters in PCM.
INFO: Linux perf interface to program uncore PMUs is present
INFO: Secure Boot detected. Using Linux perf for uncore PMU programming.
Socket 0: 0 PCU units detected. 0 IIO units detected. 0 IRP units detected. 4 CHA/CBO units detected. 0 MDF units detected. 0 UBOX units detected. 0 CXL units detected. 0 PCIE_GEN5x16 units detected. 0 PCIE_GEN5x8 units detected.

Closed perf event handles
Trying to use Linux perf events...
Usage of Linux perf events is disabled through PCM_NO_PERF environment variable. Using direct PMU programming...
Starting plain HTTP server on http://localhost:9738/
PCM Error: someone has corrupted custom counter 0 on core 0 expected value 4399313 value read 0
PCM Error: someone has corrupted custom counter 1 on core 0 expected value 4392145 value read 0
PCM Error: someone has corrupted custom counter 2 on core 0 expected value 4395217 value read 0
PCM Error: someone has corrupted custom counter 0 on core 1 expected value 4399313 value read 0
PCM Error: someone has corrupted custom counter 1 on core PCM Error: someone has corrupted custom counter 01 expected value 4392145 value read 0 on core 6 expected value 4399313PCM Error: someone has corrupted custom counter 3PCM Error: someone has corrupted custom counter 0 on core 4 expected value 4399313 value read value read 0PCM Error: someone has corrupted custom counter 0 on core 5 expected value 4399313 value read 0

 

Sometimes seeing :

Zeroed PMU registers
Trying to use Linux perf events...
Usage of Linux perf events is disabled through PCM_NO_PERF environment variable. Using direct PMU programming...
WARNING: Custom counter 0 is in use. MSR_PERF_GLOBAL_INUSE on core 0: 0x800000000000000f
WARNING: Custom counter 1 is in use. MSR_PERF_GLOBAL_INUSE on core 0: 0x800000000000000f
WARNING: Custom counter 2 is in use. MSR_PERF_GLOBAL_INUSE on core 0: 0x800000000000000f
WARNING: Custom counter 3 is in use. MSR_PERF_GLOBAL_INUSE on core 0: 0x800000000000000f
WARNING: Core 0 IA32_PERFEVTSEL0_ADDR is not zeroed 1253585
Zeroed PMU registers

0 Kudos
7 Replies
Thomas_W_Intel
Employee
1,017 Views

Are you using the --privileged option for the container as described in the README?

0 Kudos
karthi127
Novice
982 Views

Hi Thomas,

I have tried both privilaged commands and command with limited capabilities without privilaged both leading to same error. Is there any other flags which should be set ?

0 Kudos
Roman_D_Intel
Employee
952 Views

Are you running a single instance of pcm? e.g. no other pcm instances in parallel? Are there any other tools using performance monitoring counters running in parallel?

0 Kudos
karthi127
Novice
944 Views

No.  I am not using. I do not see any tools using performance monitoring counters running.

0 Kudos
Thomas_W_Intel
Employee
942 Views

Which OS and kernel version are you using?

 

0 Kudos
karthi127
Novice
930 Views

Os: Ubuntu 22.04.4 LTS

Kernel version : 6.5.0-44-generic

0 Kudos
Thomas_W_Intel
Employee
884 Views

The PCM container runs fine on my Ubuntu 22.04 system.
As Roman hinted, the logs suggest that some other tool is running that is using the PMU, e.g. another instance of PCM, Linux perf, VTune. 

0 Kudos
Reply