New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return number of numa nodes #1610
Comments
It would be nice to also have physical CPU count, since the code to do this on Windows is rather gnarly and requires dropping to |
Back to the original request: is there an actual use case for NUMA nodes or it would just be for display (e.g. task manager apps)? Also, what do you mean by |
@giampaolo that is physical core count, I’m meaning actual CPU/socket count. |
Oh! Socket count. Mmm... That sounds sort of low levelish (would it really be useful?). Does Windows provide an API for this? I'm not sure we can support other platforms other than Windows. Also (perhaps a personal consideration): the definition of what a CPU count really means is a bit confusing. The definition I ad-here to is this:
psutil currently supports 2 and 3. |
if you have more than 64 logical cpus, windows will put them on different groups, as an affinity mask is 64 bits (so you can only turn on and off 64 cpus). Knowing the group_count on windows is useful. More useful is the total logical cpus in all numa nodes, IIRC cpu_count() only return the number of logical cpu on the first numa node. |
Are you sure? On Windows cpu_logical() is implemented by using psutil/psutil/arch/windows/cpu.c Line 24 in 9e2ca97
As for NUMA: I'm no expert. Is it something which exists in Windows only? |
One small note on NUMA nodes, it's not equal to socket count, e.g. 2x AMD EPYC 7601:
And it depends on BIOS settings (Node Interleaving and a few more options for AMD CPUs). In Linux you can get the info from sysfs:
|
Closing as duplicate of #1392. |
Add a function like cpu_count but numa_count(), and on windows also a groups_count() could be very handy.
The text was updated successfully, but these errors were encountered: