Skip to content

SB3: system total power limit at 25 watts, including display backlight #117

Open

Description

@yatli

This is observed by using s-tui to continuously monitor the power consumption, core frequency and utilization while compiling the kernel.

Running a "cold start", the system power peaks at 40 watts, and then drops to 25 watts (could be a thermal trip point, or a "long time power limit"?), where the CPU package draws 16 watts, resulting in all-core frequency at 1.6GHz. Core temperature stabilizes at 71C.

Curiously, I lowered the screen brightness to 5%, and the CPU package starts to draw more power (20+ watts) and all-core frequency goes up to 2.0GHz. Core temperature stabilizes at 78C.

So this does not solely look like a thermal throttle -- but where does that 25W limit come from?

Activity

  1. qzed commented on Feb 18, 2022

    @qzed
    Member

    Could be some total system limit for sustained power imposed by firmware. Did you try changing the performance mode?

  2. yatli commented on Feb 18, 2022

    @yatli
    Author

    I don't have "performance mode" -- there's no /sys/bus/surface_aggregator/devices/01:03:01:00:01/perf_mode.
    I did try all the profiles -- no difference it seems.

  3. qzed commented on Feb 18, 2022

    @qzed
    Member

    Yeah sorry, meant platform profiles (those and performance modes are the same).

  4. yatli commented on Feb 18, 2022

    @yatli
    Author

    Edit: see below.

    After some more experiment with a stress tool I find it's thermal-related and not bound to a sustained loaded time. The peak power could sustain for 2 seconds, 5 seconds and so on.

    And the power limit kicks in when the core goes over 90C degrees.
    I'll see if I can work out a thermald configuration for this model.

  5. yatli commented on Feb 18, 2022

    @yatli
    Author

    Just feel this is funny that I should share the story with you guys :D

  6. reopened this on Feb 18, 2022
  7. yatli commented on Feb 18, 2022

    @yatli
    Author

    Have to reopen this because thermald/rapl is not effective against this problem. It's like a power budget, not thermal throttle -- the same 25 watts can well push the core to 80C (dimmed screen) but a thermal limit at 70C (like ~20 watts in total) already triggers the power limit!

  8. yatli commented on Feb 18, 2022

    @yatli
    Author

    btw, the fan is not as fast (loud) as in Windows. A profile configuration issue?

  9. yatli commented on Feb 18, 2022

    @yatli
    Author

    So, is there a way I can intercept SAM messages under windows?

  10. qzed commented on Feb 18, 2022

    @qzed
    Member

    btw, the fan is not as fast (loud) as in Windows. A profile configuration issue?

    AFAIK the fan is entirely controlled by SAM, and the only influence we or Windows can have on that is the platform profile/performance mode. Try setting that to "best performance".

    So, is there a way I can intercept SAM messages under windows?

    Yes, although it requires a bit of configuration and the dumps are not easily readable (you're of course welcome to write a better parser for that). There's an overview on how to do that here: https://github.com/linux-surface/surface-aggregator-module/wiki/Development. A script for transforming the output into json files is here. Documentation on the commands we know so far is here. An overall documentation on the protocol can be found at https://www.kernel.org/doc/html/latest/driver-api/surface_aggregator/ssh.html.

  11. yatli commented on Feb 18, 2022

    @yatli
    Author

    Here are the two related entries when I toggle between Better Performance vs. Best Performance:

    {"ctrl": {"type": 128, "len": 12, "pad": 0, "seq": 42}, "cmd": {"type": 128, "tc": 3, "outgoing": 1, "incoming": 0, "iid": 0, "rqid_lo": 83, "rqid_hi": 3, "cid": 3}, "payload": [3, 0, 0, 0]}
    {"ctrl": {"type": 128, "len": 12, "pad": 0, "seq": 46}, "cmd": {"type": 128, "tc": 3, "outgoing": 1, "incoming": 0, "iid": 0, "rqid_lo": 87, "rqid_hi": 3, "cid": 3}, "payload": [4, 0, 0, 0]}

    ...which matches the documented values.
    le32 though?

  12. yatli commented on Feb 18, 2022

    @yatli
    Author

    Just checked the module. le32 indeed no problem.

  13. qzed commented on Feb 18, 2022

    @qzed
    Member

    Yeah, le32 is correct.

  14. qzed commented on Feb 18, 2022

    @qzed
    Member

    All multi-byte values in the protocol are little-endian.

  15. 38 remaining items

  16. qzed commented on Mar 11, 2022

    @qzed
    Member

    Well, as far as I can tell there's no way to control the fans other than setting the profile, which controls the fan curve. At least on my SB2, the dGPU fan behaves similarly with the profiles. Did you monitor temperatures when comparing by any chance?

  17. yatli commented on Mar 11, 2022

    @yatli
    Author

    Yeah I keep s-tui around for monitoring temperature -- not as good as ThrottleStop on Windows though because I don't see hardware throttle "reasons".

    On turbo max, it ramps up quickly to 100C. Then the power limit kicks in, temperature drops back to 80C.
    Depending on the cooling capacity (determined by fan speed), the temperature will then either go up or down.

  18. yatli commented on Mar 22, 2022

    @yatli
    Author

    Update -- I'm seeing another kind of throttling.

    Yesterday I put it in sleep-then-hibernate but the battery is drained to 0%.

    On boot today, I see very slow screen update in GRUB, and when the system boots up, I see the cores are throttled down to 200MHz, BAT at 0%.

    Interestingly, as BAT goes up (lucky it still does!), the throttling decreases. Now I'm at BAT=18% and the throttling goes up to 900MHz all core.

    That reminds me of the "original theory" you had -- it doesn't think it's plugged in so it schedules power limits as if it's on battery.

  19. qzed commented on Apr 28, 2022

    @qzed
    Member

    I wonder if something similar can also be observed on other non-Surface devices. Could be some Intel related thing?

  20. added a commit that references this issue on Apr 20, 2023
  21. added a commit that references this issue on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions