Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to Intel(r) Performance Counter Monitor has denied (Performance Monitoring Unit is occupied by other application) #608

Closed
zhaowq32 opened this issue Nov 22, 2023 · 13 comments

Comments

@zhaowq32
Copy link

operating system: MacOS 12.7.1
CPU: i9-9980HK
Clang version:Apple clang version 13.1.6 (clang-1316.0.21.2.5)
image

@opcm
Copy link
Contributor

opcm commented Nov 22, 2023

do any other PMU tools run in parallel? you can try to run pcm with the -r flag

@zhaowq32
Copy link
Author

It's not working with -r flag.Maybe iStats Menus?

@rdementi
Copy link
Contributor

try to stop the other app you suspect and re-run "pcm -r"

@zhaowq32
Copy link
Author

Still not working

@opcm
Copy link
Contributor

opcm commented Nov 22, 2023

are you running pcm as root?

@zhaowq32
Copy link
Author

No,i will have a try with sudo.

@zhaowq32
Copy link
Author

Not working

@rdementi
Copy link
Contributor

please share a complete output of "sudo pcm -r"

@zhaowq32
Copy link
Author

➜ bin git:(master) sudo ./pcm -r

Intel(r) Performance Counter Monitor ($Format:%ci ID=%h$)

===== Processor information =====
Hybrid processor : no
IBRS and IBPB supported : yes
STIBP supported : yes
Spec arch caps supported : yes
Max CPUID level : 22
CPU model number : 158
IOServiceOpen returned 0x10000003
Unable to build CPU topology

Resetting PMU configuration
Zeroed PMU registers
WARNING: Core 0 IA32_PERFEVTSEL0_ADDR is not zeroed 18446744073709551615
Access to Intel(r) Performance Counter Monitor has denied (Performance Monitoring Unit is occupied by other application). Try to stop the application that uses PMU.
Alternatively you can try running PCM with option -r to reset PMU.
Cleaning up
Zeroed PMU registers
Zeroed uncore PMU registers

@rdementi
Copy link
Contributor

could you try the released version here (https://github.com/intel/pcm/releases/tag/202311 )? Recompile both the PCM MSR driver and PCM itself please

@zhaowq32
Copy link
Author

➜  bin sudo ./pcm -r
Password:

 Intel(r) Performance Counter Monitor (2023-11-10 13:26:36 +0100 ID=dd02c99b)



=====  Processor information  =====
Hybrid processor         : no
IBRS and IBPB supported  : yes
STIBP supported          : yes
Spec arch caps supported : yes
Max CPUID level          : 22
CPU model number         : 158
IOServiceOpen returned 0x10000003
Unable to build CPU topology

 Resetting PMU configuration
 Zeroed PMU registers
WARNING: Core 0 IA32_PERFEVTSEL0_ADDR is not zeroed 18446744073709551615
Access to Intel(r) Performance Counter Monitor has denied (Performance Monitoring Unit is occupied by other application). Try to stop the application that uses PMU.
Alternatively you can try running PCM with option -r to reset PMU.
Cleaning up
 Zeroed PMU registers
 Zeroed uncore PMU registers
➜  bin ./pcm --version
version: (2023-11-10 13:26:36 +0100 ID=dd02c99b)

@opcm
Copy link
Contributor

opcm commented Nov 22, 2023

There is a different error "IOServiceOpen returned 0x10000003" above which might point to the issue: PCM MSR driver could not be loaded. Did you try the manual install procedure: https://github.com/intel/pcm/blob/master/doc/MAC_HOWTO.txt
Could you share the output of kextstat ?

@zhaowq32
Copy link
Author

Requires kext signing or turning off SIP.

2023-11-23 08:41:31.845 xcodebuild[7394:40866] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2023-11-23 08:41:31.846 xcodebuild[7394:40866] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
Error Domain=KMErrorDomain Code=29 "Authenticating extension failed: Kext com.intel.driver.PcmMsr v1 in executable kext bundle com.intel.driver.PcmMsr at /private/var/db/KernelExtensionManagement/Staging/com.intel.driver.PcmMsr.H27GvM/PcmMsrDriver.kext:

Authenticating extension failed: Bad code signature" UserInfo={NSLocalizedDescription=Authenticating extension failed: Kext com.intel.driver.PcmMsr v1 in executable kext bundle com.intel.driver.PcmMsr at /private/var/db/KernelExtensionManagement/Staging/com.intel.driver.PcmMsr.H27GvM/PcmMsrDriver.kext:

Authenticating extension failed: Bad code signature}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants