You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a generic / exploration ticket, currently useful only for collecting information on how to get CPU info on different platforms, and which I will update from time to time. The idea is to provide a psutil.cpu_info() API returning a dict (EDIT or namedtuple?) with variable keys, depending on what's available. By observing lscpu output on Linux, the idea is to have something roughly like this:
Note that the information re. the number of cores/sockets, etc. intersect with another proposal I made in #1392 (comment), where I (roughly) suggest a re-adaptation of psutil's cpu_count() API. That must be taken info consideration as possibly we would end up with 2 ways of doing the same thing, but cpu_count() should be preferred as "more standard":
The number of CPU types is not strictly related with this proposal though. The point of cpu_info() is the provide more "human readable", non-strictly-standardized information.
Minimum information
According to lscpu on Linux and sysctl.h on macOS, it seems to me the bare minimum info we should provide on all platforms should be the following (but didn't check Windows yet):
in case there's more than 1 physical CPU on the system, the API may return a list of dicts (cpu_info(percpu=True)), but that would be a mess in terms of implementation and probably not portable, so it should not be supported.
The text was updated successfully, but these errors were encountered:
This is a generic / exploration ticket, currently useful only for collecting information on how to get CPU info on different platforms, and which I will update from time to time. The idea is to provide a
psutil.cpu_info()
API returning a dict (EDIT or namedtuple?) with variable keys, depending on what's available. By observinglscpu
output on Linux, the idea is to have something roughly like this:Note that the information re. the number of cores/sockets, etc. intersect with another proposal I made in #1392 (comment), where I (roughly) suggest a re-adaptation of psutil's
cpu_count()
API. That must be taken info consideration as possibly we would end up with 2 ways of doing the same thing, butcpu_count()
should be preferred as "more standard":The number of CPU types is not strictly related with this proposal though. The point of
cpu_info()
is the provide more "human readable", non-strictly-standardized information.Minimum information
According to
lscpu
on Linux and sysctl.h on macOS, it seems to me the bare minimum info we should provide on all platforms should be the following (but didn't check Windows yet):Platform notes / implementations
Linux
cat /proc/cpuinfo
outputlscpu
outputlscpu -J
(JSON) output, in case we'll end up parsing it (likely)macOS
sysctl -a | grep machdep.cp
output:Windows
TODO
FreeBSD
cpuid
command (https://github.com/X0rg/CPU-X/)cpu-x
commandOther platforms
Considerations / open questions
cpu_info(percpu=True)
), but that would be a mess in terms of implementation and probably not portable, so it should not be supported.The text was updated successfully, but these errors were encountered: