asitop icon indicating copy to clipboard operation
asitop copied to clipboard

P-Core and E-Core always 100% usage

Open Else00 opened this issue 1 year ago • 14 comments

M3 Max 40 Core GPU

Screenshot 2024-04-09 at 10 23 35

Else00 avatar Apr 09 '24 08:04 Else00

Same system, same problem It's reporting 100% CPU... at 0.5 watts

SUPERCELLEX avatar Apr 11 '24 01:04 SUPERCELLEX

same here

tydia avatar Apr 14 '24 10:04 tydia

confirmed that parse_cpu_metrics() doesn't recognize the cores properly on an M3 Max.

For example on an M3 Max with 14 cores (4 Efficiency, 10 Performance) the E-Cluster_active is set to 100 but the the actual cores are named E-Cluster0_active, E-Cluster1_active to P-Cluster13_active

Some sample code that is able to read all cores is:

        for cluster in e_core:
            cpu_metric_dict["E-Cluster_active"] += cpu_metric_dict["E-Cluster" +
                                                                   str(cluster) + "_active"]
            cpu_metric_dict["E-Cluster_freq_Mhz"] = max(
                cpu_metric_dict["E-Cluster_freq_Mhz"], cpu_metric_dict["E-Cluster" + str(cluster) + "_freq_Mhz"])

        cpu_metric_dict["E-Cluster_active"] = int(
            cpu_metric_dict["E-Cluster_active"]/len(e_core))

        for cluster in p_core:
            cluster_name = "P-Cluster" + str(cluster) + "_active"
            cluster_active = cpu_metric_dict[cluster_name]
            cluster_freq = cpu_metric_dict["P-Cluster" +
                                           str(cluster) + "_freq_Mhz"]

            if cluster_freq != 0:
                cpu_metric_dict["P-Cluster_active"] += cluster_active

            cpu_metric_dict["P-Cluster_freq_Mhz"] = max(
                cpu_metric_dict["P-Cluster_freq_Mhz"], cluster_freq)

        cpu_metric_dict["P-Cluster_active"] = int(
            cpu_metric_dict["P-Cluster_active"]/len(p_core))

But even the code above doesn't look the same as the OSX Native activity monitor. The last P-Cores show high usage in asitop and powermetrics on the second performance cluster (P-1 Cluster, CPU 9-13) because these cores can be online or offline and when they are offline they may report high usage which skews the results. So we have to filter out cores that are not online but I am not sure how.

aliasaria avatar Apr 18 '24 17:04 aliasaria

Looks like https://github.com/tlkh/asitop/pull/68/commits/5314e67192e78e5391a98c8c806f19cd1c3145fe may be the necessary fix

aliasaria avatar Apr 18 '24 17:04 aliasaria

Looks like 5314e67 may be the necessary fix

Yes, or simply use gavi's fork fixed the issue

pip install git+https://github.com/gavi/asitop.git

tydia avatar Apr 21 '24 04:04 tydia

same here

ufo2243 avatar May 26 '24 14:05 ufo2243

same here

pip install git+https://github.com/gavi/asitop.git works for me

ufo2243 avatar May 27 '24 13:05 ufo2243

Looks like 5314e67 may be the necessary fix

Yes, or simply use gavi's fork fixed the issue

pip install git+https://github.com/gavi/asitop.git

Thank you. This solved the issue on my MacBook Pro M3 Max

MemoSparkfield avatar Jun 27 '24 17:06 MemoSparkfield

Same here:

brew info asitop
==> asitop: stable 0.0.24 (bottled)
Perf monitoring CLI tool for Apple Silicon
https://tlkh.github.io/asitop/
Installed
/opt/homebrew/Cellar/asitop/0.0.24 (112 files, 1.7MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-07-25 at 12:11:50
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/asitop.rb
License: MIT
==> Dependencies
Required: [email protected]
  macOS 14.5
  Model Name:	MacBook Pro
  Model Identifier:	Mac15,9
  Chip:	Apple M3 Max
  Total Number of Cores:	16 (12 performance and 4 efficiency)
  Memory:	48 GB
  System Firmware Version:	10151.121.1
  OS Loader Version:	10151.121.1

flotpg avatar Jul 25 '24 10:07 flotpg