我当前的 linux 有问题,我尝试通过 bash 获取温度的任何方法都不起作用。
我试过 lm-sensors,我得到的只是 gpu temp 和 cpu_fan(错了,总是说 0 RPM) 在/sys/class/thermal 中,内核被命名为 cooling_deviceX,其中没有热信息,只有功率和状态 最后,/proc/acpi,没什么,只是唤醒
我不明白的是它以前可以工作。但自从我上次重新安装以来,什么都没有。
我有一个 Ryzen 7 1700,我正在运行带有自定义编译内核 (4.9.76) 的 mint 18.1,配置是从原始内核导入的。
发生这种情况的原因是什么?
编辑: 我找到了问题的原因,似乎是缺少对 Ryzen 的支持,仅适用于内核 4.11 及更高版本。这解释了为什么它之前有效,因为我使用的是主线 4.15 内核。
最佳答案
这是我用来在 Linux 上获取 CPU 温度的脚本:
T=$(cat /sys/class/thermal/thermal_zone0/temp); echo $(( $T / 1000 ))°C
这对你有用吗?
此外,您可以尝试运行 sudo sensors-detect
:
$ sudo sensors-detect
[sudo] password for brian:
# sensors-detect revision $Revision$
# System: LENOVO 2347G2U [ThinkPad T430] (laptop)
# Kernel: 4.14.11-1-ARCH x86_64
# Processor: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz (6/58/9)
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no):
关于linux - 无法获取cpu温度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48472355/