Bug 97556 - amdgpu fan behavior doesn't match windows
Summary: amdgpu fan behavior doesn't match windows
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/AMDgpu (show other bugs)
Version: XOrg git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
Depends on:
Reported: 2016-09-01 00:46 UTC by Grazvydas Ignotas
Modified: 2019-11-19 08:09 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:

fan stop hack (561 bytes, patch)
2016-11-01 17:05 UTC, Grazvydas Ignotas
no flags Details | Splinter Review

Description Grazvydas Ignotas 2016-09-01 00:46:05 UTC
Some AIB vendor cards have fan profiles tuned to them, which include marketing features like "Zero Frozr", "0 RPM", "Mute Fan" and so on that stop the fan completely while idle. This doesn't seem to be working with amdgpu, the fan always spins although some thermal control does seem to work.

My card is MSI RX 470 Gaming X 8G, which has the following vBIOS:

Dumping ATOM_Fiji_Fan_Table shows:
usTMin: 4000
usTMed: 6500
usTHigh: 8500
usPWMMin: 2000
usPWMMed: 4000
usPWMHigh: 6000
usTMax: 10900
ucFanControlMode: 1
usFanPWMMinLimit: 18
usFanPWMMaxLimit: 100
usFanPWMStep: 1
usDefaultMaxFanPWM: 100
usMaxFanPWM: 100
usFanRPMMinLimit: 18
usFanRPMMaxLimit: 100

This doesn't seem to really correspond to how it works on Windows, where the fan stops completely while under 60C (which is how it's also advertised by the vendor). I've not installed any MSI tools there, just the base AMD driver, it also doesn't depend on any autorun .exe, only the base driver is needed for it to behave as advertised on Windows.

So does anyone know what is done different by the Windows driver? Perhaps a different fan table is used from the vBIOS? Or perhaps the driver has this logic hardcoded for each partner card?

Can it be done on Linux too?
Comment 1 Alex Deucher 2016-09-02 15:00:35 UTC
You can also manually control the fan via standard linux hwmon pwm interfaces.
Comment 2 sonyp2p 2016-10-16 09:56:19 UTC
The same behavior happen with the PowerColor RX 480 RedDevil.
On Linux the fans are spinning even if the temperature of the card is 40C (on Windows they are in idle until 60C are reached).
Comment 3 Grazvydas Ignotas 2016-11-01 17:05:42 UTC
Created attachment 127663 [details] [review]
fan stop hack

This patch allows the fans to stop (tested on top of drm-next-4.10-wip branch), but I don't know what side effects it may have and if it messes up other cards, so use at your own risk.
Comment 4 Sergey Kochneff 2017-02-01 15:23:49 UTC
On ASUS Strix RX 470, “fan stop” works fine on firmware boot and in GRUB, but after loading amdgpu module fan starts to spin and never stops. Although it’s possible to emulate proper behavior with custom script/utility reading and writing sysfs files it looks like bug to me.
Comment 5 Sergey Kochneff 2017-02-01 15:29:00 UTC
In addition to my previous comment. pwm1_enable always reads “1” which usually means “manual control”, and writing “2” (hardware control) or higher values doesn’t change file contents neither it changes fan speed. On my previous GCN 1.0 card “2” was default value and fan didn’t spin most of the time.
Comment 6 Dimitrios Liappis 2017-08-24 08:25:51 UTC
I have the same issue on an Asus Radeon RX-550[1] and amdgpu.

The fan is on all the time.
By default pwm1_enable shows 1, however, even when I write 2 to it nothing changes.

Interestingly enough, `fan1_input` reports no such device, whereas, temp1_input seems to show the right temp. This seems to be corroborated by the sensors output where temp is correctly reported but not fan speed.

[root@MS-7885 hwmon0]# pwd

[root@MS-7885 hwmon0]# cat temp1_input && echo && sensors

Adapter: PCI adapter
fan1:             N/A
temp1:        +32.0°C  (crit =  +0.0°C, hyst =  +0.0°C)

03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon RX 550] (rev c7) (prog-if 00 [VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 0513
        Physical Slot: 4
        Flags: bus master, fast devsel, latency 0, IRQ 37, NUMA node 0
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Memory at f0000000 (64-bit, prefetchable) [size=2M]
        I/O ports at e000 [size=256]
        Memory at fbe00000 (32-bit, non-prefetchable) [size=256K]
        Expansion ROM at 000c0000 [disabled] [size=128K]
        Capabilities: [48] Vendor Specific Information: Len=08 <?>
        Capabilities: [50] Power Management version 3
        Capabilities: [58] Express Legacy Endpoint, MSI 00
        Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
        Capabilities: [150] Advanced Error Reporting
        Capabilities: [200] #15
        Capabilities: [270] #19
        Capabilities: [2b0] Address Translation Service (ATS)
        Capabilities: [2c0] Page Request Interface (PRI)
        Capabilities: [2d0] Process Address Space ID (PASID)
        Capabilities: [320] Latency Tolerance Reporting
        Capabilities: [328] Alternative Routing-ID Interpretation (ARI)
        Capabilities: [370] L1 PM Substates
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu
Comment 7 Dimitrios Liappis 2017-10-22 10:02:27 UTC
To close the loop with my issue here, it appears that the Asus Radeon RX-550 doesn't have any PWM control. The fan speed is constant and can't be changed in Windows using the GPU Tweak II software either. A curious bit is that while the socket for the fan connector has 4 pins, only 2 are actually driving the fan (however, I have owned graphics cards before that were able to adjust the fan speed by adjusting the voltage using just the two +/- cables).

After discussing with Asus Support and the shop where I purchased it from, we came to the conclusion that all 550 series cards in the market don't have PWM control whereas higher models do. I replaced it with a (Gigabyte) RX-560 which is very silent. `sensors` now shows the RPM for the card. My understanding is that all models starting with 560 onwards support fan control, regardless of the manufacturer.
Comment 8 Martin Peres 2019-11-19 08:09:42 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/drm/amd/issues/94.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.