Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to tame PWM fan control for amdgpu?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 205

PostPosted: Wed Oct 12, 2022 3:19 pm    Post subject: How to tame PWM fan control for amdgpu? Reply with quote

I own an AMD RX6600 GPU and use the amdgpu driver. While everything works fine, the automatic (firmware-based?) fan control of the graphics card is insane. It basically jumps between 0%, 50% and 100%. The fan is completely switched off for maybe 10 minutes and when the temperature of the GPU gets to high, the fan spins with 1750 RPM (50% of 3500rpm max) until the GPU is cool enough again and then switches off again. This is not only a noise annoyance but I also assume that this is neither optimal for the lifetime of the GPU chip and the fan. I would rather like to have the fan spinning constantly at a low speed.

How do I tame the PWM fan control for amdgpu to behave more intelligently?

That is what I have already figured out. I can read all necessary values with sensors
Code:
~ # sensors
amdgpu-pci-0900
Adapter: PCI adapter
vddgfx:      718.00 mV
fan1:           0 RPM  (min =    0 RPM, max = 3500 RPM)
edge:         +56.0°C  (crit = +100.0°C, hyst = -273.1°C)
                       (emerg = +105.0°C)
junction:     +57.0°C  (crit = +110.0°C, hyst = -273.1°C)
                       (emerg = +115.0°C)
mem:          +62.0°C  (crit = +100.0°C, hyst = -273.1°C)
                       (emerg = +105.0°C)
PPT:          17.00 W  (cap = 100.00 W)

Moreover, there are some interesting settings below /sys/class/drm/card0/device/hwmon/hwmon0
Code:
/sys/class/drm/card0/device/hwmon/hwmon0 # ls fan1* pwm1*
fan1_enable  fan1_input  fan1_max  fan1_min  fan1_target  pwm1  pwm1_enable  pwm1_max  pwm1_min
If I got it right, then the following holds:
  • pwm1_enable: 0 = Fan disabled, 1 = Manual Control, 2 = Auto Control
  • pwm1: meaningless for pwm1_enable == 0, read-only for pwm1_enable == 2, but for pwm1_enable ==1, pwm1 := 0 means zero PWM duty cycles, pwm1 := 255 means full speed
All other values seem to be always read-only. I played around with these settings a little bit and with
Code:
echo 1 > pwm1_enable
echo 60 > pwm1

I get an inaudible GPU fan which constantly spins at 688 RPM and the temperature of the GPU never exceeds 45°C for normal office work. However, I don't want a GPU fan whose rotation speed is fixed in case more cooling might be required. This was only for testing purpose to check whether it works in principle.

For safety reasons, I would optimally leave temperature control on automatic (firmware-based?) mode, but I would like the firmware to be more delicate and not just switch between 0%, 50% and 100%.

If this is impossible, I would like to use some daemon which reads the temperature from the GPU and then sets the fan speed accordingly. For Arch Linux I found this article https://wiki.archlinux.org/title/fan_speed_control#AMDGPU_sysfs_fan_control. The article refers to several programs, like amdgpu-fan or amdfand. But neither seems to be included in the Gentoo package repository.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Wed Oct 12, 2022 6:35 pm    Post subject: Reply with quote

I use amdgpu-fancontrol
Quote:
Simple bash script to control AMD Radeon graphics cards fan pwm. Adjust temp/pwm values and hysteresis/interval in the script as desired. Other adjustments, such as the correct hwmon path might be required as well.


I modified the points and fan speed for what I wanted, and it works fine.

https://github.com/grmat/amdgpu-fancontrol
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Koradji
Tux's lil' helper
Tux's lil' helper


Joined: 01 Apr 2005
Posts: 86
Location: Perth, Australia

PostPosted: Mon Feb 12, 2024 8:23 am    Post subject: Re: How to tame PWM fan control for amdgpu? Reply with quote

nagmat84 wrote:
I own an AMD RX6600 GPU and use the amdgpu driver. … I also assume that this is neither optimal for the lifetime of the GPU chip and the fan.


This seems to have broken my RX6600.
Fans not spinning, then spinning up too late.
Any load and it just dies now.

For anyone else looking for this, portage has x11-apps/radeon-profile and x11-apps/radeon-profile-daemon. They provide a gui to set up fan speed profiles.
_________________
koradji login: emerge nvidia-drivers
password: ...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum