Eraden / amdgpud

MIT License
192 stars 11 forks source link

Does not works on AMD Vega #4

Closed Eraden closed 3 years ago

jasondaigo commented 3 years ago

Sapphire Vega56 Pulse Kernel 5.12.14 Arch Fancontrol config in use:


DEVPATH=hwmon1=devices/platform/it87.656 
DEVNAME=hwmon1=it8665
FCTEMPS=hwmon1/pwm1=hwmon1/temp1_input hwmon1/pwm2=hwmon1/temp1_input hwmon1/pwm3=hwmon1/temp1_input hwmon1/pwm4=hwmon1/temp1_input hwmon1/pwm6=hwmon1/temp1_input 
FCFANS=hwmon1/pwm1=hwmon1/fan1_input hwmon1/pwm2=hwmon1/fan2_input hwmon1/pwm3=hwmon1/fan3_input hwmon1/pwm4=hwmon1/fan4_input hwmon1/pwm6=hwmon1/fan6_input 
MINTEMP=hwmon1/pwm1=42 hwmon1/pwm2=55 hwmon1/pwm3=57 hwmon1/pwm4=59 hwmon1/pwm6=56 
MAXTEMP=hwmon1/pwm1=78 hwmon1/pwm2=81 hwmon1/pwm3=82 hwmon1/pwm4=79 hwmon1/pwm6=81 
MINSTART=hwmon1/pwm1=255 hwmon1/pwm2=255 hwmon1/pwm3=255 hwmon1/pwm4=255 hwmon1/pwm6=255 
MINSTOP=hwmon1/pwm1=77 hwmon1/pwm2=86 hwmon1/pwm3=79 hwmon1/pwm4=107 hwmon1/pwm6=97 
MINPWM=hwmon1/pwm1=77 hwmon1/pwm2=86 hwmon1/pwm3=79 hwmon1/pwm4=107 hwmon1/pwm6=97 
MAXPWM=hwmon1/pwm1=240 hwmon1/pwm2=196 hwmon1/pwm3=202 hwmon1/pwm4=237 hwmon1/pwm6=207 
AVERAGE=hwmon1/pwm1=1 hwmon1/pwm2=1 hwmon1/pwm3=1 hwmon1/pwm4=1 hwmon1/pwm6=1```
r15ch13 commented 3 years ago

I have a Vega 56 and I can confirm that the service is not working.

In service() the speed from the config file (a PWM value) is compared to fan_min() and fan_max() but those functions return the fan RPM.

https://github.com/Eraden/amdgpud/blob/0794605006e0888875d90c098b29c8215af7b79e/src/main.rs#L291-L294

In my case, the outputs are:

fan1_min   = 400
fan1_max   = 3300
fan1_input = 637 (rpm)
pwm1_min   = 0
pwm1_max   = 255
pwm1       = 48

Setting the PWM target to 30 for example will result in:

fan1_min (400) > 30 || fan1_max (3330) < 30

And that's not working :smile:

Adding RPM values into the config will also not work because set_speed() writes to pwm1 and not fan1_input.

BoostCookie commented 3 years ago

@r15ch13 I just wanted to comment the exact same thing. Also the default config makes it look like speed has to be a percentage between 4 and 100, but the value gets directly, without conversion, written to pwm1 which goes from 0 to 255. I think it would be best to keep it as a percentage from 0 to 100 (also allowing floats) in the config and then convert it to an int in the correct range.

And I'm not sure which would be better to change. Either use pwm1_min and pwm1_max for the boundaries and let set_speed write to pwm1, or use fan1_min and fan1_max for the boundaries and write to fan1_target. I don't know if every AMD card has both options though.

EDIT: Ok, according to this the pwm interface should be used for the manual fan speed control (pwm1_enable=1).