Ubuntu 16.04 LTS Desktop 壁紙

UbuntuでCPU温度や電圧、ファンの回転数を表示する方法についての覚え書き。

 

 

環境

Desktop (Ubuntu 16.04)

方法1: sysfs

標準の環境でも確認できるお手軽な方法。

# 温度を表示
$ cat /sys/class/thermal/thermal_zone0/temp
26792 # 26.792度

方法2: lm-sensors

lm-sensorsコマンドを利用すると詳細な情報を取得できる。

sensors-detectは基本的にエンターキーを押して標準の設定で適用していく。

ただし、/etc/modules に自動で追記しますかと尋ねられる際は yes を入力して追記してもらう。

また、etc/init.d/kmod start を実行しするようにいわれるのでそのとおりに実行する。

# パッケージの更新
$ sudo apt update
$ sudo apt -y upgrade

# lm-sensorのインストール
$ sudo apt install lm-sensors

# センサーの検出と設定
$ sudo sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# Board: ASRock Z97 Extreme4
# Kernel: 4.4.0-112-generic x86_64
# Processor: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (6/60/3)

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): 
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): 
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               Yes
Found `Nuvoton NCT6791D Super IO Sensors'                   Success!
    (address 0x290, driver `nct6775')
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      NoSome systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): 
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): 

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): 
Found unknown SMBus adapter 8086:8ca2 at 0000:00:1f.3.
Sorry, no supported PCI bus adapters found.

Next adapter: i915 gmbus ssc (i2c-0)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: i915 gmbus vga (i2c-1)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: i915 gmbus panel (i2c-2)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: i915 gmbus dpc (i2c-3)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: i915 gmbus dpb (i2c-4)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: i915 gmbus dpd (i2c-5)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: DPDDC-C (i2c-6)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: NVIDIA i2c adapter 0 at 1:00.0 (i2c-7)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: NVIDIA i2c adapter 2 at 1:00.0 (i2c-8)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: NVIDIA i2c adapter 6 at 1:00.0 (i2c-9)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: NVIDIA i2c adapter 7 at 1:00.0 (i2c-10)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: NVIDIA i2c adapter 8 at 1:00.0 (i2c-11)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: NVIDIA i2c adapter 11 at 1:00.0 (i2c-12)
Do you want to scan it? (yes/NO/selectively): 


Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `coretemp':
  * Chip `Intel digital thermal sensor' (confidence: 9)

Driver `nct6775':
  * ISA bus, address 0x290
    Chip `Nuvoton NCT6791D Super IO Sensors' (confidence: 9)

To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
coretemp
nct6775
#----cut here----
If you have some drivers built into your kernel, the list above will
contain too many modules. Skip the appropriate ones!

Do you want to add these lines automatically to /etc/modules? (yes/NO)yes
Successful!

Monitoring programs won't work until the needed modules are
loaded. You may want to run '/etc/init.d/kmod start'
to load them.

$ /etc/init.d/kmod start 
[ ok ] Starting kmod (via systemctl): kmod.service.

# センサーの情報取得
$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +23.0°C  (high = +80.0°C, crit = +100.0°C)
Core 0:         +22.0°C  (high = +80.0°C, crit = +100.0°C)
Core 1:         +21.0°C  (high = +80.0°C, crit = +100.0°C)
Core 2:         +22.0°C  (high = +80.0°C, crit = +100.0°C)
Core 3:         +23.0°C  (high = +80.0°C, crit = +100.0°C)

設定を完了した後、sensorsコマンドを実行するとコア別にCPU温度を取得することができる。

設定変更

sensorsコマンドは本来、マザーボードの電圧や温度、ファンの回転数なども取得できる。

同じような問題に関する質問と回答を見つけたのでそちらを参考に設定を変更する。

14.04 – Can’t get the right CPUcore temperature (Acpi chip) – Ask Ubuntu

# 設定に追記
$ sudo vi /etc/default/grub
GRUB_CMDLINE_LINUX='acpi_enforce_resources=lax'

# 設定反映・再起動
$ sudo update-grub
$ sudo reboot

# センサー情報を取得
$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +25.0°C  (high = +80.0°C, crit = +100.0°C)
Core 0:         +22.0°C  (high = +80.0°C, crit = +100.0°C)
Core 1:         +21.0°C  (high = +80.0°C, crit = +100.0°C)
Core 2:         +25.0°C  (high = +80.0°C, crit = +100.0°C)
Core 3:         +28.0°C  (high = +80.0°C, crit = +100.0°C)

nct6791-isa-0290
Adapter: ISA adapter
Vcore:                  +0.90 V  (min =  +0.00 V, max =  +1.74 V)
in1:                    +1.70 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:                   +3.28 V  (min =  +2.98 V, max =  +3.63 V)
+3.3V:                  +3.28 V  (min =  +2.98 V, max =  +3.63 V)
in4:                    +1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                    +1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                    +0.69 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
3VSB:                   +3.44 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:                   +3.25 V  (min =  +2.70 V, max =  +3.63 V)
in9:                    +1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                   +0.00 V  (min =  +0.00 V, max =  +0.00 V)
in11:                   +1.01 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                   +1.20 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                   +0.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                   +0.19 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                     0 RPM  (min =    0 RPM)
fan2:                  1506 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                     0 RPM  (min =    0 RPM)
fan5:                     0 RPM  (min =    0 RPM)
fan6:                     0 RPM
SYSTIN:                 +20.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = thermistor
CPUTIN:                 +77.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                +15.5°C    sensor = thermistor
AUXTIN1:               -128.0°C    sensor = thermistor
AUXTIN2:                +26.0°C    sensor = thermistor
AUXTIN3:               +109.0°C    sensor = thermistor
PECI Agent 0:           +24.5°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +100.0°C)
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C  
PCH_CHIP_TEMP:           +0.0°C  
PCH_CPU_TEMP:            +0.0°C  
intrusion0:            ALARM
intrusion1:            ALARM
beep_enable:           disabled

設定を変更、再起動後にsensorsコマンドを実行すると前回よりも多くの情報を取得できた。

 

【Linux】UbuntuでCPU温度や電圧、ファンの回転数を表示する
Tagged on:     

コメントを残す