Improving MacOS M1 CPU/GPU prints
Description
Adding better support for Apple Silicon (M1) CPU and GPU prints OLD:
CPU: Apple M1 Max
GPU: Apple M1 Max
NEW:
CPU: Apple M1 Max (10)
GPU: Apple M1 Max (24)
This is accurate for me as I have the 10c CPU and 24c GPU model
Features
- Fix core-count not displaying on Apple Silicon (M1) devices (arm64)
- Add GPU core count for Apple Silicon (M1) devices
Issues
TODO
(Although… for "GPU", I just see GPU: Apple M1 Max by default. Is there an option to test GPU core counts?)
Hmm... Interesting, it works for me to highlight the core count. You should be able to run this simple command and see what your machine returns:
chipset=$(system_profiler SPDisplaysDataType | awk '/Chipset Model/ { printf "%s %s %s", $3, $4, $5 }') && cores=$(system_profiler SPDisplaysDataType | awk '/Total Number of Cores/ { printf "%d", $5 }') && gpu="${chipset} (${cores})" && echo $gpu
For me, this returns Apple M1 Max (24)
Once this (pretty heavy) command gets run the first time, it gets cached into /Library/Caches/neofetch/gpu so the command doesn't need to be run again. So also try deleting this file and running ./neofetch again :)
Once this (pretty heavy) command gets run the first time, it gets cached into
/Library/Caches/neofetch/gpuso the command doesn't need to be run again. So also try deleting this file and running./neofetchagain :)
Re-tested just now and this works great. Seems like the cache ought to be invalidated automatically in some cases (the neofetch script timestamp is greater than the cached value, so bugfixes actually take effect?) but I do in fact have 32 GPU cores:
Thank you for your contribution!
This PR is merged into hyfetch since this repo (dylanaraps/neofetch) seems no longer maintained.
HyFetch is a fork of neofetch with LGBTQ pride flags, but the repo also maintains an updated version of the original neofetch, addressing many pull requests that are not merged in the original repo.
Read the "Running Updated Original Neofetch" section for more info!
For some reason this is not working in my Mac :(
Any idea why I'm not seeing core count?