How can the L3 cache size of a CPU be found using Python running on a Windows system?
Tried py-cpuinfo but it only outputs the L2 cache info, not L3.
import cpuinfo
print cpuinfo.get_cpu_info()
Output
{'count': 12, 'l2_cache_line_size': 6L, 'hz_advertised': '3.5000 GHz', 'bits': 64, 'brand': u'Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz', 'vendor_id': u'GenuineIntel', 'cpuinfo_version': (3
, 3, 0), 'flags': ['3dnow', 'acpi', 'clflush', 'cmov', 'de', 'dts', 'fxsr', 'ia64', 'mca', 'mce', 'mmx', 'msr', 'mtrr', 'pse', 'sep', 'serial', 'ss', 'sse', 'sse2', 'tm', 'tsc'], 'raw_arch
_string': 'AMD64', 'l2_cache_size': 64L, 'l2_cache_associativity': '0x100L', 'hz_actual_raw': (3500000000L, 0), 'hz_actual': '3.5000 GHz', 'arch': 'X86_64', 'hz_advertised_raw': (350000000
0L, 0)}
py-cpuinfo, and it appears the author gets L2 cache info himself by running assembly instructions usingctypes. Might be worth investing adding L3 cache retrieval as a patch topy-cpuinfo, building on top of its nifty classes?py-cpuinfo. In the meantime, launchingwmic cpu get L3CacheSizein a separate process and reading the result should work well on Windows.