Skip to contentSkip to conversation

AMD CPUs w/ Integrated Graphics (APUs) And Turbo Core Only Boost If "fglrx" Module Is Loaded

Bug 81021 [email protected] 1 participant 15 messages Jul 29, 2014 – Aug 7, 2014 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

Alan <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
          Component|cpufreq                     |Video(DRI - non Intel)
           Assignee|[email protected]     |drivers_video-dri@kernel-bu
                   |                            |gs.osdl.org
            Product|Power Management            |Drivers
Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#3 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

Alex Deucher <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Alex Deucher <[email protected]> ---
You can enable it by setting pi->enable_bapm = true; in trinity_dpm_init() in trinity_dpm.c. Unforunately, it's not stable yet on all systems.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#4 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

Kertesz Laszlo <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #3 from Kertesz Laszlo <[email protected]> --- This issue isnt new, i filed a bug about it ages ago ( #62861 ). As Alex said, turbo core can be enabled by setting bapm to true.
Now this is enabled on MSI boards (seems to me all had A78 chipsets?) only by default because they had reboots right after boot if it was off. Im curious how they fare with enabled bapm.

Problem is setting bapm on, at least on my A8-6500/GA-F2A88X-D3H and my former A8-5500/GA-F2A85X-D3H hardware causes random reboots or system hangs with no outputs in the system logs.
The setting indeed enables turbo core.

Also, a simpler way of seeing the actual working frequency is loading the msr module:

modprobe msr

Then running:

cpufreq-aperf

or

cpufreq-aperf -o

for a single poll.
both commands with root rights. This will show the actual frequency in Hz (which sometimes is between the nominal p-states, or maybe the polling does averages).

Additionally, even if fglrx eables turbo core boost, sometimes something weird happens and even the nominal speed is reported as maximum, in effect you can have even as low as 1.8 GHz (3.2GHz CPU) after an initial turbo boosted speed which lasts a few seconds. This happened to me sometimes (almost 50% of times) when i was compiling with 4 threads on my older A8-5500. I suppose its some internal downclocking mechanism kicking in at the wrong time because the reported temperatures were ~55C (default cooler).

In contrast this never happened with radeon and if one thread was used it could have 4 GHz for hours (runaway flash in browser for example). 4 threads (compile) usually settled all cores at a stable ~3.7-3.8 GHz (temps up to 60C, default cooler). These are values on the A8-6500 (3.5GHz nominal/4.1 GHz turbo speed from which never exceeded 4.0 as long as i monitored it).

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#5 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #4 from LiNuxXer <[email protected]> --- (In reply to Alex Deucher from comment #2)

Quoted 2 lines

You can enable it by setting pi->enable_bapm = true; in trinity_dpm_init() in trinity_dpm.c. Unforunately, it's not stable yet on all systems.

Thank you for this hint, Alex.

A search does not reveal much. Do you have a reference to the problems which this can cause?

trinity_dpm.c seems to be a file of the free radeon driver. Actually, I would prefer to go without any HW specific graphics driver.

I was hoping for a slight chance for the kernel to detect this annoyance and solve it (in a first step) regardless of any later graphics driver settings.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#6 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #5 from LiNuxXer <[email protected]> --- (In reply to Kertesz Laszlo from comment #3)

Quoted 2 lines

This issue isnt new, i filed a bug about it ages ago ( #62861 ). As Alex said, turbo core can be enabled by setting bapm to true.

I cannot see any relation between this bug and #62861.

Over there, you stated:

Quoted 3 lines

This issue is related to the radeon driver's dpm code. If i dont append radeon.dpm=1 to the kernel boot options, i have 0.9-1.34v and correct CPU speeds (including torbo boost).

This bug report here is about Linux not supporting Turbo Core on APUs when no specific graphics driver is used.

In other words, I'm raising the question whether the kernel should be able to suipport the APU Turbo Core even without any specific graphics driver.

Quoted 9 lines

[...]
Also, a simpler way of seeing the actual working frequency is loading the msr module:

modprobe msr

Then running:

cpufreq-aperf

In what regard is this simpler than using cpupower?

Quoted 7 lines

Additionally, even if fglrx eables turbo core boost, sometimes something weird happens and even the nominal speed is reported as maximum, in effect you can have even as low as 1.8 GHz (3.2GHz CPU) after an initial turbo boosted speed which lasts a few seconds. This happened to me sometimes (almost 50% of times) when i was compiling with 4 threads on my older A8-5500. I suppose its some internal downclocking mechanism kicking in at the wrong time because the reported temperatures were ~55C (default cooler).

I stress tested the A10-6700 with fglrx loaded (but console only video) and two cores with 100 % load can boost to 4300 MHz seemingly forever, three with 100 % load will be boosted to 3900 MHz.

Quoted 2 lines

In contrast this never happened with radeon and if one thread was used it could have 4 GHz for hours (runaway flash in browser for example).

Maybe the radeon driver didn't load the GPU as much as the fglrx driver did. But since I'm going for console output only, I don't mind. If there's just one bit controlling this behaviour, we'll have to live with the APU's autonomous decision. Some may be smarter than others and maybe it even depends on cooling.

Still, I would appreciate my 3700 -> 4300 MHz boost for two cores.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#7 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #6 from Alex Deucher <[email protected]> --- (In reply to LiNuxXer from comment #5)

Quoted 7 lines

This bug report here is about Linux not supporting Turbo Core on APUs when no specific graphics driver is used.

In other words, I'm raising the question whether the kernel should be able to suipport the APU Turbo Core even without any specific graphics driver.

Turbo Core (bapm) is controlled by a microcontroller on the APU. The same microcontroller also manages the GPU power management. On most APU systems, turbo core is enabled by default by the sbios, but apparently on your system it's not. Maybe there is a bios option to enable it by default on your system.
When the GPU driver loads and sets up the GPU power management, it can also
enable or disable bapm. When bapm and GPU power mangement (dynamic GPU engine clock and voltage scaling, clock and powergating, etc.) are both enabled, some systems have stability problems (sudden reboots, hangs, graphical corruption, issues when switching between AC and battery).

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#8 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #7 from LiNuxXer <[email protected]> --- Hello Alex,

(In reply to Alex Deucher from comment #6)

Quoted 5 lines

Turbo Core (bapm) is controlled by a microcontroller on the APU. The same microcontroller also manages the GPU power management. On most APU systems, turbo core is enabled by default by the sbios, but apparently on your system it's not. Maybe there is a bios option to enable it by default on your system.

reconsidering everything you wrote and I thought I found out, I think I'll have to start from scratch.

Firstly, the BIOS does have Turbo Core and Cool'n'Quiet settings, along with many others. Also. it's the latest version, and the A10-6700 is not brand new.

Secondly, I noticed that even Ubuntu Server will install the radeon driver although there is no need to.

Thirdly, I made a quick test with a Gentoo installer (which neither loads the radeon module nor sets the ondemand governor) and an amperemeter (to be honest:
two amperemeters, because I couldn't believe the results), and this completely confused me. While the system needs 96 W while in the BIOS, this drops to 56 W as soon as Linux boots. And I can't get a lower power consumption even if I set the ondemand governor, with the freq of the four cores shown to drop from 3700 to 1800. Several reviews mention a 35 W system (!) power consumption when the A10-6700 is idle, but in this setup, the changing frequency does not have the slightest effect (which it should even have with an average power supply).

I was wondering whether you could shed some additional light on this. How many settings actually influence this behaviour in total (since the BIOS also has "Cool'n'Qiet")? Is there any tool to display them? If not, would you help me to build one? Could we see some incomplete initialisation here? Is there any documentation on these settings? I'm groping in the dark here with no progress, and I may even have to exchange the HW if I don't get near the 35 W and have Turbo Core.

Quoted 5 lines

When the GPU driver loads and sets up the GPU power management, it can also enable or disable bapm. When bapm and GPU power mangement (dynamic GPU engine clock and voltage scaling, clock and powergating, etc.) are both enabled, some systems have stability problems (sudden reboots, hangs, graphical corruption, issues when switching between AC and battery).

I would be happy with some fixed low bandwidth setting for the graphics. Saw some indivation for 33 MHz during console mode but am not sure I can rely on this information.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#9 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #8 from Alex Deucher <[email protected]> ---
I'm not sure why you don't think you need a GPU driver installed. When the driver is installed it not only allows the GPU to dynamically adjust it clocks and voltages up for performance, but also enables low power states and turns off certain blocks when they are not in use, so overall, you'll probably save more power with the GPU driver loaded than just leaving the GPU in the state set up by the bios.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#10 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #9 from LiNuxXer <[email protected]> --- (In reply to Kertesz Laszlo from comment #3)

Quoted 9 lines

[...]
Additionally, even if fglrx eables turbo core boost, sometimes something weird happens and even the nominal speed is reported as maximum, in effect you can have even as low as 1.8 GHz (3.2GHz CPU) after an initial turbo boosted speed which lasts a few seconds. This happened to me sometimes (almost 50% of times) when i was compiling with 4 threads on my older A8-5500. I suppose its some internal downclocking mechanism kicking in at the wrong time because the reported temperatures were ~55C (default cooler).

Quoted 5 lines

In contrast this never happened with radeon and if one thread was used it could have 4 GHz for hours (runaway flash in browser for example). 4 threads (compile) usually settled all cores at a stable ~3.7-3.8 GHz (temps up to 60C, default cooler). These are values on the A8-6500 (3.5GHz nominal/4.1 GHz turbo speed from which never exceeded 4.0 as long as i monitored it).

I can confirm your findings. It looks like using fglrx will lead to longer periods of exceeding the TDP significantly, and then suddenly it takes drastic measures to compensate for that. From my observations I believe that it even manipulates core affinity if only two cores are busy (having them on the same module will save a lot of power if the whole other module can be slowed down).

With a bapm-patched radeon driver, nothing similar can be observed. Besides saving up to 12W in console mode as compared to fglrx, the cores are able to run at high frequencies forever with no abrupt measures to be seen.

Thank you for pointing this out. I have posted my detailed results at
http://unix.stackexchange.com/a/148918/79761 in case you're interested.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#11 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #10 from LiNuxXer <[email protected]> --- (In reply to Alex Deucher from comment #8)

Quoted 6 lines

I'm not sure why you don't think you need a GPU driver installed. When the driver is installed it not only allows the GPU to dynamically adjust it clocks and voltages up for performance, but also enables low power states and turns off certain blocks when they are not in use, so overall, you'll probably save more power with the GPU driver loaded than just leaving the GPU in the state set up by the bios.

1) You're absolutely right. radeon outperforms fglrx significantly in console mode (in my case 10W up to 12W when disabling the output) (and not to mention the Turbo Core performance which is much smoother).

2) You inspired me to look at all this more systematically. I have posted my detailed results at http://unix.stackexchange.com/a/148918/79761 -- in short, the radeon driver is an excellent piece of software (and is in fact saving my *** regarding processor choice, applying the bapm enabling patch you proposed).

3) One question remains -- can't bapm enabling become at least a parameter? Or is it already?

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#12 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #11 from Alex Deucher <[email protected]> --- (In reply to LiNuxXer from comment #10)

Quoted 3 lines

3) One question remains -- can't bapm enabling become at least a parameter? Or is it already?

Yes, I can add a module parameter to force it on.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#14 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #13 from LiNuxXer <[email protected]> --- (In reply to Alex Deucher from comment #11)

Quoted 1 line

Yes, I can add a module parameter to force it on.

That's great news, thank you! I was beginning to think that I'd have to compile my kernel from now on.

BTW, I noticed that /sys/kernel/debug/dri/0/radeon_pm_info will report "power level 1" when /sys/devices/system/cpu/cpufreq/boost is set to 0 (with bapm patch, didn't test the unpatched version), while it always reported "power level 0" in my console scenario under all other circumstances. Since I could not notice any difference in power consumption, I was wondering what this actually means.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#15 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=81021

--- Comment #14 from Alex Deucher <[email protected]> ---
The information in radeon_pm_info represents the current GPU power state. It will vary dynamically with GPU load. E.g., if you are rendering stuff on your desktop, the GPU clocks and voltages will ramp up/down on demand. In the console without X running, there is no GPU engine load so the clocks stay low. Note that display requirements can also influence the GPU power state. E.g., if you have a large display that requires higher display clocks, the GPU may have to boost the power state to accomodate the higher voltage requirements of the display.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.