【FreeBSD】读取CPU 温度

Posted by 西维蜀黍 on 2021-03-06, Last Modified on 2021-09-21

View

$ sysctl -a | grep temperature
hw.acpi.thermal.tz1.temperature: 29.9C
hw.acpi.thermal.tz0.temperature: 27.9C
dev.cpu.7.temperature: 39.0C
dev.cpu.6.temperature: 39.0C
dev.cpu.5.temperature: 42.0C
dev.cpu.4.temperature: 42.0C
dev.cpu.3.temperature: 49.0C
dev.cpu.2.temperature: 49.0C
dev.cpu.1.temperature: 46.0C
dev.cpu.0.temperature: 46.0C

Launch the temp driver upon boot

The coretemp driver issues the CPU temperature for Intel processors. To load the coretemp driver upon boot, type in the following command:

$ nano /boot/loader.conf

Add the following if you’re using an Intel CPUs:

$ coretemp_load="YES"

And if you’re using an AMD CPU, add:

$ amdtemp_load="YES"

To apply changes, save the file and exit.

You can also load the driver without restarting. Use the command below if you’re using Intel:

$ kldload coretemp

hwstat

$ pkg install hwstat
					Current				Unit
[Coretemp]
	CPU0:				45.0				C
	CPU1:				45.0				C
	CPU2:				40.0				C
	CPU3:				40.0				C
	CPU4:				40.0				C
	CPU5:				40.0				C
	CPU6:				39.0				C
	CPU7:				39.0				C

[ACPI Thermal]
	tz0:				27.9				C

[ACPI Thermal]
	tz1:				29.9				C

Reference