py-cpuinfo
py-cpuinfo copied to clipboard
get_cpu_info() returns current frequency for both current and maximum frequency
In your bug report please include:
- CPU architecture AMD Ryzen 5 1600X Six-Core Processor
- Operating System openSUSE Tumbleweed 20180212 64bit / Linux 4.15.2-1-default
- Python version Python 2.7.14 (default, Oct 12 2017, 15:50:02) [GCC] on linux2
- Version of py-cpuinfo py-cpuinfo-3.3.0
Redirecting ticket here from downstream https://github.com/nicolargo/glances/issues/1233. When used in glances, values pulled for current CPU frequency and maximum CPU frequency are both current frequency, unlike when run on machines with i5-5600k and i7-2600k, but also happening on AMD FX(tm) - 6300.
python
import cpuinfo cpuinfo.cpuinfo.get_cpu_info() {'count': 12, 'model': 1, 'hz_advertised': '2.4020 GHz', 'family': 23, 'bits': 64, 'brand': 'AMD Ryzen 5 1600X Six-Core Processor', 'vendor_id': 'AuthenticAMD', 'cpuinfo_version': (3, 3, 0), 'flags': ['3dnowprefetch', 'abm', 'adx', 'aes', 'aperfmperf', 'apic', 'arat', 'avic', 'avx', 'avx2', 'bmi1', 'bmi2', 'bpext', 'clflush', 'clflushopt', 'clzero', 'cmov', 'cmp_legacy', 'constant_tsc', 'cpb', 'cpuid', 'cr8_legacy', 'cx16', 'cx8', 'de', 'decodeassists', 'extapic', 'extd_apicid', 'f16c', 'flushbyasid', 'fma', 'fpu', 'fsgsbase', 'fxsr', 'fxsr_opt', 'ht', 'hw_pstate', 'irperf', 'lahf_lm', 'lbrv', 'lm', 'mca', 'mce', 'misalignsse', 'mmx', 'mmxext', 'monitor', 'movbe', 'msr', 'mtrr', 'mwaitx', 'nonstop_tsc', 'nopl', 'npt', 'nrip_save', 'nx', 'osvw', 'overflow_recov', 'pae', 'pat', 'pausefilter', 'pclmulqdq', 'pdpe1gb', 'perfctr_core', 'perfctr_llc', 'perfctr_nb', 'pfthreshold', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdrand', 'rdseed', 'rdtscp', 'rep_good', 'sep', 'sha_ni', 'skinit', 'smap', 'smca', 'sme', 'smep', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'sse4a', 'ssse3', 'succor', 'svm', 'svm_lock', 'syscall', 'tce', 'topoext', 'tsc', 'tsc_scale', 'v_vmsave_vmload', 'vgif', 'vmcb_clean', 'vme', 'vmmcall', 'wdt', 'xgetbv1', 'xsave', 'xsavec', 'xsaveerptr', 'xsaveopt', 'xsaves'], 'raw_arch_string': 'x86_64', 'l2_cache_size': '512 KB', 'stepping': 1, 'hz_actual_raw': (2402046000, 0), 'hz_actual': '2.4020 GHz', 'arch': 'X86_64', 'hz_advertised_raw': (2402046000, 0)} cpuinfo.cpuinfo.get_cpu_info() {'count': 12, 'model': 1, 'hz_advertised': '2.4021 GHz', 'family': 23, 'bits': 64, 'brand': 'AMD Ryzen 5 1600X Six-Core Processor', 'vendor_id': 'AuthenticAMD', 'cpuinfo_version': (3, 3, 0), 'flags': ['3dnowprefetch', 'abm', 'adx', 'aes', 'aperfmperf', 'apic', 'arat', 'avic', 'avx', 'avx2', 'bmi1', 'bmi2', 'bpext', 'clflush', 'clflushopt', 'clzero', 'cmov', 'cmp_legacy', 'constant_tsc', 'cpb', 'cpuid', 'cr8_legacy', 'cx16', 'cx8', 'de', 'decodeassists', 'extapic', 'extd_apicid', 'f16c', 'flushbyasid', 'fma', 'fpu', 'fsgsbase', 'fxsr', 'fxsr_opt', 'ht', 'hw_pstate', 'irperf', 'lahf_lm', 'lbrv', 'lm', 'mca', 'mce', 'misalignsse', 'mmx', 'mmxext', 'monitor', 'movbe', 'msr', 'mtrr', 'mwaitx', 'nonstop_tsc', 'nopl', 'npt', 'nrip_save', 'nx', 'osvw', 'overflow_recov', 'pae', 'pat', 'pausefilter', 'pclmulqdq', 'pdpe1gb', 'perfctr_core', 'perfctr_llc', 'perfctr_nb', 'pfthreshold', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdrand', 'rdseed', 'rdtscp', 'rep_good', 'sep', 'sha_ni', 'skinit', 'smap', 'smca', 'sme', 'smep', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'sse4a', 'ssse3', 'succor', 'svm', 'svm_lock', 'syscall', 'tce', 'topoext', 'tsc', 'tsc_scale', 'v_vmsave_vmload', 'vgif', 'vmcb_clean', 'vme', 'vmmcall', 'wdt', 'xgetbv1', 'xsave', 'xsavec', 'xsaveerptr', 'xsaveopt', 'xsaves'], 'raw_arch_string': 'x86_64', 'l2_cache_size': '512 KB', 'stepping': 1, 'hz_actual_raw': (2402073000, 0), 'hz_actual': '2.4021 GHz', 'arch': 'X86_64', 'hz_advertised_raw': (2402073000, 0)}
Thanks for the bug report. Can you attache the "system_info.txt" generated by this script?
python tools/get_system_info.py
Thanks. I'll look more into this.
I am experiencing the same problem:
- CPU AMD Ryzen 7 1700X Eight-Core Processor (3.4 GHz)
- OS Ubuntu Server 18.04.2 (GNU/Linux 4.15.0-54-generic x86_64)
- Python version Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
- py-cpuinfo version: 5.0.0
- system_info.txt
>>> from cpuinfo import cpuinfo
>>> from pprint import pprint
>>> pprint(cpuinfo.get_cpu_info())
{'arch': 'X86_64',
'bits': 64,
'brand': 'AMD Ryzen 7 1700X Eight-Core Processor',
'count': 16,
'cpuinfo_version': [5, 0, 0],
'extended_family': 8,
'family': 23,
'flags': [...],
'hz_actual': '1.8818 GHz',
'hz_actual_raw': [1881776000, 0],
'hz_advertised': '1.8818 GHz',
'hz_advertised_raw': [1881776000, 0],
'l1_data_cache_size': '32 KB',
'l1_instruction_cache_size': '64 KB',
'l2_cache_associativity': '0x200',
'l2_cache_line_size': 6,
'l2_cache_size': '512 KB',
'l3_cache_size': '512 KB',
'model': 1,
'python_version': '3.6.8.final.0 (64 bit)',
'raw_arch_string': 'x86_64',
'stepping': 1,
'vendor_id': 'AuthenticAMD'}
lscpu | grep MHz shows the following:
CPU MHz: 1897.481
CPU max MHz: 3400.0000
CPU min MHz: 2200.0000
This might be a duplicate of #115 and might have been fixed in version 6.0.0. I no longer have access to a Ryzen CPU, so I cannot confirm that myself, but maybe @all-the-good-ones-are-gone can?