AMDGPU fan 0 rpm

If i’m not wrong amdfan extracts fan speed info from /sys/class/drm/card0/device/hwmon/hwmon2/fan1_input, so if the fan1_input is 0 amdfan will show 0, therefore it’s not a amdfan bug

I have no issue with my AMD RX 5700. I did not change the setting or did not install AMDGPU fan that was enabled by default in KDE. I am using Linux Kernel 5.16

Screenshot_20220318_193210


❯ cat /sys/class/drm/card0/device/hwmon/hwmon2/fan1_input
820

It looks like it works.

In my case and then in my experience, my fans were working when I was booting my computer and after, nothing. It is a Gigabyte Radeon RX5500 XT 8Go.
And I don’t know why. I have search a lot on documentation, test a lot of times lm_sensors and I have found amdfan which has saved me and without any configuration. And since this time (mi-january), that works like a charm at around 35 C° and 1150 pwm/minutes.

Hum I remember I have used it in manual mode like automatic mode doesn’t work for me.

What did you get when you ran in a terminal amdfan ?

Hum let me come back to my other computer and find if possible my command lines.

It is not an issue with the number of kernel. The automatic mode doesn’t work.

If i’m not wrong amdfan extracts fan speed info from /sys/class/drm/card0/device/hwmon/hwmon2/fan1_input, so if the fan1_input is 0 amdfan will show 0, therefore it’s not a amdfan bug

lm_sensor use /sys/class/drm/card0/device/hwmon/hwmon2/fan1_input but not amdfan and that’s why that’s work.

Let me not the number of the thread and found my notes.

But it works for me, Fan speed changes automatically, it depends on the temperature. I think it was already integrated into GPU.

@Zesko
Not for me before using amdfan and at first look for ak2022. After yes like you.

@ak2022
Okay.I have finally found my notes and found my bash too. We are going to pass some commands in a terminal for seing why it doesn’t work for you.

pacman -Qi amdfan
systemctl status amdfan

Normally you should get that:

pacman -Qi amdfan
Nom                      : amdfan
Version                  : 0.1.17-1
Description              : Python daemon for controlling the fans on amdgpu cards
Architecture             : any
URL                      : https://github.com/mcgillij/amdfan
Licences                 : GPL2
Groupes                  : --
Fournit                  : --
Dépend de                : python  python-yaml  python-numpy  python-rich  python-click
Dépendances opt.         : --
Requis par               : --
Optionnel pour           : --
Est en conflit avec      : --
Remplace                 : --
Taille installée         : 32,47 KiB
Paqueteur                : Unknown Packager
Compilé le               : sam. 05 mars 2022 20:25:38
Installé le              : sam. 05 mars 2022 20:33:09
Motif d’installation     : Explicitement installé
Script d’installation    : Non
Validé par               : --

[olivier@thorielle ~]$ systemctl status amdfan
● amdfan.service - amdfan controller
     Loaded: loaded (/usr/lib/systemd/system/amdfan.service; enabled; vendor preset: disabled)
     Active: active (running) since Fri 2022-03-18 19:45:04 CET; 12min ago
   Main PID: 555 (amdfan)
      Tasks: 1 (limit: 38405)
     Memory: 57.2M
        CPU: 294ms
     CGroup: /system.slice/amdfan.service
             └─555 /usr/bin/python /usr/bin/amdfan --daemon

mars 18 19:45:04 thorielle systemd[1]: Started amdfan controller.
mars 18 19:45:06 thorielle amdfan[555]: [19:45:06] INFO     Starting amdfan                                >
lines 1-12/12 (END)

Did you have seen my last answer ?

lm_sensor use /sys/class/drm/card0/device/hwmon/hwmon2/fan1_input but not amdfan and that’s why that’s work.

Are you sure? Because according to amdfan source file from line 133 to 138 it’s requesting data from fan1_input

    @property
    def fan_speed(self) -> int:
        try:
            return int(self.read_endpoint("fan1_input"))
        except KeyError:  # better to return no speed then explode
            return 0

and look at line 30 and 31

ROOT_DIR: str = "/sys/class/drm"
HWMON_DIR: str = "device/hwmon"
ROOT_DIR: str = "/sys/class/drm"
HWMON_DIR: str = "device/hwmon"

The /sys/class/drm/card* is read by a lot of software like amdgpu, amdfan and lm_sensors because it is here that the system get some informations about your graphic card. And it is the same for hwmon .
Besides you can see all the options provided by this driver, just do in a terminal :

ls /sys/class/drm/card0/device/hwmon/hwmon*/

And if you want to know what number is your first graphic card :

ls /sys/class/drm/card0/device/hwmon/

And see values of the options for sample the fan1_input

cat /sys/class/drm/card0/device/hwmon/hwmon*/fan1_input 
lm_sensor use /sys/class/drm/card0/device/hwmon/hwmon2/fan1_input but not amdfan and that’s why that’s work.

Exactly, I have mixed lm_sensors and hwmon. Sorry.

To come back to your issue (i.e having fan working), please provide the output of the two commands given upper.

pacman -Qi amdfan                                                ✔ 
Name            : amdfan
Version         : 0.1.17-1
Description     : Python daemon for controlling the fans on amdgpu cards
Architecture    : any
URL             : https://github.com/mcgillij/amdfan
Licenses        : GPL2
Groups          : None
Provides        : None
Depends On      : python  python-yaml  python-numpy  python-rich  python-click
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 32.47 KiB
Packager        : Unknown Packager
Build Date      : Fri 18 Mar 2022 17:52:00 GMT
Install Date    : Fri 18 Mar 2022 17:52:03 GMT
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

systemctl status amdfan                                                        INT ✘  6s  
● amdfan.service - amdfan controller
     Loaded: loaded (/usr/lib/systemd/system/amdfan.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2022-03-19 14:22:29 GMT; 1h 37min ago
   Main PID: 1160 (amdfan)
      Tasks: 1 (limit: 38369)
     Memory: 56.8M
        CPU: 1.431s
     CGroup: /system.slice/amdfan.service
             └─1160 /usr/bin/python /usr/bin/amdfan --daemon

Mar 19 14:22:29 manjaro systemd[1]: Started amdfan controller.
Mar 19 14:22:29 manjaro amdfan[1160]: [14:22:29] INFO     Starting amdfan 

Okay. I think that you have done before :

sudo systemctl enable amdfan

did you see or hear if your fans are running ?

if not :
Now let’s try:

sudo systemctl start amdfan

and after type:

amdfan --monitor

Normally you should get in your terminal a window showing your temperatur and your speed of your fans.

If you look at my earlier response you can see that amdfan is already running so there’s no need to run

sudo systemctl start amdfan

amdfan --monitor

Screenshot from 2022-03-19 16-54-58

The other question is what fan curve you have. I don’t know what is default, but it could be that they turn on above certain temperature (e.g. above 40 °C – it’s my manual setup on RX 6600XT, below this temperature I have 0RPM).

I’ve set it run at 15% from 0-30c then 15%+ after that

Could you check your amdfan.yml file with this command:

cat /etc/amdfan.yml 

or with this one (she looks to do the same thing):

amdfan --configuration

You should get something like this:

cat /etc/amdfan.yml 
#Fan Control Matrix.
# [<Temp in C>,<Fanspeed in %>]
speed_matrix:
- [4, 4]
- [30, 33]
- [45, 50]
- [60, 66]
- [65, 69]
- [70, 75]
- [75, 89]
- [80, 100]

# Current Min supported value is 4 due to driver bug
#
# Optional configuration options
#
# Allows for some leeway +/- temp, as to not constantly change fan speed
# threshold: 4
#
# Frequency will change how often we probe for the temp
# frequency: 5
#
# While frequency and threshold are optional, I highly recommend finding
# settings that work for you. I've included the defaults I use above.
#
# cards:
# can be any card returned from `ls /sys/class/drm | grep "^card[[:digit:]]$"`
# - card0

amdfan --configuration
#Fan Control Matrix.
# [<Temp in C>,<Fanspeed in %>]
speed_matrix:
- [4, 4]
- [30, 33]
- [45, 50]
- [60, 66]
- [65, 69]
- [70, 75]
- [75, 89]
- [80, 100]

# Current Min supported value is 4 due to driver bug
#
# Optional configuration options
#
# Allows for some leeway +/- temp, as to not constantly change fan speed
# threshold: 4
#
# Frequency will change how often we probe for the temp
# frequency: 5
#
# While frequency and threshold are optional, I highly recommend finding
# settings that work for you. I've included the defaults I use above.
#
# cards:
# can be any card returned from `ls /sys/class/drm | grep "^card[[:digit:]]$"`
# - card0

If not we should create it.

I already have it

Hum. Just an idea and I think that 's why it doesn’t work.
At first look with amdfan --monitor, I’ve seen that your temperature is 31 °c and according the yaml file amdfan is started to 33 °C
For me it is the reason than amdfan doesn’t work.
then we must modified or find the good parameters for working your graphic card.

I said 0-33c not 33c but that was on corectrl, which is now disabled. I just have amdfan with the default settings

# [<Temp in C>,<Fanspeed in %>]
speed_matrix:
- [4, 4]
- [30, 33]
- [45, 50]
- [60, 66]
- [65, 69]
- [70, 75]
- [75, 89]
- [80, 10

I’m not sure to understand why you said 33c and the rapport with corectrl.

Me I have said 33c because you have said to have the same yml file like me and then the second line i.e - [30, 33].
and with amdfan --monitor you have [0, 31].
I think that we must adjust the yaml file for get
Actually, amdfan will run when your graphic card temperature will be at only 33 c and not 31c.

For that you must modified your amdfan.yml file(normally in root, save it) and restart amdfan service with this command.

sudo systemctl restart amdfan

But before we can do something with this ocmmand.

sudo amdfan --manual

Normaly it should ask you :slight_smile:
-which card? [card0] said card0

  • fan speed modified [1,.,100%] or ’ auto’ answer the first
    And check again with amdfan --monitor