py-cpuinfo
py-cpuinfo copied to clipboard
incomplete list of flags on windows / msys2 python distribution.
- CPU architecture : ivy bridge
- Operating System : Windows + msys2
- Python version : wrong: 3.8.5.final.0 (64 bit) (msys2 distribution) good: 3.8.2.final.0 (64 bit) (from python.org)
- Version of py-cpuinfo: 7.0.0
The flags returned on this system are incomplete (only up to sse2, i.e. missing things like sse4_2), depending on the python installation used.
wrong:
{'python_version': '3.8.5.final.0 (64 bit)', 'cpuinfo_version': [7, 0, 0], 'cpuinfo_version_string': '7.0.0', 'arch': 'X86_64', 'bits': 64, 'count': 8, 'arch_string_raw': 'AMD64', 'vendor_id_raw': 'GenuineIntel', 'brand_raw': 'Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz', 'hz_advertised_friendly': '3.5000 GHz', 'hz_actual_friendly': '3.5010 GHz', 'hz_advertised': [3500000000, 0], 'hz_actual': [3501000000, 0], 'l2_cache_size': 1048576, 'stepping': 9, 'model': 58, 'family': 6, 'l3_cache_size': 8388608, 'flags': ['3dnow', 'clflush', 'cmov', 'de', 'dts', 'fxsr', 'ia64', 'mca', 'mce', 'mmx', 'mtrr', 'pse', 'sep', 'serial', 'ss', 'sse', 'sse2', 'tm']}
good:
{'python_version': '3.8.2.final.0 (64 bit)', 'cpuinfo_version': [7, 0, 0], 'cpuinfo_version_string': '7.0.0', 'arch': 'X86_64', 'bits': 64, 'count': 8, 'arch_string_raw': 'AMD64', 'vendor_id_raw': 'GenuineIntel', 'brand_raw': 'Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz', 'hz_advertised_friendly': '3.5000 GHz', 'hz_actual_friendly': '3.5010 GHz', 'hz_advertised': [3500000000, 0], 'hz_actual': [3501000000, 0], 'l2_cache_size': 1048576, 'stepping': 9, 'model': 58, 'family': 6, 'l3_cache_size': 8388608, 'flags': ['3dnow', 'acpi', 'aes', 'apic', 'avx', 'clflush', 'cmov', 'cx16', 'cx8', 'de', 'dts', 'erms', 'est', 'f16c', 'fpu', 'fxsr', 'ht', 'hypervisor', 'ia64', 'lahf_lm', 'mca', 'mce', 'mmx', 'msr', 'mtrr', 'osxsave', 'pae', 'pat', 'pbe', 'pcid', 'pclmulqdq', 'pdcm', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdrnd', 'sep', 'serial', 'smep', 'ss', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3', 'tm', 'tm2', 'tsc', 'vme', 'xsave', 'xtpr'], 'l2_cache_line_size': 256, 'l2_cache_associativity': 6}
I've tried to have a look at how cpuinfo works, and looked at cpuinfo.CPUID().get_flags(8)
which behaves differently:
>>> cpuinfo.CPUID().get_flags(8)
['acpi', 'aes', 'apic', 'avx', 'clflush', 'cmov', 'cx16', 'cx8', 'de', 'erms', 'est', 'f16c', 'fpu', 'fxsr', 'ht', 'hypervisor', 'mca', 'mce', 'mmx', 'msr', 'mtrr', 'osxsave', 'pae', 'pat', 'pbe', 'pcid', 'pclmulqdq', 'pdcm', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdrnd', 'sep', 'smep', 'ss', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3', 'tm', 'tm2', 'tsc', 'vme', 'xsave', 'xtpr']
vs.
>>> cpuinfo.CPUID().get_flags(8)
Segmentation fault
I'm not sure the issue is in cpuinfo or the python distribution, but any workaround would be greatly appreciated.
This is being discussed here https://github.com/glinscott/fishtest/pull/738#issuecomment-667657620
I've never tried py-cpuinfo on msys2. I'll see if I can get it working.