tlkh / asitop

Perf monitoring CLI tool for Apple Silicon
https://tlkh.github.io/asitop/
MIT License
3.36k stars 147 forks source link

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

Open clstaudt opened 10 months ago

clstaudt commented 10 months ago
➤ 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'
conornash commented 5 months ago

Instead of running asitop, try running sudo asitop. This fixed the issue for me.