No Radeon PowerPlay PWM control (fan speed control), not even the default auto mode. #405
Description
Hi!
My RX 560's fan is running at full speed, which it does not do in Windows. My goal, as a naive user, is to switch the card to its "auto" fan control mode so my workstation is nice and quiet under typical workloads. The marketing name for fan/energy use control on Radeon is "PowerPlay".
Rummaging around reveals that RadeonSensors does not seem to have any fan/PWM control at all at the moment. Taking a look at the amdgpu driver in upstream Linux kernel reveals what appears to be support for this (echo "2" > /sys/class/drm/card0/device/hwmon/hwmon0/pwm1_enable
for anyone curious).
So, naturally, I decided to have a look to see what it would take to port this functionality to RadeonSensors.
It appears that amdgpu has two strategies for setting fan control PowerPlay settings.
- The so-called "ucode" method, which involves sending a message to the Radeon's "SMC" (I'm pretty sure not to be confused with Apple's SMC) to enable or disable auto speed control;
- The native mode, setting registers directly to turn on auto speed control or set an explicit speed.
As implied above for setting a manual fan speed it disables the SMC's auto fan control if present and always sets the registers.
Here's that policy from drivers/gpu/drm/amd/amdgpu/si_dpm.c
:
static void si_dpm_set_fan_control_mode(void *handle, u32 mode)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (mode) {
/* stop auto-manage */
if (adev->pm.dpm.fan.ucode_fan_control)
si_fan_ctrl_stop_smc_fan_control(adev);
si_fan_ctrl_set_static_mode(adev, mode);
} else {
/* restart auto-manage */
if (adev->pm.dpm.fan.ucode_fan_control)
si_thermal_start_smc_fan_control(adev);
else
si_fan_ctrl_set_default_mode(adev);
}
}
(It's not really clear to me how commonly ucode_fan_control
is set on Linux boxes with amdgpu.)
Has setting Radeon fan speed (auto or otherwise) been attempted in Radeon Sensors before, or can I just jump right into trying to send the message to the Radeon SMC?
PS. I'm running Rehabman's fork of HWSensors bundled with his branch of FakeSMC at the moment, but it appears that @kozlek's project is the living upstream for HWSensors itself. Do I have that right?
TL;DR: Linux knows how to do Radeon fan control. Are there any known blockers preventing porting this to RadeonSensors?