Read core voltage on Linux

I found a way to easily do what the title says in a CLI environment, so make a note

necessary

--Intel CPU Sandy Bridge or later ――Unknown because I haven't investigated anything other than intel

Read

Raw price

sudo rdmsr 0x198 -u --bitfield 47:32

Convert to voltage [V]

awk "BEGIN { print $(sudo rdmsr 0x198 -u --bitfield 47:32)/8192 }"

bcBut it ’s okay,awkI feel that is definitely installed.

Read repeatedly

watch -n 1 'awk "BEGIN { print $(sudo rdmsr 0x198 -u --bitfield 47:32)/8192 }"'

What you are doing

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

Read core voltage on Linux
[C] [python] Read with AquesTalk on Linux
Linux command [read]
Daemonizing processes on Linux
jblas on Arch Linux
Linux (WSL) on Windows
NAT router on Linux
Develop .NET on Linux
Wake on lan on Linux
Monitor traffic on Linux
Update vscode on linux
Try NeosVR on Linux
Check capacity on Linux
LiveUSB creation on Linux
Linux operation on Win10
NTP configuration memo on Linux
Install Minecraft on Arch Linux
Install Linux on your Chromebox
Downgrade Mcomix on Arch Linux
Monitor disk usage on Linux
I read "Linux standard textbook"!
Use Github Desktop on Linux
Install the JDK on Linux
Elixir = Comfortable on Linux Mint
Recording and playback on Linux
Check TTL on Linux router
Put jenv on Amazon Linux
Easy df command on Linux
Linux on Windows -1-: debian introduction
Install tomcat 5.5 on Amazon Linux.
Introducing Elixir on Linux Mint
Use sshpass on Amazon linux2
Install Homebrew on Amazon Linux 2
Paste the link on linux
Install strongSwan 5.9.1 on Amazon Linux 2
Linux environment construction (on WSL environment)
Run FreeBSD on Linux + qemu
Use Linux on Windows 10 (WSL2)
Setting up OpenSSH on Arch Linux
Use host.docker.internal on linux (docker-compose required)
Install Python Pillow on Amazon Linux
Easy copy to clipboard on Linux
Install oracle java8 on amazon linux2
Try installing OpenAM on Amazon Linux
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)
Install CUDA on Linux Mint Mate 20
Install Arch Linux on DeskMini A300
Completion of docker command on Linux
Run a Linux server on GCP
How to install VMware-Tools on Linux
Install pyenv on EC2 (Amazon Linux)
[Linux] I installed CentOS on VirtualBox
Enjoy edge computing on Alpine Linux
Rip Music CDs on Arch Linux
Create a Linux environment on Windows 10
Make Live USB on Alpine Linux
[Linux] Docker environment construction on Redhat
Use Chrome Remote Desktop on Linux
[Note] Install Imagick on Amazon Linux2
[Note] Run Django on Amazon Linux 2
Run docker-compose on Amazon Linux2 on ARM64