I found a way to easily do what the title says in a CLI environment, so make a note
--Intel CPU Sandy Bridge or later ――Unknown because I haven't investigated anything other than intel
`/ dev / cpu / * / msr``` does not exist, load it with`
modprobe msr```sudo rdmsr 0x198 -u --bitfield 47:32
awk "BEGIN { print $(sudo rdmsr 0x198 -u --bitfield 47:32)/8192 }"
bc
But it ’s okay,awk
I feel that is definitely installed.
watch -n 1 'awk "BEGIN { print $(sudo rdmsr 0x198 -u --bitfield 47:32)/8192 }"'
The address 0x198 of the CPU's Model Specific Register (MSR) register is named MSR_PERF_STATUS
and the core voltage is stored in bit [47:32]. Read this with the rdmsr
command and convert it for readability.
According to the manual
P-state core voltage can be computed by MSR_PERF_STATUS[37:32] * (float) 1/(2^13).
So, I divide the read value by 8192. (↑ [37:32], but maybe a typo)
--Instruction: Intel 64 and IA-32 Architectures Software Developer ’s Manual - https://software.intel.com/content/www/us/en/develop/download/intel-64-and-ia-32-architectures-software-developers-manual-volume-4-model-specific-registers.html
However, the definition of the [47:32] bit of this register is only in Table 2-20 of Sandy Bridge, and there is no description for other generations. According to the manual, MSR_hoge is defined for each generation, so it may be overwritten. In fact, in the Core generation (such as core2duo), bits [46,44:40] have different definitions.
I investigated whether the value is guaranteed when reading this with a CPU of the generation after Sandy Bridge, but I was not sure because the interpretation was broken. However, there is no overwrite definition. I can read that kind of value on my Kaby Lake.
Please let me know if there is a more reliable method.
Recommended Posts