Which release version? 24.04.1 LTS
(if rolling release without a release version, skip this question)
(If rolling release, last date updated?)
Which kernel are you using? 6.8.0-45-generic
Which BIOS version are you using? 3.03 (I think)
Which Framework Laptop 16 model are you using? AMD Ryzen™ 7040 Series - batch 10
I have my laptop configured to sleep when the lid is closed. I think it does go into some form of sleep (the display switches off) but it wakes up quickly when I open the lid. Reconnecting to wifi takes way longer than I’d expect (maybe a minute or so) but that’s not my biggest gripe.
My biggest gripe is how quickly the battery drains whilst “sleeping”. I reckon it’ll go from close to 100% charged to flat in under 24 hours. I seem to remember investigating this previously and found something about AMD not supporting deep sleep mode.
Debugging script for s2idle on AMD systems
Framework Laptop 16 (AMD Ryzen 7040 Series) (16in Laptop) running BIOS 3.3 (03.03) released 03/27/2024 and EC unknown
Ubuntu 24.04.1 LTS
Kernel 6.8.0-45-generic
Battery BAT1 (NVT FRANDBA) is operating at 103.99% of design
Checking prerequisites for s2idle
Logs are provided via systemd
AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (family 19 model 74)
ASPM policy set to ‘default’
SMT enabled
LPS0 _DSM enabled
ACPI FADT supports Low-power S0 idle
HSMP driver amd_hsmp not detected (blocked: False)
PMC driver amd_pmc loaded (Program 0 Firmware 76.82.0)
USB4 driver thunderbolt bound to 0000:c3:00.5
USB4 driver thunderbolt bound to 0000:c3:00.6
GPU driver amdgpu bound to 0000:c1:00.0
System isn’t configured for s2idle in firmware setup
NVME Samsung Electronics Co Ltd NVMe SSD Controller S4LV008[Pascal] is configured for s2idle in BIOS
GPIO driver pinctrl_amd available
Device firmware checks unavailable without fwupd gobject introspection
Your system does not meet s2idle prerequisites!
Explanations for your system
The system hasn’t been configured for Modern Standby in BIOS setup
AMD systems must be configured for Modern Standby in BIOS setup
for s2idle to function properly in Linux.
On some OEM systems this is referred to as ‘Windows’ sleep mode.
If the BIOS is configured for S3 and you manually select s2idle
in /sys/power/mem_sleep, the system will not enter the deepest hardware state.
However, I can’t see anything in the BIOS that looks related to “modern standby”.
Has anyone solved this problem? Am I missing something obvious?
Ah, thanks. I’ve done that and got to the stage of running sleep cycles. Output:
Debugging script for s2idle on AMD systems
Framework Laptop 16 (AMD Ryzen 7040 Series) (16in Laptop) running BIOS 3.3 (03.03) released 03/27/2024 and EC unknown
Ubuntu 24.04.1 LTS
Kernel 6.8.0-45-generic
Battery BAT1 (NVT FRANDBA) is operating at 103.99% of design
Checking prerequisites for s2idle
Logs are provided via systemd
AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (family 19 model 74)
ASPM policy set to ‘default’
SMT enabled
LPS0 _DSM enabled
ACPI FADT supports Low-power S0 idle
HSMP driver amd_hsmp not detected (blocked: False)
PMC driver amd_pmc loaded (Program 0 Firmware 76.82.0)
USB4 driver thunderbolt bound to 0000:c3:00.5
USB4 driver thunderbolt bound to 0000:c3:00.6
GPU driver amdgpu bound to 0000:c1:00.0
System is configured for s2idle
NVME Samsung Electronics Co Ltd NVMe SSD Controller S4LV008[Pascal] is configured for s2idle in BIOS
GPIO driver pinctrl_amd available
Device firmware checks unavailable without fwupd gobject introspection
How long should suspend cycles last in seconds (default 10)? 1200
How long to wait in between suspend cycles in seconds (default 4)?
How many suspend cycles to run (default 1)? 2
Running 2 cycles (Test finish expected @ 2024-10-09 23:52:53.468352)
Suspend cycle 1: Started at 2024-10-09 23:12:47.481838 (cycle finish expected @ 2024-10-09 23:32:51.481891)
Results from last s2idle cycle
○ Suspend count: 1
○ Hardware sleep cycle count: 1
○ Wakeup triggered from IRQ 9: ACPI SCI
○ Woke up from IRQ 9: ACPI SCI
○ gpe0B increased from 204 to 226
Userspace suspended for 0:20:02.201474
In a hardware sleep state for 0:19:58.635559 (99.70%)
Battery BAT1 lost 22000 µAh (0.39%) [Average rate: 0.01A]
Suspend cycle 2: Started at 2024-10-09 23:32:51.687673 (cycle finish expected @ 2024-10-09 23:52:55.687706)
Results from last s2idle cycle
○ Suspend count: 1
○ Hardware sleep cycle count: 1
○ GPIOs active: [‘84’]
○ Wakeup triggered from IRQ 9: ACPI SCI
○ Woke up from IRQ 9: ACPI SCI
○ gpe0B increased from 226 to 248
Userspace suspended for 0:20:01.998700
In a hardware sleep state for 0:19:58.305419 (99.69%)
Battery BAT1 lost 17000 µAh (0.30%) [Average rate: 0.01A]
99.something% sounds good in theory but 0.3% - 0.39% battery loss in 20 minutes doesn’t seem great, that’s ~1% per hour meaning full battery drain in ~4 days. That feels slower than I’ve seen so far (I reckon I’ve seen losses of ~70% overnight but I’ll need to experiment to check that) but it’s way faster than I’d expect (my old Macbook Pro would retain its charge for … weeks?).
My battery is at 50% right now so after posting I’ll close the lid … and see where we are in the morning!
Ok ~9h later the battery has dropped 9% … ~1%/hr which tallies with what I saw in the s2idle report. I don’t think that’s very good. What can I do to improve that power loss?
Over s2idle if you’re hitting the hardware sleep state only encountered one hardware sleep cycle, and it was for the majority of the time you’re at the most that can be optimized from a pure software perspective.
The times that you can still optimize from software is when that residency is low or it keeps waking from hardware sleep multiple times.
If there are any other improvements to be made for this design they would be firmware or hardware changes.
Hardware changes - seem limited to … none … given it’s a FW laptop and there are no h/w options to improve sleep time AFAIK.
Firmware changes … have there been any to improve sleep time?
Is this the sort of performance everyone using Ubuntu is getting? ISTR someone running Windows is getting much better performance. Something about Linux not supporting deep sleep on AMD whereas Windows does ? Seems rather sucky…
If we assume that the laptop was operating at approximately nominal voltage, we should be able to calculate watts:
Using the second reading as an example:
30000 µA * hr / 20 minutes * 60 minutes/hr == 90000 µA
90000 µA / 1000000 µA/A = 0.09 A
0.09 A * 15.48V == 1.3932 W
…but the reading from the script seems to have two significant digits, so it’s best to round that off to 1.4 W.
The first reading calculates to 1.7 W.
This is pretty consistent with the AC power draw I read at the wall while the laptop is suspended and the battery is fully charged. I read 1.3 +/- 0.3 W at the wall (the reading fluctuates).
Some variance of power draw could be due to the type and amount of RAM present. While the laptop is suspended, the RAM must stay active in order to not lose data.
@Corey_Hickey “What’s typical for a laptop?” … I don’t know either so I’m simply going by my old (2014?) Macbook Pro where I don’t remember it losing any significant battery whilst the lid was closed and it didn’t take a super long time to wake up. But they’re pretty vague memories right now, I guess the point is I didn’t do anything special, its power retention was good out of the box. The chromebook I use for work also doesn’t seem to lose much power overnight but then I pay less attention to it because it’s plugged in regardless of whether I’m working from the office or home.,
Whereas Framework + Ubuntu the power retention out of the box is … well, rubbish.
But I think I’ve now got to a point where I’m happy with it. Not quite perfect though. I’ve got hibernate working (overnight the battery lost <1% so I anticipate minimal losses over a week or two). The key was to disable secure boot … which took me ages to find. Hitting F12 during boot took me to a menu where I couldn’t find any secure boot option, only boot order. Until I stumbled upon something that says you need to hit F2 during boot. Bingo! (WHY is it like this I wonder?!).
Anyway, secure boot disabled, swap partition set up and hibernate works. Now I just need to figure out suspend-then-hibernate (I’ve got “Enable hibernate after suspend” ticked in the poower management app but no indication of time the laptop remains suspended before it hibernates. Coming out of hibernation takes a little while, I haven’t timed it but 10-15 seconds sounds about right but then I guess 64Gb of memory takes a while to repopulate. Although I’m only using ~4Gb atm so maybe there’s some optimization that’s possible (my SSD is rated at 3Gb/sec IIRC … maybe I should test what I actually get ).
@James3 I agree. According to the manufacturer (Kingston) my RAM “draws 1.1V” but of course that’s not a power figure so is pretty useless on its own. My tests show the laptop needs ~1-1.6W whilst suspended, I assume that’s mostly for the RAM but