Code Monkey home page Code Monkey logo

asitop's Introduction

asitop

PyPI - Downloads

Performance monitoring CLI tool for Apple Silicon

pip install asitop

What is asitop

A Python-based nvtop-inspired command line tool for Apple Silicon (aka M1) Macs.

  • Utilization info:
    • CPU (E-cluster and P-cluster), GPU
    • Frequency and utilization
    • ANE utilization (measured by power)
  • Memory info:
    • RAM and swap, size and usage
    • (Apple removed memory bandwidth from powermetrics)
  • Power info:
    • CPU power, GPU power (Apple removed package power from powermetrics)
    • Chart for CPU/GPU power
    • Peak power, rolling average display

asitop uses the built-in powermetrics utility on macOS, which allows access to a variety of hardware performance counters. Note that it requires sudo to run due to powermetrics needing root access to run. asitop is lightweight and has minimal performance impact.

asitop only works on Apple Silicon Macs on macOS Monterey!

Installation and Usage

asitop is a Python-based command line tool. You need pip to download and install asitop. macOS already comes with Python, to install pip, you can follow an online guide. After you install asitop via pip, you can use it via the Terminal.

# to enter password before start
# this mode is recommended!
sudo asitop

# it will prompt password on start
asitop

# advanced options
asitop [-h] [--interval INTERVAL] [--color COLOR] [--avg AVG]
optional arguments:
  -h, --help           show this help message and exit
  --interval INTERVAL  Display interval and sampling interval for powermetrics (seconds)
  --color COLOR        Choose display color (0~8)
  --avg AVG            Interval for averaged values (seconds)

How it works

powermetrics is used to measure the following:

  • CPU/GPU utilization via active residency
  • CPU/GPU frequency
  • Package/CPU/GPU/ANE energy consumption
  • CPU/GPU/Media Total memory bandwidth via the DCS (DRAM Command Scheduler)

psutil is used to measure the following:

  • memory and swap usage

sysctl is used to measure the following:

  • CPU name
  • CPU core counts

system_profiler is used to measure the following:

  • GPU core count

Some information is guesstimate and hardcoded as there doesn't seem to be a official source for it on the system:

  • CPU/GPU TDP
  • CPU/GPU maximum memory bandwidth
  • ANE max power
  • Media engine max bandwidth

Why

Because I didn't find something like this online. Also, just curious about stuff.

Disclaimers

I did this randomly don't blame me if it fried your new MacBook or something.

asitop's People

Contributors

ardacoskunses avatar iiseymour avatar lunar-zz avatar mend-bolt-for-github[bot] avatar paul-nameless avatar tientim avatar tlkh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asitop's Issues

TypeError: 'str' object cannot be interpreted as an integer

[1/3] Loading ASITOP

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/asitop", line 8, in
sys.exit(main())
^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/asitop/asitop.py", line 38, in main
e_core_gauges = [VGauge(val=0, color=args.color, border_color=args.color) for _ in range(e_core_count)]
^^^^^^^^^^^^^^^^^^^
TypeError: 'str' object cannot be interpreted as an integer

Suitable for M3 Max?

The CPU usage is incorrect and memory bandwidth is not displayed, May I know when the M3 Max can be adapted?
M3 Max powermetrics

ValueError: cannot convert float NaN to integer

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/utils.py", line 19, in parse_powermetrics
    gpu_metrics_dict = parse_gpu_metrics(powermetrics_parse)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/parsers.py", line 141, in parse_gpu_metrics
    "active": int((1 - gpu_metrics["idle_ratio"])*100),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer

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 183, in main
    ready = parse_powermetrics(timecode=timecode)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/utils.py", line 30, in parse_powermetrics
    gpu_metrics_dict = parse_gpu_metrics(powermetrics_parse)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/parsers.py", line 141, in parse_gpu_metrics
    "active": int((1 - gpu_metrics["idle_ratio"])*100),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer

Error when running on an Apple Virtual Machine

I am trying to run this on a macOS Virtual Machine to monitor usage; the base machine is a mac mini with an M1 chip. I am getting the error below.

min@admins-Mac ~ % sudo asitop
Password:

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...

ERROR: cannot find the IO registry entry for IODeviceTree:/arm-io/pmgr
ERROR: cannot find the IO registry entry for IODeviceTree:/arm-io/pmgr
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/utils.py", line 18, in parse_powermetrics
    cpu_metrics_dict = parse_cpu_metrics(powermetrics_parse)
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/parsers.py", line 79, in parse_cpu_metrics
    cpu_metrics = powermetrics_parse["processor"]
KeyError: 'processor'

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.9/site-packages/asitop/asitop.py", line 121, in main
    ready = get_reading()
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/asitop.py", line 118, in get_reading
    ready = parse_powermetrics(timecode=timecode)
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/utils.py", line 28, in parse_powermetrics
    cpu_metrics_dict = parse_cpu_metrics(powermetrics_parse)
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/parsers.py", line 79, in parse_cpu_metrics
    cpu_metrics = powermetrics_parse["processor"]
KeyError: 'processor'
admin@admins-Mac ~ % 

not working on M1 Mac Mini

`user@Mac-Mini ~ % 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...

Password:
powermetrics: unrecognized sampler: bandwidth`

everything is up to date

package power value calculation

i'm testing various monitoring apps and i've seen that values for package power in asitop widely differs from stats.
in asitop i have this:
CPU+GPU+ANE Power: 0.10W (avg: 0.11W peak: 0.22W)
in stats i see this (as shown on the screenshot below):
battery: 0.74w DC in: 6.98w system total: 7.8w

asitop seems to indicate a very small general consumption, typically less than 1w, while stats shows around 5-8w on average. why the numbers do vary that much between the two apps ? which one would be closer to reality ?

Screenshot

Enormous /tmp/asitop_powermetrics* files

It's filled my hard drive up with files like this:

-rw-r--r-- 1 root wheel 43G 14 Dec 16:01 asitop_powermetrics1637685873
-rw-r--r-- 1 root wheel 37G 14 Dec 16:01 asitop_powermetrics1637936130

powermetrics: unrecognized order: /tmp/asitop_powermetrics1638952131

Can't run in M1 MacBook pro and display as below:

eric@Macintosh bin % 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...

powermetrics: unrecognized order: /tmp/asitop_powermetrics1638952131
Usage: powermetrics [-d] [-i sample_interval] [-o order] [-t wakeup_cost]

So please solve it ASAP, thanks.

Not showing total GPU count on M1 Mac mini

The CPU info line shows "Apple M1 (cores: 4E+4P+?GPU)"

Edit: Running the line the script uses:

system_profiler -detailLevel basic SPDisplaysDataType

Shows:

Graphics/Displays:

    Apple M1:

      Chipset Model: Apple M1
      Type: GPU
      Bus: Built-In
      sppci_cores: 8
      Vendor: Apple (0x106b)
      Metal Family: Supported, Metal GPUFamily Apple 7
      Displays:
        LG Ultra HD:
          Resolution: 3840 x 2160 (2160p/4K UHD 1 - Ultra High Definition)
          UI Looks like: 1920 x 1080 @ 60.00Hz
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Rotation: Supported
          Automatically Adjust Brightness: Yes
        DELL P2414H:
          Resolution: 1920 x 1080 (1080p FHD - Full High Definition)
          UI Looks like: 1920 x 1080 @ 60.00Hz
          Mirror: Off
          Online: Yes
          Rotation: Supported
          Automatically Adjust Brightness: Yes

So it appears to emit the relevant field tagged sppci_cores and not Total Number of Cores.

M2 GPU clock speed

I've been searching for the M2 GPU clock speed for quite a while. Sources cited by Wikipedia (specifically cpu-monkey) are extremely unreliable, and I'm trying to determine something important about the Apple8 microarchitecture. Compared to Apple7, Apple8 supposedly has double the ALUs. That would mean Apple nearly halved the clock speed.

I have an A15 iPhone, but iOS can't run powermetrics for reverse-engineering. If any users could run asitop - or even just sudo powermetrics, that would help a lot. Just show the text of GPU clock speed range for M2. Thanks!

powermetrics: unrecognized sampler: bandwidth

I try to run asitop and get

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...

powermetrics: unrecognized sampler: bandwidth

I'm on an M1 Pro 14" MacBook Pro

Feature request: GPU memory usage

Hi,

Thank you for this neat tool! Do you have any plans for enhancing it to show GPU memory usage as well? Because it currently shows the utilisation of the GPU in general but not its memory similar to the CPU memory usage functionality.

Show "instructions per clock" for E- and P-cores

powermetrics reports this metric for each CPU core cluster, as well as an average for the entire SoC. I've found it interesting to see how this value fluctuates under various workloads, and think it would be neat to see it incorporated into asitop.

siimilar tool for intel macs?

I understand that asitop is for apple silicon only. I'm curious if there is a similar tool for intel macs. I've not yet been able to find the magic search terms (if the exist)

ANE Usage: 200% @ 16.1 W

Is ANE usage 200% correct?
Screenshot 0005-03-08 at 10 18 07

This test model goes to 200% when creating XCode performance report.

Device: MacBook M1 Air
OS: macOS 13.2

import torch
from torch import Tensor
from torch import nn
import coremltools as ct
from coremltools.models.neural_network import quantization_utils

class MyModule(nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, x: Tensor):
        for i in range(1,500):
            x = x @ x
        return x

module = MyModule()
module.eval()

input_x = torch.ones(1024, 1024)
traced_module = torch.jit.trace(module, input_x)

# convert to coreml model
module = ct.convert(
    traced_module,
    inputs=[ct.TensorType(name="input_x", shape=input_x.shape)],
    outputs=[ct.TensorType(name="output")],
    compute_units=ct.ComputeUnit.ALL,
)

module_fp16 = quantization_utils.quantize_weights(module, nbits=16)
module_fp16.save(f"module_fp16.mlmodel")

Issues with running in MacOS Ventura Beta

% sudo asitop
Password:

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...

Assertion failed: (num_resids == (uint32_t)IOReportStateGetCount(sample)), function read_cluster_power_stats_sample, file cpu_power_arm.c, line 245.

KeyError: 'machdep.cpu.brand_string' on M1 Macbook Air (2020)

➤ 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


/bin/sh: sysctl: command not found
/bin/sh: sysctl: command not found
Traceback (most recent call last):
  File "/opt/homebrew/bin/asitop", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/asitop/0.0.24/libexec/lib/python3.12/site-packages/asitop/asitop.py", line 36, in main
    soc_info_dict = get_soc_info()
                    ^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/asitop/0.0.24/libexec/lib/python3.12/site-packages/asitop/utils.py", line 140, in get_soc_info
    "name": cpu_info_dict["machdep.cpu.brand_string"],
            ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'machdep.cpu.brand_string'

Not working on MBP11,3

Hi,
I'm getting an error when I try to start it

Model: MBP11,3

powermetrics: unrecognized sampler: bandwidth
^CTraceback (most recent call last):
  File "/usr/local/bin/asitop", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/asitop/asitop.py", line 109, in main
    ready = get_reading()
  File "/usr/local/lib/python3.9/site-packages/asitop/asitop.py", line 105, in get_reading
    time.sleep(wait)

ANE max power is set to 8W is it correct?

I found in code that you set ane_max_power = 8.0 W whare you get this number and is it correct?
In my AI test (mac mini m1) with optimized coreml model with 3 parallel threads I get only 5655 mW (72% in your math) from powermetrics.
Can anyone confirm if it got over 5.7W utilization?

Please add option for output to JSON.

Is it possible to output all utilization stats to the json format? I want to implement live dashboard web interface, so I need to parce all stats.

install issue with conda (resolved instruction)

I use conda (installed via brew install miniforge) for the python installation and I created a new environment for the asitop along with latest version of python (3.10.2).

After installing asitop via pip install asitop, I got following error message:

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/asitop/bin/asitop", line 5, in <module>
    from asitop.asitop import main
  File "/opt/homebrew/Caskroom/miniforge/base/envs/asitop/lib/python3.10/site-packages/asitop/asitop.py", line 6, in <module>
    from .utils import *
  File "/opt/homebrew/Caskroom/miniforge/base/envs/asitop/lib/python3.10/site-packages/asitop/utils.py", line 5, in <module>
    import psutil
  File "/opt/homebrew/Caskroom/miniforge/base/envs/asitop/lib/python3.10/site-packages/psutil/__init__.py", line 123, in <module>
    from . import _psosx as _psplatform
  File "/opt/homebrew/Caskroom/miniforge/base/envs/asitop/lib/python3.10/site-packages/psutil/_psosx.py", line 14, in <module>
    from . import _psutil_osx as cext
ImportError: dlopen(/opt/homebrew/Caskroom/miniforge/base/envs/asitop/lib/python3.10/site-packages/psutil/_psutil_osx.cpython-310-darwin.so, 0x0002): tried: '/opt/homebrew/Caskroom/miniforge/base/envs/asitop/lib/python3.10/site-packages/psutil/_psutil_osx.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))

Removing psutil and reinstalling seems to show that correct arch binary is installed:

pip install psutil                                                                                                                              
Collecting psutil
  Using cached psutil-5.9.1-cp310-cp310-macosx_11_0_arm64.whl
Installing collected packages: psutil
Successfully installed psutil-5.9.1

But I still ended up with same error message.

So I decided to build psutil locally:
pip install --no-binary :all: psutil
(from https://github.com/giampaolo/psutil/blob/master/INSTALL.rst and you need Xcode installed already)

And it finally worked.
Thanks for the awesome package.

I'm creating the issue here in case someone else runs into the same issue.

Problems on installation

My Mac Monterey 12.4 doesn't have Python 2.XX anymore. So, when I try to install asitop, it doesn't work properly.

Captura de Tela 2022-05-19 às 16 38 31

asitop_powermetrics occupying 20gbs in SSD

Hi there,

Been using asitop for a few months, but in the last couple of weeks the asitop_powermetrics file located in private>temp was using a lot of space. I uninstalled asitop and deleted the file but I fear the same thing will happen again soon. Do you guys know what could be causing it and how to avoid my ssd being eaten by this temp file?

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

E-Cpu, P-Cpu constant 100%

My M2 max chip recently shows the usages for E-Cpu and P-Cpu constantly 100%. But the power seems correct. I verified with htop and activity monitor on cpu usages. Hope can help me fix this.

invalid powermetrics option specified

After installing and running asitop, I receive the following output:

(base) aarcross@Aarons-MacBook-Pro ~ % asitop

[1/3] Loading ASITOP

[2/3] Starting powermetrics process

[3/3] Waiting for first reading...

Password:
powermetrics: invalid option -- u
Usage: powermetrics [-i sample_interval] [-r order] [-t wakeup_cost]

Gather and display CPU usage statistics (divided into time spent in
user mode and supervisor mode), timer and interrupt wakeup frequency
(total and, for near-idle workloads, those that resulted in package
.
.
.
Machine model: MacBookPro18,1
OS version: 21A559
Boot arguments:
Boot time: Fri Oct 29 21:26:43 2021

CPU load reflects only one core

Hello, first of all thanks for this awesome utility.

I noticed something weird when running grep : it said my P-CPU usage was 100% whereas grep was only loading a single P-core (I confirmed this with Activity Monitor.app). it seems like the P-CPU usage only reflects a single core.

I am not sure if it is meant to be that way, but imo the better information would be total P-CPU usage, not single core usage.

Could you please check this ? (It may also apply to E-CPU usage, didn't try)

Thanks for your help keep it up :)

High memory usage after having a extened session

I relized this problem when I forgot to terminate the asitop and let it run overnight. The next day I noticed that some program is using a huge amount of memory. After terminated the asitop it released nearly 15 gigs of memory. Is this the inteded behavior because of the nature of logging?

Media Engine / HEVEC / ProRes Usage

Hi @tlkh , I just found out about this tool and love how much information it displays very easily.

I was wondering if it would be possible to visualize the usage of the Media Engines in a similar Historgram / Graph way as CPU Usage and such? And is it possible to separate out the ProRes and h265/264 engines?

I am wondering because Apple advertised that the M1Pro and M1Max have different counts of these engines and I would wonder if it's possible to actually see when these engines are in use vs. when they are not (for example, love that with your tool it's possible to see the ANE usage when it is utilized).

TLDR:

Would it be possible to have a usage graph of the individual Media Engines?

Thanks and I am looking forward to updates to this powerful GUI 👍.

KeyError: 'hw.perflevel1.logicalcpu'

Hello again,

Thanks for merging the fix with powermetrics.

Unfortunately now I am facing another error, maybe that's also because of the different OS versions...
Here is a traceback:

Traceback (most recent call last):
  File "/opt/homebrew/bin/asitop", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/asitop.py", line 71, in main
    soc_info_dict = get_soc_info()
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/utils.py", line 136, in get_soc_info
    "e_core_count": core_counts_dict["hw.perflevel1.logicalcpu"],
KeyError: 'hw.perflevel1.logicalcpu'

core_counts_dict calls get_core_counts()
and it calls sysctl -a | grep hw.perflevel
which returns nothing on BigSur at least

Here is the output that I could get:

~ > sudo sysctl -a | grep hw.p 
hw.packages: 1
hw.pagesize: 16384
hw.pagesize32: 16384
hw.physicalcpu: 8
hw.physicalcpu_max: 8

asitop command wont work after installation Ventura

hey guys

Ive been trying to get asitop to work but i get the following output, seems like some sort of PATH issue

natsukirei@Lukes-Mac-Studio ~ % pip3 install git+https://github.com/SuperKenVery/asitop.git Defaulting to user installation because normal site-packages is not writeable Collecting git+https://github.com/SuperKenVery/asitop.git Cloning https://github.com/SuperKenVery/asitop.git to /private/var/folders/fy/3cg2scgs4q7dvt18hvnrf_bw0000gn/T/pip-req-build-24bp443w Running command git clone --filter=blob:none --quiet https://github.com/SuperKenVery/asitop.git /private/var/folders/fy/3cg2scgs4q7dvt18hvnrf_bw0000gn/T/pip-req-build-24bp443w Resolved https://github.com/SuperKenVery/asitop.git to commit 9a67ed7eebd95370d6b97fd9821b4ef1628ff613 Preparing metadata (setup.py) ... done Requirement already satisfied: dashing in ./Library/Python/3.9/lib/python/site-packages (from asitop==0.0.21) (0.1.0) Requirement already satisfied: psutil in ./Library/Python/3.9/lib/python/site-packages (from asitop==0.0.21) (5.9.4) Requirement already satisfied: blessed in ./Library/Python/3.9/lib/python/site-packages (from dashing->asitop==0.0.21) (1.19.1) Requirement already satisfied: six>=1.9.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (from blessed->dashing->asitop==0.0.21) (1.15.0) Requirement already satisfied: wcwidth>=0.1.4 in ./Library/Python/3.9/lib/python/site-packages (from blessed->dashing->asitop==0.0.21) (0.2.5) Building wheels for collected packages: asitop Building wheel for asitop (setup.py) ... done Created wheel for asitop: filename=asitop-0.0.21-py3-none-any.whl size=9180 sha256=4c74e00e58c4a58a940ed45e517e356aca90668d925ddb6fcfb869161f53accd Stored in directory: /private/var/folders/fy/3cg2scgs4q7dvt18hvnrf_bw0000gn/T/pip-ephem-wheel-cache-8cwteb4o/wheels/06/e0/2c/f097fa055ab84bb08a213e9e75f9ee496a4979ef98f897328a Successfully built asitop Installing collected packages: asitop WARNING: The script asitop is installed in '/Users/natsukirei/Library/Python/3.9/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed asitop-0.0.21 natsukirei@Lukes-Mac-Studio ~ % asitop zsh: command not found: asitop

Asitop does not work

Why is asitop installed through PIP3 but cannot be executed? Zsh: command not found: show asitop

high cpu usage from asitop/python process when running for extended duration

I keep asitop running all the time on my 2021 16" MBP M1 Max Monterey 12.6.1. It seems that the longer it is left running the most CPU it consumes and after about 12hrs I find that it (python) is consuming 100% of a core according to top. Restarting asitop fixes the issues, but it of course reappears some hours later.

install asitop with poetry is not working

Can someone successfully install asitop package with poetry?

I use poetry to install asitop package about 1 month ago, it work at that time.

But when I reinstall asitop with poetry today, it stuck and no reaction.

poetry version: 1.2.1
python version: 3.10.6

Error on Launch = 14" MBP

asitop

[1/3] Loading ASITOP

[2/3] Starting powermetrics process

[3/3] Waiting for first reading...

Password:
Traceback (most recent call last):
File "/Users/nat/Library/Python/3.8/lib/python/site-packages/asitop/utils.py", line 21, in parse_powermetrics
bandwidth_metrics = parse_bandwidth_metrics(powermetrics_parse)
File "/Users/nat/Library/Python/3.8/lib/python/site-packages/asitop/parsers.py", line 41, in parse_bandwidth_metrics
bandwidth_metrics_dict["VENC1 DCS RD"]
KeyError: 'VENC1 DCS RD'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/nat/Library/Python/3.8/bin/asitop", line 8, in
sys.exit(main())
File "/Users/nat/Library/Python/3.8/lib/python/site-packages/asitop/asitop.py", line 118, in main
ready = get_reading()
File "/Users/nat/Library/Python/3.8/lib/python/site-packages/asitop/asitop.py", line 115, in get_reading
ready = parse_powermetrics(timecode=timecode)
File "/Users/nat/Library/Python/3.8/lib/python/site-packages/asitop/utils.py", line 31, in parse_powermetrics
bandwidth_metrics = parse_bandwidth_metrics(powermetrics_parse)
File "/Users/nat/Library/Python/3.8/lib/python/site-packages/asitop/parsers.py", line 41, in parse_bandwidth_metrics
bandwidth_metrics_dict["VENC1 DCS RD"]
KeyError: 'VENC1 DCS RD'

KeyError: 'STRM CODEC DCS RD'

Hi,

thanks for your work on asitop. I am getting the following error on a MacBookPro17,1 (MacBook Pro (13-inch, M1, 2020)) running macOS 12.0.1.

sudo asitop
Password:

[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.9/site-packages/asitop/utils.py", line 21, in parse_powermetrics
bandwidth_metrics = parse_bandwidth_metrics(powermetrics_parse)
File "/opt/homebrew/lib/python3.9/site-packages/asitop/parsers.py", line 47, in parse_bandwidth_metrics
bandwidth_metrics_dict["STRM CODEC DCS RD"], bandwidth_metrics_dict["STRM CODEC DCS WR"],
KeyError: 'STRM CODEC DCS RD'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/bin/asitop", line 8, in
sys.exit(main())
File "/opt/homebrew/lib/python3.9/site-packages/asitop/asitop.py", line 118, in main
ready = get_reading()
File "/opt/homebrew/lib/python3.9/site-packages/asitop/asitop.py", line 115, in get_reading
ready = parse_powermetrics(timecode=timecode)
File "/opt/homebrew/lib/python3.9/site-packages/asitop/utils.py", line 31, in parse_powermetrics
bandwidth_metrics = parse_bandwidth_metrics(powermetrics_parse)
File "/opt/homebrew/lib/python3.9/site-packages/asitop/parsers.py", line 47, in parse_bandwidth_metrics
bandwidth_metrics_dict["STRM CODEC DCS RD"], bandwidth_metrics_dict["STRM CODEC DCS WR"],
KeyError: 'STRM CODEC DCS RD'

Any suggestions? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.