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

Exception: py-cpuinfo currently only works on X86 and some PPC and ARM CPUs. #141

Open
gMan1990 opened this issue May 19, 2020 · 8 comments

Comments

@gMan1990
Copy link

gMan1990 commented May 19, 2020

In your bug report please include:

  • Python 3.7.7
  • py-cpuinfo 5.0.0
Host Name:                 WIN-45DJEBK8RU0
OS Name:                   Microsoft Windows Server 2016 Datacenter
OS Version:                10.0.14393 N/A Build 14393
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Server
OS Build Type:             Multiprocessor Free
Registered Owner:          N/A
Registered Organization:   N/A
Product ID:                00377-90926-43858-AA233
Original Install Date:     2019/8/13, 13:34:51
System Boot Time:          2020/5/18, 13:40:55
System Manufacturer:       HP
System Model:              ProLiant DL580 G7
System Type:               x64-based PC
Processor(s):              4 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 47 Stepping 2 GenuineIntel ~1866 Mhz
                           [02]: Intel64 Family 6 Model 47 Stepping 2 GenuineIntel ~1866 Mhz
                           [03]: Intel64 Family 6 Model 47 Stepping 2 GenuineIntel ~1866 Mhz
                           [04]: Intel64 Family 6 Model 47 Stepping 2 GenuineIntel ~1866 Mhz
BIOS Version:              HP P65, 2012/12/3
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             zh-cn;Chinese (China)
Input Locale:              zh-cn;Chinese (China)
Time Zone:                 (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi
Total Physical Memory:     131,062 MB
Available Physical Memory: 125,407 MB
Virtual Memory: Max Size:  150,518 MB
Virtual Memory: Available: 141,862 MB
Virtual Memory: In Use:    8,656 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\WIN-45DJEBK8RU0
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes

Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\Python37\lib\runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\Program Files\Python37\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\Program Files\Python37\lib\site-packages\cpuinfo\__init__.py", line 7, in <module>
    from cpuinfo.cpuinfo import *
  File "C:\Program Files\Python37\lib\site-packages\cpuinfo\cpuinfo.py", line 2257, in <module>
    _check_arch()
  File "C:\Program Files\Python37\lib\site-packages\cpuinfo\cpuinfo.py", line 232, in _check_arch
    raise Exception("py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.")
Exception: py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.
@workhorsy
Copy link
Owner

Can you tell me the output of:

import platform
print(platform.machine())

Can you also attach the "system_info.txt" file generated by this script?

python tools/get_system_info.py

@gMan1990
Copy link
Author

Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.machine()
'AMD64'
>>>

WX20200520-113041@2x

@workhorsy
Copy link
Owner

Can you also attach the "system_info.txt" file generated by this script?

python tools/get_system_info.py

@gMan1990
Copy link
Author

gMan1990 commented May 24, 2020

@workhorsy

  1. system_info.txt
  2. append Traceback, see comment-1

@workhorsy
Copy link
Owner

It looks like platform.machine is returning invalid results for you. In both cpuinfo.py and the get_system_info.py platform.machine should be returning something like "AMD64". Instead it is returning "" or None. Do you know why this would be changed on your machine?

@workhorsy
Copy link
Owner

Did this solve your problem? Or do you need more help?

@gMan1990
Copy link
Author

gMan1990 commented Jul 17, 2020

@workhorsy ok, I maybe know this problem.

  1. install python in windows (and pip, py-cpuinfo)
    • add python to PATH
  2. install cygwin in windows
    • install python37-pip in cygwin (and py-cpuinfo)
    • install openssh in cygwin
  3. open cygwin and run /usr/sbin/sshd
  4. connect it with ssh
> type python
python is /cygdrive/c/Program Files/Python37/python
> python -m cpuinfo
Traceback (most recent call last):

> type python3.7
python3.7 is /bin/python3.7
> python3.7 -m cpuinfo
Python Version: 3.7.7.final.0 (64 bit)
Cpuinfo Version: (5, 0, 0)
Vendor ID: GenuineIntel
Hardware Raw:
Brand: Intel(R) Xeon(R) CPU E7- 4807  @ 1.87GHz
Hz Advertised: 1.8700 GHz
Hz Actual: 1.8700 GHz
Hz Advertised Raw: (1870000000, 0)
Hz Actual Raw: (1870000000, 0)
Arch: X86_64
Bits: 64
Count: 48
Raw Arch String: x86_64
L1 Data Cache Size:
L1 Instruction Cache Size:
L2 Cache Size:
L2 Cache Line Size:
L2 Cache Associativity:
L3 Cache Size: 18432 KB
Stepping: 2
Model: 47
Family: 6
Processor Type:
Extended Model:
Extended Family:
Flags: acpi, aes, aperfmperf, apic, arat, clflush, cmov, cx16, cx8, dca, de, ds_cpl, dtes64, dtherm, dts, epb, est, fpu, fxsr, ht, lahf_lm, mca, mce, mmx, monitor, msr, mtrr, pae, pat, pbe, pcid, pclmuldq, pdcm, pge, pni, popcnt, pse, pse36, sep, smx, ss, sse, sse2, sse4_1, sse4_2, ssse3, tm, tm2, tsc, vme, vmx, x2apic, xtpr
  1. open cmd/cygwin and run python -m cpuinfo is ok
Python Version: 3.7.7.final.0 (64 bit)
Cpuinfo Version: (5, 0, 0)
Vendor ID: GenuineIntel
Hardware Raw:
Brand: Intel(R) Xeon(R) CPU E7- 4807  @ 1.87GHz
Hz Advertised: 1.8700 GHz
Hz Actual: 1.8660 GHz
Hz Advertised Raw: (1870000000, 0)
Hz Actual Raw: (1866000000, 0)
Arch: X86_64
Bits: 64
Count: 64
Raw Arch String: AMD64
L1 Data Cache Size:
L1 Instruction Cache Size:
L2 Cache Size: 1536 KB
L2 Cache Line Size: 6
L2 Cache Associativity: 0x100
L3 Cache Size: 18432 KB
Stepping: 2
Model: 47
Family: 6
Processor Type:
Extended Model: 2
Extended Family:
Flags: acpi, aes, apic, clflush, cmov, cx16, cx8, dca, de, ds_cpl, dtes64, dts, est, fpu, fxsr, ht, ia64, lahf_lm, mca, mce, mmx, monitor, msr, mtrr, pae, pat, pbe, pcid, pclmulqdq, pdcm, pge, pni, popcnt, pse, pse36, sep, serial, smx, ss, sse, sse2, sse4_1, sse4_2, ssse3, tm, tm2, tsc, vme, vmx, x2apic, xtpr
  1. but one is Count: 48 and another is Count: 64, I only have 48 counts.

@gMan1990 gMan1990 reopened this Jul 17, 2020
@workhorsy
Copy link
Owner

The wrong CPU core count looks like a duplicate of #90 .

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

2 participants