asitop
asitop copied to clipboard
KeyError: 'combined_power' on MacOS 12.4/12.6.3 on M1 Max
Hardware Overview
Model Name: MacBook Pro
Model Identifier: MacBookPro18,2
Chip: Apple M1 Max
Total Number of Cores: 10 (8 performance and 2 efficiency)
Memory: 64 GB
System Firmware Version: 7459.121.3
OS Loader Version: 7459.121.3
Exception
$ sudo asitop
ASITOP - Performance monitoring CLI tool for Apple Silicon
You can update ASITOP by running `pip install asitop --upgrade`
Get help at `https://github.com/tlkh/asitop`
P.S. You are recommended to run ASITOP with `sudo asitop`
[1/3] Loading ASITOP
[2/3] Starting powermetrics process
[3/3] Waiting for first reading...
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/asitop/utils.py", line 18, in parse_powermetrics
cpu_metrics_dict = parse_cpu_metrics(powermetrics_parse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/asitop/parsers.py", line 133, in parse_cpu_metrics
cpu_metric_dict["package_W"] = cpu_metrics["combined_power"]/1000
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'combined_power'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/bin/asitop", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/asitop/asitop.py", line 159, in main
ready = get_reading()
^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/asitop/asitop.py", line 156, in get_reading
ready = parse_powermetrics(timecode=timecode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/asitop/utils.py", line 29, in parse_powermetrics
cpu_metrics_dict = parse_cpu_metrics(powermetrics_parse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/asitop/parsers.py", line 133, in parse_cpu_metrics
cpu_metric_dict["package_W"] = cpu_metrics["combined_power"]/1000
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'combined_power'
Python version (built by brew install [email protected])
python3.11 --version
Python 3.11.1
asitop version 0.0.23
pip3.11 freeze | grep asitop
asitop==0.0.23
I updated to the latest MacOs 12.x patch release I have access to, 12.6.3, and I still see the same issue.
(For someone googled this issue) If you're in a hurry as an end-user you can install 0.0.21 that does not have this code:
pip install asitop==0.0.21
I also meet this problem on 12.6.3, is there anyone fix it?
The key was recently changed to combined_power for compatibility with Ventura, but this broke compatibility with Monterey, where the key was originally package_energy...
There is a PR for fixing this at #52, hopefully it gets merged soon?