日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網(wǎng)站首頁 編程語言 正文

Linux命令行查看cpu(lm_sensors)和顯卡溫度(nvidia-smi)的操作方法_linux shell

作者:西京刀客 ? 更新時間: 2023-01-14 編程語言

Linux命令行如何查看cpu和顯卡溫度

lm_sensors,是一款基于linux系統(tǒng)的硬件監(jiān)控的軟件??梢员O(jiān)控主板,CPU的工作電壓,溫度等數(shù)據(jù)。

實際上sensors命令只是讀取了/sys/class/hwmon/目錄下關于CPU等傳感器溫度參數(shù)并直觀的展示給我們,我們不安裝lm_sensors模塊下也可以查看CPU溫度。

在Linux下可以通過lm_sensors來查看CPU的溫度(當然你的硬件首先要支持),且使用這個功能要有內(nèi)核相關模塊(比如I2C)的支持

默認情況下,Ubuntu LInux沒有安裝Lm_Sensors

apt-get install lm-sensors -y
sh -c "yes|sensors-detect"
watch -n 2 sensors

watch保證讀數(shù)每2秒更新一次

使用watch和nvidia-smi:

watch -n 2 nvidia-smi

補充知識點:

linux服務器如何查看cpu溫度,在LINUX下面如何查看CPU的溫度

1.

[root@bogon redmine-3.3.0-0]# cat /proc/acpi/thermal_zone/TZ00/temperature

temperature: ? ? ? ? ? ? 28 C

[root@bogon redmine-3.3.0-0]# cat /proc/acpi/thermal_zone/TZ01/temperature

temperature: ? ? ? ? ? ? 30 C

[root@bogon redmine-3.3.0-0]#

2.

如果沒有安裝就先安裝一下

# yum -y install lm_sensors

檢測傳感器:#?sh -c "yes|sensors-detect"

如果以上步驟沒有問題,執(zhí)行下面的命令就可以查看CPU的溫度了:# sensors

# sensors

acpitz-virtual-0

Adapter: Virtual device

temp1: ? ? ? +27.8°C ?(crit = +105.0°C)

temp2: ? ? ? +29.8°C ?(crit = +105.0°C)

nouveau-pci-0100

Adapter: PCI adapter

temp1: ? ? ? +44.0°C ?(high = +95.0°C, hyst = ?+3.0°C)

(crit = +105.0°C, hyst = ?+5.0°C)

coretemp-isa-0000

Adapter: ISA adapter

Physical id 0: +39.0°C ?(high = +80.0°C, crit = +100.0°C)

Core 0: ? ? ? ?+33.0°C ?(high = +80.0°C, crit = +100.0°C)

Core 1: ? ? ? ?+35.0°C ?(high = +80.0°C, crit = +100.0°C)

Core 2: ? ? ? ?+36.0°C ?(high = +80.0°C, crit = +100.0°C)

Core 3: ? ? ? ?+39.0°C ?(high = +80.0°C, crit = +100.0°C)

CentOS下如何查看自己本本的 CPU 和 GPU 的溫度及 Fan(風扇) 的轉速操作如下:

1、安裝 lm_sensors 軟件包 (如果已安裝了此軟件了,1和2步都跳過吧):$ sudo yum install lm_sensors

$ sudo apt-get install lm_sensors

2、手動配置下(一路yes或enter就行了):$ sudo sensors-detect

3、最后打開終端輸入:$ sensors

這樣就輸出各傳感器的溫度及風扇轉速了

原文鏈接:https://blog.csdn.net/inthat/article/details/128324752

欄目分類
最近更新