Jump to content

Installing Intel PCM on macOS 12+ (Intel Power Gadget Replacement)


cankiulascmnfye
 Share

19 posts in this topic

Recommended Posts

In October 2023, Intel discontinued Intel Power Gadget. A simple but super useful tool which allowed monitoring the CPU's behavior in a really elegant manner. It displayed all the relevant data inside a neatly desgined GUI (on macOS at least). But the app is no longer compatible with macOS and newer Intel CPUs (11th Gen+). In macOS 14.2 beta 3, Intel Power Gadget causes the CPU to freak out and run at 100% on all cores. So it's highly recommended to uninstal it via the incuded uninstaller, so the EnergyDriver.kext it uses is uninstalled as well.

 

As a replacement, Intel introduced the Performance Counter Monitor (PCM). This "glorious" new tool has no macOS app that you can simply download, install and run. Instead, you have to jump through hoops to get it working. And on top of that: it runs in Terminal and doesn't really help you much with monitoring CPU frequencies since everything mostly consists of charts with stats – no graphs. Anyway, below you will find the instructions, to download, compile, install and run Intel PCM.

 

It took me some time and help from others to figure this out, so I hope it helps you.

 

Prerequistes:

 

  1. Uninstall  Intel Power Gadget (use the Uninstaller.pkg located in Application/Intel Power Gadget so that it also uninstalls the EnergyDriver.kext from Library/Extensions as well)
     
  2.  Minimum OS: macOS Monterey+
     
  3. Install Homebrew:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

     

  4. Install Cmake.
    brew install cmake

     

Building PCM Tools:

 

  1. Clone the Intel PC Repo

    git clone --recursive https://github.com/opcm/pcm.git

     

  2. Navigate to the pcm folder:

    cd ~/pcm

     

  3. Build the PCM binaries (this can take a few minutes):

    mkdir build
    cd build
    cmake ..
    cmake --build .

     

  4. Install the tools and required PcmMsrDriver.kext:

    sudo make install

    NOTE: macOS will notfiy you about a new extension. You need to allow it (Gatekeeper)
     

  5. Reboot

Running PCM Tools:

In Terminal, enter:

sudo ~/pcm/build/bin/pcm -r

 

Edited by cankiulascmnfye
Updated Instructions
  • Like 5
Link to comment
Share on other sites

Adlerlake Problem

Regrettably, at the moment, incorporating Alder Lake support for MacOS is beyond our current focus. Nevertheless, we warmly welcome pull requests adding the support.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.ALL6O4NJSCBTZWZKIA2S4MLYFMIT7A5CNFSM6AAA

 

{23-11-18 22:07}Pluton-V:~ seyd% sudo ~/pcm/build/bin/pcm -r

^[[3~Password:

Sorry, try again.

Password:

 

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

 

 

 

=====  Processor information  =====

Hybrid processor         : yes

IBRS and IBPB supported  : yes

STIBP supported          : yes

Spec arch caps supported : yes

Max CPUID level          : 32

CPU model number         : 151

PCM Error: Hybrid processors are not supported for your OS

 

Resetting PMU configuration

Zeroed PMU registers

WARNING: Core 1 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

Edited by seyd46
Link to comment
Share on other sites

I remove Intel Power Gadget (EnergyDriver.kext)

Same problem

I searched and submitted the error in github

 

thank man

I searched and submitted the error

 

I searched and submitted the error
I searched and submitted the error
I searched and submitted the error
  • Like 1
Link to comment
Share on other sites

13 hours ago, user232 said:

Thanks, works on my CoffeeLake. Is there a GUI planed in future?

 

Problem:

I think CPU-Temp 64 is not correct. iStat shows 33

 

I am not sure if iStat is more correct.

Link to comment
Share on other sites

How can I remove PCM completely?

 

I think I must manually clean my System?

 

/usr/local/sbin/pcm
/usr/local/sbin/pcm-numa
/usr/local/sbin/pcm-latency
/usr/local/sbin/pcm-power
/usr/local/sbin/pcm-msr
/usr/local/sbin/pcm-memory
/usr/local/sbin/pcm-tsx
/usr/local/sbin/pcm-pcie
/usr/local/sbin/pcm-core
/usr/local/sbin/pcm-iio
/usr/local/sbin/pcm-lspci
/usr/local/sbin/pcm-pcicfg
/usr/local/sbin/pcm-mmio
/usr/local/sbin/pcm-tpmi
/usr/local/sbin/pcm-raw
/usr/local/sbin/pcm-accel
/usr/local/sbin/pcm-sensor
/usr/local/sbin/pcm-bw-histogram
/usr/local/share/pcm/opCode-106.txt
/usr/local/share/pcm/opCode-134.txt
/usr/local/share/pcm/opCode-143-accel.txt
/usr/local/share/pcm/opCode-143.txt
/usr/local/share/pcm/opCode-85.txt
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-55-B.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-4F-1.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-55-4.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-8F-8.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-86-5.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-8F-6.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-55-7.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-8E-C.json
/usr/local/share/pcm/PMURegisterDeclarations/GenuineIntel-6-6A-6.json
/usr/local/share/licenses/pcm/LICENSE
/usr/local/share/doc/PCM/README.md
/usr/local/share/doc/PCM/CUSTOM-COMPILE-OPTIONS.md
/usr/local/share/doc/PCM/CXL_README.md
/usr/local/share/doc/PCM/DOCKER_README.md
/usr/local/share/doc/PCM/ENVVAR_README.md
/usr/local/share/doc/PCM/FAQ.md
/usr/local/share/doc/PCM/FREEBSD_HOWTO.txt
/usr/local/share/doc/PCM/LINUX_HOWTO.txt
/usr/local/share/doc/PCM/MAC_HOWTO.txt
/usr/local/share/doc/PCM/PCM-EXPORTER.md
/usr/local/share/doc/PCM/PCM-SENSOR-SERVER-README.md
/usr/local/share/doc/PCM/PCM_ACCEL_README.md
/usr/local/share/doc/PCM/PCM_RAW_README.md
/usr/local/share/doc/PCM/STARS.md
/usr/local/share/doc/PCM/WINDOWS_HOWTO.md
/usr/local/share/doc/PCM/generate_summary_readme.md
/usr/local/share/doc/PCM/license.txt
/usr/local/lib/libPcmMsr.dylib
/Library/Extensions/PcmMsrDriver.kext/Contents/MacOS/PcmMsrDriver
/Library/Extensions/PcmMsrDriver.kext/Contents/Info.plist

 

Edited by user232
Link to comment
Share on other sites

I know, but dont work, so I delete first PcmMsrDriver.kext and do this.

 

Quote

user232@iMac pcm % pwd
/Users/user232/pcm
user232@iMac pcm % sudo ~/pcm/build/bin/pcm --uninstallDriver
Password:

 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
WARNING: unknown command-line option: "-". Ignoring it.

 Usage:
 /Users/user232/pcm/build/bin/pcm --help | [delay] [options] [-- external_program [external_program_options]]
   <delay>                           => time interval to sample performance counters.
                                        If not specified, or 0, with external program given
                                        will read counters only after external program finishes
 Supported <options> are:
  -h    | --help      | /h           => print this help and exit
  -silent                            => silence information output and print only measurements
  --version                          => print application version
  -pid PID | /pid PID                => collect core metrics only for specified process ID
  -r    | --reset     | /reset       => reset PMU configuration (at your own risk)
  -nc   | --nocores   | /nc          => hide core related output
  -yc   | --yescores  | /yc          => enable specific cores to output
  -ns   | --nosockets | /ns          => hide socket related output
  -nsys | --nosystem  | /nsys        => hide system related output
  -csv[=file.csv] | /csv[=file.csv]  => output compact CSV format to screen or
                                        to a file, in case filename is provided
                                        the format used is documented here: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-pcm-column-names-decoder-ring.html
  -i[=number] | /i[=number]          => allow to determine number of iterations
  -f    | /f                         => enforce flushing output
 Examples:
  /Users/user232/pcm/build/bin/pcm 1 -nc -ns          => print counters every second without core and socket output
  /Users/user232/pcm/build/bin/pcm 1 -i=10            => print counters every second 10 times and exit
  /Users/user232/pcm/build/bin/pcm 0.5 -csv=test.log  => twice a second save counter values to test.log in CSV format
  /Users/user232/pcm/build/bin/pcm /csv 5 2>/dev/null => one sample every 5 seconds, and discard all diagnostic output

Cleaning up
 Zeroed PMU registers
 Zeroed uncore PMU registers
user232@iMac pcm %

 

 

 

Now I cleanup manually.

 

 

Quote

user232@iMac pcm % rm /usr/local/sbin/*
zsh: sure you want to delete all 18 files in /usr/local/sbin [yn]? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-accel? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-bw-histogram? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-core? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-iio? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-latency? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-lspci? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-memory? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-mmio? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-msr? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-numa? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-pcicfg? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-pcie? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-power? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-raw? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-sensor? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-tpmi? y
override rwxr-xr-x root/admin for /usr/local/sbin/pcm-tsx? y

 

 

Quote

user232@iMac share % sudo rm /usr/local/lib/libPcmMsr.dylib

 

Edited by user232
  • Thanks 1
Link to comment
Share on other sites

Thanks for the detailed guide on installing Intel PCM on macOS. I was wondering, since PCM is more Terminal-based and lacks the user-friendly GUI of Intel Power Gadget, do you have any tips or recommendations for users who are not as familiar with Terminal commands? Also, are there any third-party tools or scripts that you would recommend to make monitoring with PCM a bit more intuitive or visually accessible for those who might miss the graphical interface of the old Power Gadget?


Thanks again for your valuable insights! 

Link to comment
Share on other sites

 Share

×
×
  • Create New...