You have hybrid graphics. Both adapters are powered all the time and that is way battery life is low. Nvidia adapter is new. So you need to install drivers. Run in terminal
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-352 nvidia-prime
sudo add-apt-repository -r ppa:xorg-edgers/ppa
and reboot.
If the driver installs OK, you will be able to switch Intel and Nvidia adapters in Nvidia Settings program. And power consumption must be much lower in Intel.
In your current state Nvidia adapter is always powered but not used by the system because opensource driver does not support it. So it is just waste of power.
Short answer: It turned out to be a problem somewhere between kernel 4.15 and the touchpad.
Disabling the touchpad solved the problem:
sudo rmmod hid_multitouch
This is an acceptable workaround for me, since most of the time I use an external mouse. In rare cases, when I don't have a mouse at hand, I solve the problem by disabling + enabling the touchpad after waking up:
sudo rmmod hid_multitouch
sudo modprobe hid_multitouch
EDIT March 2020: Some time ago, I've realized that a moment of using the touchpad, after resuming the laptop also solves the problem.
Long answer
The top
command showed a low overall CPU usage (below 8%), but surprisingly the following command:
watch -n1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""
revealed that all CPU cores were running at the highest frequency (~3.8 GHz)!, while I was expecting to see the lowest possible frequency (0.8 GHz) due to the idle state. The sudo powertop
has proven that the high power consumption indeed was coming from the CPU.
So I came back to the results of the top
command, watched it closely, and one process looked suspicious: irq/51-SYNA2393:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21874 root 20 0 0 0 0 I 2.0 0.0 0:03.18 kworker/0:0
1 root 20 0 225780 9392 6472 S 1.0 0.0 0:21.78 systemd
513 root -51 0 0 0 0 D 5.3 0.0 1:00.15 irq/51-SYNA2393
2673 greg 20 0 4569240 205392 73916 S 1.0 0.6 1:54.94 gnome-shell
...
The dmesg | grep SYNA
output:
[148428.423272] input: SYNA2393:00 06CB:7A13 Touchpad (...)
[148428.423893] hid-multitouch 0018:06CB:7A13.0001: input,hidraw1: I2C HID v1.00 Mouse [SYNA2393:00 06CB:7A13] on i2c-SYNA2393:00
revealed that IRQ 51 comes from the laptop touchpad. That's how I found the culprit.
To be honest, I'm not sure it it's a bug inside Linux kernel, or simply my touchpad is not top-notch supported. When I'll try a newer Ubuntu version with newer kernel I'll update this post.
Best Answer
After resuming from suspend, use this command in the terminal:
If you see this:
It could mean when you suspended the CPU's were not put to sleep as per his bounty Q&A a couple of years ago: systemd suspends system but upon resume kernel then enters sleep and wake-up
If so, I'm sad to report the problem persists to this day on my newest laptop just as it did on that older laptop.
Problem since 2012?
This old email chain: Re: Kernel stops at "PM: Preparing system for mem sleep", never makes it to "Freezing user space processes ... " has a similar problem.
From my log file today:
Some other interesting points is it often takes 5 to 8 seconds to suspend when it should be about 1 second. This bug is reported in many places too.
If you don't have the same problem in the previous sections and, your laptop stays warm when suspended, then your fix maybe here: Ubuntu 18.04 - Dell XPS13 9370 no longer suspends on lid close