Hibernate fails / sleep drains battery

I’m trying manjaro for the first time, and I’m trying linux on laptop for the first time. I have used Gentoo on servers for 15+ years, but I have never used linux on my laptops before. I’ve ran into a few issues. Two of them might be related, so I’ll ask about both in this thread.

The laptop is a Clevo L140cu. It was first installed two days ago, and updated.
uname -r returns 5.7.14.1-MANJARO

The issues:

  1. When selecting hibernate, the screen is shut off, the pc is doing “something” (I’d assume writing ram to disk), then shuts off. When powering on, it boots up like there was a hard powered off. It boots and logs that there are dirty bits on the filesystems. The applications that were running before the hibernate are not running, and when starting they behave like they were killed.

  2. When putting the pc to sleep (suspend) it consumes almost as much battery as iI use it. While sleeping it consumes 3,5% of the battery per hour. This laptop only consumes 4% of battery per hour at the lowest level of screen brightness, but I’d expect power consumption to be significantly less when put to sleep. When put to sleep the wifi disconnects, screen turns off, power led starts blinking, keyboard backlight is switched off. It wakes from sleep by pressing any key on the keyboard, meaning the keyboard is not powered off. According to powertop the power consumption is 2,75w with screen at lowest brightness, wlan on, BT off.

How should I go about debugging these issues? How to find out what is using power while sleeping? I read somewhere that this laptop should only use about 0.2w while sleeping. That’s 1/10th of what I see here.
How could I find out if the hibernate fails on saving or resuming?

Hello and welcome,

I think this tutorial should come handy for you:

Let us know how it worked.

Thank you. I got lost at the grub flags:

There are 5852 modules available. Which of them should I look into? How do I find the modules full name (not the short form used for filename).
When I’ve installed gentoo servers, I’ve compiled everything I need into the kernel. I’ve never worked with modules. When doing the kernel config all options have an explaining name and are grouped by the type of hardware they support. A flat list of the modules short names are impossible for me to navigate.
The i915 module is loaded. Does it cover intel UHD 6200?

I don’t have any issue with pc not powering off after shutdown. Nor do I see any errors after unquieting grub. Still I set acpi_osi='Windows 2018 just to be on the safe side.

Disable ipv6 - i don’t see how that could be relevant
Same goes for nic-naming.
Disable PCIe ASPM power saving sounds to be to opposite of my goal.

The rest of this guide seems to focus on processes to disable in order to save power in a running state. My issue is power usage in the sleeping state. I’ll leave the pc sleeping over night and see how it goes.

And when it comes to hibernation, I don’t see any errors. All though I probably don’t have the needed logging enabled.

When putting the pc to sleep (suspend) it consumes almost as much battery as iI use it. While sleeping it consumes 3,5% of the battery per hour. This laptop only consumes 4% of battery per hour at the lowest level of screen brightness, but I’d expect power consumption to be significantly less when put to sleep. When put to sleep the wifi disconnects, screen turns off, power led starts blinking, keyboard backlight is switched off. It wakes from sleep by pressing any key on the keyboard, meaning the keyboard is not powered off. According to powertop the power consumption is 2,75w with screen at lowest brightness, wlan on, BT off.

This looks really bad. Try playing with your BIOS/UEFI, maybe you can change its behaviour a bit. Disable wake on lan if it’s enabled.

I don’t know anything about how hibernate works so don’t have anything to say about that.
Maybe check /etc/default/grub to see if resume UUID is correct.

So the night test… It was using 43% battery over 12,5 hours. However, what did change was that I could not wake it up, so I had to do hard power off. Those 43% includes the reboot, so it might have been slightly less usage during the sleep. That was the first time I had such problem. I’ll revert the changes from yesterday.

There’s not really much to play with in this bios. Basically, the only thing there is TPM options and selection of boot device. I even had to find a hacked bios in order to put the disks in AHCI mode.

Resume UUID in grub? There is no such thing. You may have solved the problem…

I added resume to the hooks in /etc/mkinitcpio.conf
it now looks like this:
HOOKS=“base udev autodetect modconf block keyboard keymap usr filesystems resume”

and /etc/default/grub has this line:
GRUB_CMDLINE_LINUX_DEFAULT=“apparmor=1 security=apparmor udev.log_priority=3 resume=UUID=e73d3102-ffc4-45da-8e75-a05e73779a68”

Still no resume after hibernate. How can I find out if it really writes ram to disk? I think it would be a good start to figure if it is the save process or the resume process that fails.

Don’t know how I screwed up hibernate as I have not really done anything to the system… I got to remember that during install, before the partitioning, there was an option to select erase disk and select to make swap with hibernate. So I figured I could just try a reinstall with that option, just to see if hibernate works (and it did). Before that I figured I might as well try windows 10, just to watch battery consumption… At standby: between 3 and 4% pr hour. (I tested for only 2 hours), at running with the weakest display light (which is way weaker than the weakest in linux): 8% per hour. I didn’t bother about optimizing settings, but I did install all the latest drivers from Clevo and Intel, and I did let windows update install everything recommended. So out of the box, Manjaro will give this laptop twice as much battery runtime! (Will be interesting to see battery consumption with a windows VM running on manjaro.)

So after the windows test I installed manjaro with the erase disk and swap partition with hibernate options. Hibernate worked. Then I figured I could do a backup of /boot and /etc on that working install, and do another reinstall using my preferred partitioning scheme and diff the config files with those from the backup. And guess what - hibernate works. There was no need for the backup.

So how does the currently running setup differ from the one that did not have a working hibernate? On this setup I have not installed any updates yet. I have not changed the desktop wallpaper, I have not changed any power settings (adjusted time to turn off display and time to suspend), I have not deactivated bluetooth, and I have not installed virtualbox nor touchpad gestures. Maybe a few more changes that I will remember when looking through the settings menu. I’ll do these one by one to see if any of them brakes hibernate.

But first, I’ll let the pc sleep over night to see battery consumption on a clean install. (I have enabled tap to click on the touchpad, as the only non-default setting.)

Btw: installing Manjaro twice, and giving the laptop about two hours of runtime (testing hibernate, backing up /boot and /etc and I wasn’t attending when the install finished) consumed 10% of the battery from the start. As normal usage tends to use 4% battery per hour, each install of manjaro added just 1% to the battery usage. I’m impressed by the power usage of this laptop, and I’m impressed by manjaro out of the box is using half the power of windows with all drivers installed.