Lenovo's Platform Profile Support For AMD Systems On Linux Has Been Busted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • reba
    replied
    Originally posted by markpearson View Post
    As a note - a BIOS update won't have any impact on this and given the security vulnerabilities that are being disclosed this week I strongly recommend updating.
    GXCN36WW is dated 25 Oct 2021, so it's not very recent either.

    The changelog for this and for previous releases do not mention any security related changes.
    If those are part of the update they should have been mentioned.


    Changelogs in detail:

    GXCN36WW:
    1. Fix ftpm nvram carsh will popup messagebox when unit post up.

    GXCN32WW:
    1. Implement Natural File Guard feature and close CPU OC for R9.
    2. Fix 0x5C BSOD issue.
    3. Add memory down SPD follow EE request.
    4. Remove super key 1.0 support.
    5. Fix Hotkey mode cannot sync when restart /shutdown /S4.

    GXCN31WW:
    1. Enable RWLAN PLDR support.

    GXCN28WW:
    1. In BIOS menu hides 0A2 information.


    To be fair I think the changelogs are not very expressive and I'd like to know what the changes are and what they do... "Remoce Super Key 1.0 Support"? "Close CPU OC"?
    Is this good? Is my machine getting limited by this?


    Originally posted by markpearson View Post
    I've got a couple of other notes on platforms - but the only thing to be aware is that when 5.17 comes out the platform profiles may stop working on your machine. Depending on what the BIOS is advertising is supported. Hopefully by 5.18 I'll have the updated driver available.
    I've read about the kernel checking for support before enabling access to platform_profile, I assume what you are referring to is the quote from this very article? "Disabled on AMD systems"

    Originally posted by markpearson View Post
    Glad the platform is working well for you!
    Mark
    Yes, I am also very glad and I don't want to break it.

    Leave a comment:


  • markpearson
    replied
    Originally posted by reba View Post

    There's a BIOS update available (GXCN36WW) and normally I'd install it... this time... I won't.
    As a note - a BIOS update won't have any impact on this and given the security vulnerabilities that are being disclosed this week I strongly recommend updating.

    I've got a couple of other notes on platforms - but the only thing to be aware is that when 5.17 comes out the platform profiles may stop working on your machine. Depending on what the BIOS is advertising is supported. Hopefully by 5.18 I'll have the updated driver available.

    Glad the platform is working well for you!
    Mark

    Leave a comment:


  • reba
    replied
    Originally posted by markpearson View Post
    For those of you above who are seeing the profiles working would you mind letting me know which platforms that's on? If you don't want to post publicly then email markpearson at lenovo dot com. I have a limited subset of the AMD platforms on hand and if it's working on some and not others it would be useful to know. I don't have access to any of the Ideapads or Thinkbooks (they're not currently in the Lenovo Linux program) and I'm intrigued if the implementation there is different. As an aside - lots of great detail above which is really useful (thank you!).
    Thank you markpearson for getting in touch. :hearth:

    Like written above the unit is a Lenovo ThinkBook 16p Gen 2 ACH 20YM.

    I know they're not officially supported by Lenovo to run on Linux but in reality it really runs stellar.

    I can't point to any component which is not fully supported and working perfectly: Audio, WiFi, Bluetooth, FN+Space, FN+L, Keyboard Backlight, Display Backlight, S0-idle, switching the NVIDIA GPU fully off and on, having stuff run on the NVIDIA unit, Battery information, Battery Conservation Mode, etc etc etc etc.... awesome!
    The only thing not working is the fingerprint reader but I never intended to use it anyway.

    Okay, back to topic

    Code:
    $ inxi --system --machine --cpu
    System:
      Host: debian Kernel: 5.16.5-xanmod1 x86_64 bits: 64
        Desktop: KDE Plasma 5.23.5 Distro: Debian GNU/Linux bookworm/sid
    Machine:
      Type: Laptop System: LENOVO product: 20YM v: Lenovo ThinkBook 16p Gen 2
        serial: <superuser required>
      Mobo: LENOVO model: LNVNB161216 v: SDK0T08861 WIN
        serial: <superuser required> UEFI: LENOVO v: GXCN31WW date: 06/09/2021
    CPU:
      Info: 8-core model: AMD Ryzen 9 5900HX with Radeon Graphics bits: 64
        type: MT MCP cache: L2: 4 MiB
      Speed (MHz): avg: 3289 min/max: 400/4680 cores: 1: 3365 2: 3474 3: 3270
        4: 3268 5: 3265 6: 3268 7: 3263 8: 3267 9: 3267 10: 3265 11: 3391 12: 3306
        13: 3165 14: 3267 15: 3268 16: 3270
    There's a BIOS update available (GXCN36WW) and normally I'd install it... this time... I won't.

    This is just an overview for you as I think you'd be interested in more technical stuff.
    Tell me what you need and I'll see what I can do.
    Last edited by reba; 04 February 2022, 04:38 PM.

    Leave a comment:


  • reba
    replied
    Originally posted by shinypail17 View Post
    reba Juding by the high PPT limit in the default balanced mode this would be a gaming notebook like the Lenovo Legion?

    AFAIK the whole AMD ThinkPad lineup has broken platform profiles while it works well for the others, likely due to a different BIOS vendor or implementation.
    The unit is a Lenovo ThinkBook 16p Gen 2 ACH, something like the "business attire" version of the upcoming Legion 7 Slim, here's a review with some more technical infos.

    Leave a comment:


  • markpearson
    replied
    Hi,

    I'm the person who wrote the driver so wanted to add a couple of note. My apologies to the Lenovo AMD platform users who got hit by this. It's all my mistake and not something nefarious from Lenovo. I'll add some notes on the history/process below for those with insomnia

    For those of you above who are seeing the profiles working would you mind letting me know which platforms that's on? If you don't want to post publicly then email markpearson at lenovo dot com. I have a limited subset of the AMD platforms on hand and if it's working on some and not others it would be useful to know. I don't have access to any of the Ideapads or Thinkbooks (they're not currently in the Lenovo Linux program) and I'm intrigued if the implementation there is different. As an aside - lots of great detail above which is really useful (thank you!).

    To add history for those that are interested: I got the details about 'MMC' mode for doing the platform profiles and implemented the driver. I'm still new enough to the upstream process that it took some time and back and forth. Lots of learning and changes along the way with guidance from the maintainer (thanks!) before we had an implementation that works for all vendors.

    I have a bunch of platforms (Intel and AMD) and tested on them but in this case I was mostly developing on an Intel platform. This feature hasn't been through our official QA process - partly as it hasn't landed in any preloads we do yet, but it also wasn't a commited feature; it was my pet/abckground project. I spend waaaay too much time in meetings/bug management/etc and doing some coding is my way of getting back some sanity - I did this feature because I thought it would be useful, but mostly for fun.

    Somehow I missed the fact that it wasn't working on the AMD platforms - I thought it was but then started getting reports it wasn't doing anything. I dug into it a bit, muttered some rude words, and created the patch this article references as a short term fix.

    There is another profile mode available for AMD platforms which I'm looking into. I've done an initial implementation but need some more details from the FW team for testing/usage before I can release - but it is in my plans.

    Mark

    Leave a comment:


  • reba
    replied
    Originally posted by pegasus View Post
    What if you want to go lower than 15W, say permanent fixed 400MHz clock? Is this doable?

    I remember about 10yrs ago I managed to get one of the 51xx xeons to run at 200MHz. That was fun ...
    Yes.
    Setting the CPU Governor to Powersave keeps the cores at 400 MHz (shown here as 0,4 MHz, that's a bug), even at 100% usage.

    The selected Platform Profile doesn't really make a difference here as requested wattage (around 4,6 W) is way below the profile's max (15/60/65 Watt); also timings don't matter much here:


    Idling with Powersave Governor results in a Power Usage of around 2,1W:



    The lowest power usage for this unit is with CPU Governor Powersave and the display switched off. With the display off the iGPU can now throttle down, too.

    Stopping programs and the DE, switching off WiFi & Co helps, of course, too, but that's not a system "in use".
    Last edited by reba; 03 February 2022, 03:43 AM.

    Leave a comment:


  • pegasus
    replied
    What if you want to go lower than 15W, say permanent fixed 400MHz clock? Is this doable?

    I remember about 10yrs ago I managed to get one of the 51xx xeons to run at 200MHz. That was fun ...

    Leave a comment:


  • shinypail17
    replied
    reba Juding by the high PPT limit in the default balanced mode this would be a gaming notebook like the Lenovo Legion?

    AFAIK the whole AMD ThinkPad lineup has broken platform profiles while it works well for the others, likely due to a different BIOS vendor or implementation.

    Leave a comment:


  • reba
    replied
    I made some measurements with s-tui+stress and the three different platform_profiles, in case anybody is interested...


    1.
    CPU Governor: Performance
    Platform Profile: Balanced
    Stress: No (Idle)


    -> Quite high core clocks (15x 4,7 GHz + 1x 3,3 GHz... eehh...) because of the running AMD P-State CPPC Driver. With CPU Governor Powersafe they idle at 16x 0,4 GHz.


    2.
    CPU Governor: Performance
    Platform Profile: Low-Power
    Stress: Yes


    -> With stress active, CPUs go up to 16x 2,1 GHz and stay there


    3.
    CPU Governor: Performance
    Platform Profile: Balanced
    Stress: Yes


    -> CPUs go up to 16x 3,8 GHz


    4.
    CPU Governor: Performance
    Platform Profile: Performance
    Stress: Yes


    -> CPUs reach 16x 3,9 GHz; although a core could go up to 4,7 GHz as we've seen at the Idle test above


    5.
    CPU Governor: Performance
    Platform Profile: Performance
    Stress: Yes, running for some time


    -> CPUs stay at 3,9 GHz but thermal throttling kicks in (see the pits in the graphs) to limit temperatures to around 86 °C


    I conclude: it has an effect




    Edit:
    Notice the shown Power usages in Watt by s-tui and compare them to the RyzenAdj-output from my post above:

    Code:
    low-power:
    | PPT LIMIT FAST      |    15.000 | fast-limit         | <---
    balanced:
    | PPT LIMIT FAST      |    60.000 | fast-limit         | <---
    performance:
    | PPT LIMIT FAST      |    65.000 | fast-limit         | <---
    The CPU power usage in each test-case matches the given limit absolutely spot on! Amazing!
    Last edited by reba; 02 February 2022, 12:32 PM.

    Leave a comment:


  • kylew77
    replied
    People on Reddit ask me why power management is so messed up in the *BSDs when companies literally sell laptops with Linux preinstalled and can't get power management done right!

    Leave a comment:

Working...
X