workhorsy / py-cpuinfo

A module for getting CPU info with pure Python
MIT License
312 stars 59 forks source link

Add Apple Silicon support #162

Open bobrik opened 3 years ago

bobrik commented 3 years ago

161 fixes a crash and a test, but it would be nice to have actual support for Apple Silicon.

$ sysctl machdep.cpu
machdep.cpu.cores_per_package: 8
machdep.cpu.core_count: 8
machdep.cpu.logical_per_package: 8
machdep.cpu.thread_count: 8
machdep.cpu.brand_string: Apple M1
chadbrewbaker commented 2 years ago

This is also barfing under docker. Anyone able to dump /proc/cpuinfo under Ashanti Linux? Based on that it should be a lookup table keyed by machdep.cpu.brand_string.

thomwiggers commented 1 year ago

https://github.com/Dr-Noob/cpufetch/issues/139 contains some information about what sysctl outputs; it seems the cpu flags are fetched differently.