Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use amd_pstate scaling driver #1243

Open
Mushoz opened this issue Nov 27, 2023 · 26 comments
Open

Unable to use amd_pstate scaling driver #1243

Mushoz opened this issue Nov 27, 2023 · 26 comments

Comments

@Mushoz
Copy link

Mushoz commented Nov 27, 2023

Your system information

  • Steam client version: Latest
  • SteamOS version: 3.5.7
  • Opted into Steam client beta?: No
  • Opted into SteamOS beta?: No
  • Have you checked for updates in Settings > System?: Yes

Please describe your issue in as much detail as possible:

Steps to reproduce:

  1. Edit /etc/default/grub and add amd_pstate=passive to the "GRUB_CMDLINE_LINUX_DEFAULT" line
  2. Run update-grub
  3. Reboot
  4. Read dmesg

Expected outcome:

  1. The amd_pstate scaling driver is loaded

Actual outcome:

  1. dmesg shows unknown kernel command line parameters amd_pstate=passive, will be passed to user space.

Notes:

  1. amd_pstate is supported since kernel 5.19. Since SteamOS is using 6.1, it should work, but it does not.
@guilhermepiccoli
Copy link

Hi, could you try running zcat /proc/config.gz |grep AMD_PSTATE and pasting the result here?

I'm not sure if this module is included in the kernel.
Thanks!

@RodoMa92
Copy link

Can confirm it's broken since CPPC is not available at a BIOS level. You can manually enable it by using third party tools but from what I've read it just ends with a bricked Deck after a reboot.

Can your firmware team include the necessary firmware support?

Thanks,

Marco.

@RodoMa92
Copy link

Hi, could you try running zcat /proc/config.gz |grep AMD_PSTATE and pasting the result here?

I'm not sure if this module is included in the kernel.
Thanks!

Not sure if it's even enabled on SteamOS but it doesn't matter since there is no firmware support.

@Mushoz
Copy link
Author

Mushoz commented Nov 28, 2023

Hi, could you try running zcat /proc/config.gz |grep AMD_PSTATE and pasting the result here?

I am currently not at home, but I will be able to do that as soon as I am.

Can confirm it's broken since CPPC is not available at a BIOS level. You can manually enable it by using third party tools but from what I've read it just ends with a bricked Deck after a reboot.

Can your firmware team include the necessary firmware support?

That's very unfortunate to hear. I am seeing very nice efficiency gains with my AMD laptop with amd_pstate. And I strongly suspect that it could also bring some nice gains to the steam deck as well. In some games, the CPU is clocking up way too aggressively, wasting power, despite a frame rate cap in place. Lowering the max CPU frequency massively cuts down on power usage (at times over 6 watts of saved power!), despite identical performance since it's still hitting the frame rate cap.

Setting a manual max frequency limit is not very convenient though, since it heavily depends on the area of the game what frequency limit is sufficient to hit the frame rate cap, and it cannot deal with suddenly CPU load spikes. I am hoping a better scaling driver will give me the power savings, without having to manually fiddle with frequencies to get it just right.

Any chance this will be implemented in the future?

@Mushoz
Copy link
Author

Mushoz commented Nov 28, 2023

Some more information / observations here: https://wiki.archlinux.org/title/Talk:Steam_Deck#Enabling_CPPC

Looks like Bazzite is also waiting for Valve to fix the CPPC issues in the firmware. lscpu | grep -i cppc does show support for CPPC on the Deck's CPU.

@RodoMa92
Copy link

RodoMa92 commented Nov 28, 2023

Replying to #1243 (comment)

Yeah, same thing on my end. Standard ACPI power scaling just offer like 3/4 frequency max, and they are not granular enough to allow decent scaling of the Deck CPU. It is even more important for a portable device like the Deck, where every wh of battery matter.

I got positively impressed when I tried to enable the same on my AMD laptop, the additional frequencies allow the system to get far better performance with much less cooling needed.

Oh, I'm a Bazzite user now, and I can confirm that the module itself just complain for the missing tables and unload from the kernel.

@Mushoz
Copy link
Author

Mushoz commented Nov 28, 2023

@RodoMa92 There has been an updated bios as well as part of SteamOS 3.5 release. The reports that enabling CPPC would result in a nonbootable Steam Deck are quite old already. It might be worth a try to enable it, and see if it works on this newer bios version. Resetting the UEFI in case of a non-bootable Steam Deck should be trivial, but try at your own risk. This page shows how to reset the UEFI, and also how to unlock the extra options that allow you to toggle CPPC in the first place: https://wiki.archlinux.org/title/Steam_Deck

I can also have a go at this once I am home to confirm/deny whether CPPC is still broken on the Steam Deck.

@RodoMa92
Copy link

RodoMa92 commented Nov 28, 2023

@RodoMa92 There has been an updated bios as well as part of SteamOS 3.5 release. The reports that enabling CPPC would result in a nonbootable Steam Deck are quite old already. It might be worth a try to enable it, and see if it works on this newer bios version. Resetting the UEFI in case of a non-bootable Steam Deck should be trivial, but try at your own risk. This page shows how to reset the UEFI, and also how to unlock the extra options that allow you to toggle CPPC in the first place: https://wiki.archlinux.org/title/Steam_Deck

I can also have a go at this once I am home to confirm/deny whether CPPC is still broken on the Steam Deck.

Problem is, Valve patched out the hidden menu on the newer BIOS revision, so that's impossible to test. The only one that can enable them are Valve, and Valve only, until someone is being able to modify the BIOS again.

It might be possible to enable the option on a lower unpatched firmware rev and then just update to the later rev, but if the deck hard lock good luck flashing a newer bios revision. I don't even get why they are trying to lock down bios modification while moving to an Open Source bios, but that's another issue.

@Mushoz
Copy link
Author

Mushoz commented Nov 28, 2023

Replying to #1243 (comment)

I did not know that. That's a bummer to hear. I guess we will have to wait for an official statement from Valve. Hopefully one of their employees can chime in on this issue in this thread.

@RodoMa92
Copy link

RodoMa92 commented Dec 1, 2023

One of the devs of Bazzite confirmed that on the OLED model amd_pstate load by default with no BIOS changes needed.

Valve, do I need to buy another unit for having correct firmware support for it? Why this has not been enabled on the LCD model?

@Mushoz
Copy link
Author

Mushoz commented Dec 15, 2023

@RodoMa92 I am assuming even the OLED model won't be able to use this under SteamOS, right? As the kernel module isn't even included in the SteamOS. So even for them it's not going to plug and play, and will have to switch to Bazzite or other custom distros to use it.

Valve, are there any plans to:

  1. Enable firmware support for the LCD models to reach feature parity with the OLED models?
  2. Add the kernel module to SteamOS?

The confusing thing is, is that the amd_pstate driver was a joint effort of AMD + Valve for higher efficiency on the Zen architecture. Yet now that it's available, it's nowhere to be seen on Valve's Steamdeck. It's disappointing to say the least.

See news article about this here: https://www.phoronix.com/news/AMD-P-State-XDC2021

@RodoMa92
Copy link

RodoMa92 commented Dec 15, 2023

Replying to #1243 (comment)

From a quick look to these two config files I do not see any enablement of the amd_pstate module, so I would be inclined to say yes on the not working pstate on OLED using SteamOS.
See here and here as my references.

Considering the multiple firmware breakages lately I'm not even sure what the firmware team is doing right now (or even if it exists, haven't seen anywhere in this repo regarding firmware issues).

@coolbho3k
Copy link

coolbho3k commented Dec 18, 2023

I emailed Plagman about this in November last year and they are definitely aware of it. It might not be as simple as it sounds underneath.

Screenshot 2023-12-18 at 2 49 43 PM Screenshot 2023-12-18 at 2 49 53 PM

@RodoMa92
Copy link

RodoMa92 commented Dec 19, 2023

Replying to #1243 (comment)

Then why enable it on OLED which is basically the same APU but node shrinked? Feels odd that one platform is supported but basically the same is not. Firmware are extremely similar between the two also.

@coolbho3k
Copy link

coolbho3k commented Dec 19, 2023

Replying to #1243 (comment)

I didn’t know that it was enabled on OLED. I mean it’s a different branch of the BIOS, and there seem to be a lot more changes to the hardware than just the die shrink, I read that they made some other changes to the silicon. The good news is they clearly have interest in it so hopefully it’s possible for them to add to the LCD deck.

@Mushoz
Copy link
Author

Mushoz commented Dec 19, 2023

@coolbho3k When was this email conversation with plagman?

@Plagman Would if be possible to comment on this issue? Whether there has been any updates since that email conversation, especially now that firmware support does seem to be enabled with the OLED models?

@unclejack
Copy link

@RodoMa92: @coolbho3k is probably right. This might actually have been broken or somehow incomplete in the original silicon for the original APU. It's likely this is the case due to the fact that the OLED has it enabled. It's either that or it's work which nobody had the time to do yet. Either way, it's all speculation without a clear statement. It might not be easy to provide an answer if there's some kind of blocker.

It'd be great to have full pstate support and proper power management. These things are pretty toasty, even in winter.

@RodoMa92
Copy link

RodoMa92 commented Dec 21, 2023

@RodoMa92: @coolbho3k is probably right. This might actually have been broken or somehow incomplete in the original silicon for the original APU. It's likely this is the case due to the fact that the OLED has it enabled. It's either that or it's work which nobody had the time to do yet. Either way, it's all speculation without a clear statement. It might not be easy to provide an answer if there's some kind of blocker.

It'd be great to have full pstate support and proper power management. These things are pretty toasty, even in winter.

I would not really be happy to know that they shipped broken silicon but that's besides the point: I want a direct statement on the why this hasn't been enabled yet, or why it's not possible when OLED has already (allegedly) everything in place. I'm not asking much here. If you want to sell an open platform with Linux people expect at least a resemblance of transparency, as is the standard for Linux devs. Can't really see much of this lately, if ever, especially if the issues are rooted in this quite buggy firmware.

@RodoMa92
Copy link

Any update on this, Valve?

@RodoMa92
Copy link

Saw that you exposed overclocking in the OLED bios update, but not on the LCD one. I guess that this issue is why it hasn't been enabled, since CPPC is still broken on 121. Can someone chime in this 2 months thread now with some clarification on this?

@syberphunk
Copy link

Saw that you exposed overclocking in the OLED bios update,

Which makes me wonder if we're going to see the limit raised in amdgpu, due to #1309 and https://gitlab.freedesktop.org/drm/amd/-/issues/2638 in the current stable release we can't go above 3.5ghz anyway, yet the maxcpu setting allows up to 4.2ghz on the cpu.

@syberphunk
Copy link

but not on the LCD one

Have you tested this?

@RodoMa92
Copy link

but not on the LCD one

Have you tested this?

Yep, the options are not there at all.

@RodoMa92
Copy link

It's finally fixed with bios 131 on LCD, this issue can be closed. It's still not available on stock SteamOS since valve doesn't compile it in AFAIK, but on Bazzite is working 100% fine. Why noone at Valve never communicated this here I'm not sure and I still dislike that, but at least Valve/AMD delivered on this. Thanks :)

@Mushoz
Copy link
Author

Mushoz commented Apr 25, 2024

It's finally fixed with bios 131 on LCD, this issue can be closed. It's still not available on stock SteamOS since valve doesn't compile it in AFAIK, but on Bazzite is working 100% fine. Why noone at Valve never communicated this here I'm not sure and I still dislike that, but at least Valve/AMD delivered on this. Thanks :)

While that is definitely good news (thanks for reporting by the way!), I do think it's better to leave this issue open. I would really like Valve to implement this in stock SteamOS as well, as it's a beneficial change that could easily be implemented via a software upgrade.

@RodoMa92
Copy link

It's finally fixed with bios 131 on LCD, this issue can be closed. It's still not available on stock SteamOS since valve doesn't compile it in AFAIK, but on Bazzite is working 100% fine. Why noone at Valve never communicated this here I'm not sure and I still dislike that, but at least Valve/AMD delivered on this. Thanks :)

While that is definitely good news (thanks for reporting by the way!), I do think it's better to leave this issue open. I would really like Valve to implement this in stock SteamOS as well, as it's a beneficial change that could easily be implemented via a software upgrade.

Yeah, I was positively surprised by that. I had the suspicion since it jumped from 121 to 131 (ten revisions), so potentially a lot of changes has gone in (and the fact that they exposed the max clock setting for both GPU and CPU, which I had the suspicion CPPC was a prerequisite for supporting that).

Valve, please at least mention changes somewhere in your firmware revisions instead of letting people guessing your changes. Either git messages or somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants