# [amdgpu] Is there a way to read AMD GPU's temperatures and/or power usage ?



## thegoldgoat (Jul 19, 2020)

Hello everyone,

I wanted to know if there's any way I could read my GPU's temperature and its power usage - which I can do on Linux using lm_sensors

I have an RX 580, if that matters (?)


----------



## GoNeFast_01 (Aug 17, 2020)

I put a new thread regarding cooling in AMD Ryzen CPU and how to find temp on NVIDIA GPU in Freebsd but I can't do much for AMD GPU don't own any, try to read my solution in nvidia I am sure that AMD has something in here:
x11-drivers/xf86-video-amdgpu


----------



## Argentum (Aug 19, 2020)

thegoldgoat said:


> Hello everyone,
> 
> I wanted to know if there's any way I could read my GPU's temperature and its power usage - which I can do on Linux using lm_sensors
> 
> I have an RX 580, if that matters (?)



I have RX 570 in my desktop machine. To see what the GPU is doing I have installed sysutils/radeontop, but it does not show temperature. The output looks like this:


----------



## judd (Aug 19, 2020)

ipmitool

# ipmitool sensor


```
ATX+5VSB         | 5.070      | Volts      | ok    | 4.230     | 4.710     | na        | na        | 5.550     | 5.610 
+3VSB            | 3.500      | Volts      | ok    | 2.780     | 2.820     | na        | na        | 3.660     | 3.680 
Vcore            | 0.830      | Volts      | ok    | 0.540     | 0.560     | 0.600     | 1.490     | 1.560     | 1.640 
VCCM             | 1.350      | Volts      | ok    | 1.090     | 1.120     | na        | na        | 1.720     | 1.750 
+1.1             | 1.090      | Volts      | ok    | 0.850     | 0.890     | 0.940     | 1.150     | 1.210     | 1.270 
+1.0             | 1.020      | Volts      | ok    | 0.850     | 0.890     | 0.940     | 1.150     | 1.210     | 1.270 
BAT              | 3.200      | Volts      | ok    | 2.380     | 2.500     | na        | na        | 3.580     | 3.680 
+3V              | 3.300      | Volts      | ok    | 2.780     | 2.820     | na        | na        | 3.660     | 3.680 
+5V              | 5.010      | Volts      | ok    | 4.230     | 4.710     | na        | na        | 5.550     | 5.610 
+12V             | 12.200     | Volts      | ok    | 10.100    | 10.300    | na        | na        | 13.300    | 13.400
CPU_FAN1         | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na   
REAR_FAN1        | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na   
FRNT_FAN1        | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na   
FRNT_FAN2        | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na   
REAR_FAN2        | 1200.000   | RPM        | ok    | na        | na        | 100.000   | na        | na        | na   
CPU_FAN2         | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na   
MB Temperature   | 55.000     | degrees C  | ok    | na        | na        | na        | 80.000    | na        | na   
CPU Temperature  | 52.000     | degrees C  | ok    | na        | na        | na        | 80.000    | 85.000    | 90.00
```


% man 8 sysctl

% man 4 amdtemp → AMD

% man 4 coretemp → INTEL

Source.


----------



## thegoldgoat (Aug 22, 2020)

judd said:


> ipmitool
> 
> # ipmitool sensor
> 
> ...



Looks like this one is for AMD CPUs, but I own an Intel one. Thanks anyway!


----------



## thegoldgoat (Aug 22, 2020)

Argentum said:


> I have RX 570 in my desktop machine. To see what the GPU is doing I have installed sysutils/radeontop, but it does not show temperature. The output looks like this:
> 
> View attachment 8305


That was promising, unfortunately it doesn’t show the 2 exact things I was looking for - temperature & wattage. Thanks anyway


----------



## George (Aug 22, 2020)

I have an intel card as well..  But for amd gpus, there is either radeonkms or amdgpu. Not sure which one your card needs. You can just install the graphics/drm-kmod port, load it, and look at `kldstat`.

I would then look whether these drivers have a `sysctl` that shows the gpu temperature. If not, one might want to look at the source code. Maybe there are some ioctls to show the temperature.


----------



## thegoldgoat (Aug 22, 2020)

Elazar said:


> I have an intel card as well..  But for amd gpus, there is either radeonkms or amdgpu. Not sure which one your card needs. You can just install the graphics/drm-kmod port, load it, and look at `kldstat`.
> 
> I would then look whether these drivers have a `sysctl` that shows the gpu temperature. If not, one might want to look at the source code. Maybe there are some ioctls to show the temperature.



I will look deeper as I get back home from holiday and let you know. Thanks for the suggestion!


----------



## Phishfry (Aug 22, 2020)

There is no sysctl for AMD GPU's.
I have this HP 8370p Elitebook with Intel CPU.

```
vgapci0@pci0:1:0:0:    class=0x030000 card=0x179d103c chip=0x68411002 rev=0x00 hdr=0x00
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Thames [Radeon HD 7550M/7570M/7650M]'
    class      = display
```

I load amdtemp in /boot/loader.conf and nothing appears.
No surprise as this module is for AMD Core CPU temperatures not graphics chips.


----------



## thegoldgoat (Aug 22, 2020)

Phishfry said:


> There is no sysctl for AMD GPU's.
> I have this HP 8370p Elitebook with Intel CPU.
> 
> ```
> ...


Have you tried what Elazar said about `kldstat`?


----------



## George (Aug 23, 2020)

It seems that amdgpu has no fan/temperature monitoring. github has an open issue on this:
[amdgpu] hwmon? · Issue #150 · FreeBSDDesktop/kms-drm ... github.com › kms-drm › issues

Not sure about radeon-kms.


----------



## Argentum (Aug 24, 2020)

Elazar said:


> It seems that amdgpu has no fan/temperature monitoring. github has an open issue on this:
> [amdgpu] hwmon? · Issue #150 · FreeBSDDesktop/kms-drm ... github.com › kms-drm › issues



I suspected that but now it seems this is really so.

There is another application which should show the temperature, but it does not - benchmarks/mangohud/. Only FPS...

`mangohud glxgears`


----------



## martm (Jul 1, 2021)

Sorry for pulling up this old thread.
Please find attached a patch, that I just created.
It shows at least temperature in radeontop.
The patch can be dropped in the radeontop/files directory in the ports tree.
Unfortunately, fan speed seems not to be easily available.


----------



## fernandel (Jul 1, 2021)

On Thinkpad T495. Open is GIMP, xpdf, MC and Firefox,


----------



## astyle (Jul 2, 2021)

I know RadeonTop works... I tried it on my machine... I'm more interested in getting marazmista's radeon-profile to work under FreeBSD... if anyone pulled that off, can you please share how that was done?


----------



## martm (Jul 2, 2021)

I filed a pull request for an improved version of this patch for radeontop on github. 








						Implemented temperature sensor reading by mmsoft3 · Pull Request #117 · clbr/radeontop
					

GPU temperature is easily available in the drm interface. In FreeBSD, there is no other tool available to monitor GPU temperature.




					github.com
				




So hopefully, this gets included in the next version.


----------



## fernandel (Mar 27, 2022)

Looks like there are not improvement.


----------



## grahamperrin@ (Mar 27, 2022)

judd said:


> `# ipmitool sensor`



Below, should I assume that it's not supported on my computer? 


```
root@mowa219-gjp4-8570p-freebsd:~ # kldstat | tail -n 5
55    1 0xffffffff849fa000     3178 amdtemp.ko
56    1 0xffffffff849fe000     2150 amdsmn.ko
57    1 0xffffffff84a01000     2108 coretemp.ko
58    1 0xffffffff84a04000     8bd8 ipmi.ko
59    1 0xffffffff84a0d000     2180 smbus.ko
root@mowa219-gjp4-8570p-freebsd:~ # ipmitool sensor
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
root@mowa219-gjp4-8570p-freebsd:~ #
```


----------



## fernandel (Mar 27, 2022)

It doesn't work on my Laptop T495.


----------



## astyle (Mar 27, 2022)

grahamperrin said:


> 58 1 0xffffffff84a04000 8bd8 ipmi.ko


That one looks loaded. So my first thought would be to explore the ipmitool(1) manpage and see what hardware would be supported.


----------



## SirDice (Mar 28, 2022)

grahamperrin said:


> Below, should I assume that it's not supported on my computer?


It won't work if you don't have the IPMI hardware in your system. Kernel module will always load, but not activate if there's no IPMI hardware.


----------

