Skip to content
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

Wrong processors count reporting 64 instead of 80 #90

Open
gdelfino opened this issue Jan 26, 2018 · 3 comments
Open

Wrong processors count reporting 64 instead of 80 #90

gdelfino opened this issue Jan 26, 2018 · 3 comments

Comments

@gdelfino
Copy link

I am getting the wrong value here:

>>> import cpuinfo
>>> cpuinfo.get_cpu_info()["count"]
64

The correct value is 80 and can be obtained with PowerShell:

Get-WmiObject -class Win32_Processor | Select-Object -ExpandProperty NumberOfLogicalProcessors | Measure-Object -Sum | Select -Expand Sum
80

The specs of the machine are:

  • Operating System: Windows Server 2012 R2
  • Python version: 3.6.4
  • Version of py-cpuinfo: 3.3.0
PS C:\Users\DelfinoG> Get-WmiObject -class Win32_Processor | Select-Object Caption,DeviceID,Manufacturer,Name,NumberOfCo
res,NumberOfLogicalProcessors


Caption                   : Intel64 Family 6 Model 85 Stepping 4
DeviceID                  : CPU0
Manufacturer              : GenuineIntel
Name                      : Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
NumberOfCores             : 20
NumberOfLogicalProcessors : 40

Caption                   : Intel64 Family 6 Model 85 Stepping 4
DeviceID                  : CPU1
Manufacturer              : GenuineIntel
Name                      : Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
NumberOfCores             : 20
NumberOfLogicalProcessors : 40

Any workaround to get that 80 from Python directly?

@gdelfino gdelfino changed the title Wrong processors count reporitn 64 instead of 80 Wrong processors count reporting 64 instead of 80 Jan 26, 2018
@workhorsy workhorsy added the bug label Jan 27, 2018
@workhorsy
Copy link
Owner

Right now I am using multiprocessing to get the cpu count:

import multiprocessing
print(multiprocessing.cpu_count())

I'll have to look at other ways to do it more accurately:
https://stackoverflow.com/questions/1006289/how-to-find-out-the-number-of-cpus-using-python/

It would also be nice to have the number of physical or virtual cores:
#7

@workhorsy
Copy link
Owner

This bug has more information on the problem:
https://bugs.python.org/issue30581

@kShines
Copy link

kShines commented Feb 11, 2022

Hello,I had the same problem on windows, but not on linux, @gdelfino have you solved this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants