Nouveau: Get GPU temperature and fan speed from commandline

Noveau doesn’t require additional tools for accessing to GPU temperature and fan speed info. All the information can be obtained from its module.

Getting temperature and fan speed info with nouveau

First, make sure that nouveau is loaded in the system:

lsmod | grep nouveau
...
nouveau              2162688  4

Nouveau provides information about GPU to the kernel, we can get this info in /sys/. But first we need to find out where are sensor files. Use the following command:

sudo find /sys/ -name hwmon
...
/sys/class/hwmon
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon

There are may be more hwmon directories, depending which hardware and kernel modules you are using. But we are interested in PCI hwmon’s because NVIDIA GPU is usually connected via PCI interface on motherboard.

There are symlinks in /sys/class/hwmon/ to the same directories, it is shorter and faster:

ls -l /sys/class/hwmon/
...
hwmon0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon0

Go to this directory and check for content:

cd /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon0        # OR simply cd /sys/class/hwmon/hwmon0
ls
...
temp1_input    fan1_input        # There are a lot of files, but these two in which we are interested

The first file contains current GPU temperature. It’s value multiplied by 1000, so don’t be scared. 53000 / 1000 = 53℃:

cat temp1_input
...
53000    # 53000 / 1000 = 53℃

The second file contains current fan speed. It’s value presented in RPM (Round per minute):

cat fan1_input
...
3870   # Rounds per minute. The fan on my GPU is small in size therefore it's such fast

Leave a Reply

Your email address will not be published.