py-cpuinfo icon indicating copy to clipboard operation
py-cpuinfo copied to clipboard

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

Open gMan1990 opened this issue 5 years ago • 8 comments
trafficstars

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.

gMan1990 avatar May 19 '20 10:05 gMan1990

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

workhorsy avatar May 20 '20 02:05 workhorsy

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

gMan1990 avatar May 20 '20 03:05 gMan1990

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

python tools/get_system_info.py

workhorsy avatar May 23 '20 15:05 workhorsy

@workhorsy

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

gMan1990 avatar May 24 '20 00:05 gMan1990

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 avatar Jun 11 '20 10:06 workhorsy

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

workhorsy avatar Jul 16 '20 21:07 workhorsy

@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 avatar Jul 17 '20 01:07 gMan1990

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

workhorsy avatar Jul 23 '20 23:07 workhorsy