Home References Research Change History

Building Intel® Performance Counter Monitor (Intel® PCM) on Windows

This process is based on the official github page when using third-party open source WinRing0 driver https://github.com/intel/pcm/blob/master/doc/WINDOWS_HOWTO.md

Install Visual Studio

Install Visual Studio Community Edition with the following workloads, options and individual components:

Download the following repositories and dependencies

Prepare the code

Compile and build

Copy the build and dependencies to Program Files folder

Obtain third-party open source WinRing0 driver from TechPowerUp Real Temp software package.

Test the commands and determine what metrics are available for your CPU

Note: Not all commands have --help option, see source code for complete list. e.g. pcm-202403\src\Windows\PCMService.cpp

Example PCM.exe output on i7 12700k on Windows 11 23H2: E-Cores Disabled, HT Disabled, C-States Disabled, Turbo and EIST/Speed Shift Enabled running at ~4.69Ghz.

 UTIL  : utlization (same as core C0 state active state residency, the value is in 0..1)
 IPC   : instructions per CPU cycle
 CFREQ : core frequency in Ghz
 L3MISS: L3 (read) cache misses
 L2MISS: L2 (read) cache misses (including other core's L2 cache *hits*)
 L3HIT : L3 (read) cache hit ratio (0.00-1.00)
 L2HIT : L2 cache hit ratio (0.00-1.00)
 L3MPI : number of L3 (read) cache misses per instruction
 L2MPI : number of L2 (read) cache misses per instruction
 READ  : bytes read from main memory controller (in GBytes)
 WRITE : bytes written to main memory controller (in GBytes)
 TEMP  : Temperature reading in 1 degree Celsius relative to the TjMax temperature (thermal headroom): 0 corresponds to the max temperature
 energy: Energy in Joules


 Core (SKT) | UTIL | IPC  | CFREQ | L3MISS | L2MISS | L3HIT | L2HIT | L3MPI | L2MPI |  TEMP

   0    0     0.01   0.81    4.69      69 K     96 K    0.85    0.59  0.0020  0.0028     59
   1    0     0.00   0.55    4.69      23 K     10 K    0.80    0.53  0.0113  0.0049     59
   2    0     0.00   1.15    4.64      79 K     20 K    0.65    0.81  0.0057  0.0015     60
   3    0     0.00   0.63    4.69    4352     4933      0.91    0.56  0.0040  0.0045     59
   4    0     0.04   1.84    4.69     181 K    127 K    0.80    0.75  0.0005  0.0003     56
   5    0     0.00   1.00    4.69     130 K     27 K    0.70    0.80  0.0064  0.0013     58
   6    0     0.01   1.11    4.69     210 K     96 K    0.81    0.75  0.0040  0.0018     58
   7    0     0.00   0.68    4.69      17 K   7838      0.80    0.54  0.0088  0.0039     60
---------------------------------------------------------------------------------------------------------------
 SKT    0     0.01   1.50    4.69     716 K    389 K    0.79    0.73  0.0014  0.0008     56
---------------------------------------------------------------------------------------------------------------
 TOTAL  *     0.01   1.50    4.69     716 K    389 K    0.79    0.73  0.0014  0.0008     N/A

 Instructions retired:  500 M ; Active cycles:  333 M ; Time (TSC): 3647 Mticks ; C0 (active,non-halted) core residency: 0.88 %

 C1 core residency: 99.12 %; C3 core residency: 0.00 %; C6 core residency: 0.00 %; C7 core residency: 0.00 %;
 C0 package residency: 100.00 %; C2 package residency: 0.00 %; C4 package residency: 0.00 %; C6 package residency: 0.00 %;
                             ┌────────────────────────────────────────────────────────────────────────────────┐
 Core    C-state distribution│01111111111111111111111111111111111111111111111111111111111111111111111111111111│
                             └────────────────────────────────────────────────────────────────────────────────┘
                             ┌────────────────────────────────────────────────────────────────────────────────┐
 Package C-state distribution│00000000000000000000000000000000000000000000000000000000000000000000000000000000│
                             └────────────────────────────────────────────────────────────────────────────────┘
---------------------------------------------------------------------------------------------------------------
MEM (GB)->|  READ |  WRITE | CPU energy | PP0 energy | PP1 energy |
---------------------------------------------------------------------------------------------------------------
 SKT   0     0.06     0.02      32.25      30.53       0.00
---------------------------------------------------------------------------------------------------------------

Optional: Install/Uninstall Perfmon Counters Service

Installing and running this service will allow you to capture similar metrics via Perfmon and custom data collector.