Ubuntu 18.04 battery life

34,456

Solution 1

There are multiple power managers, and for a laptop, you may want to use laptop-mode-tools:

sudo apt install laptop-mode-tools

Per linrunner, author of TLP:

"Conflicts: laptop-mode-tools" --> salsa.debian.org/MoonSweep-guest/tlp/blob/master/debian/control 

So installing laptop-mode-tools will remove tlp and vice versa. I would not recommend using apt purge because users will loose their edits to /etc/default/tlp (in case they want to reinstall tlp).

You can monitor/diagnose your power consumption with powertop:

sudo apt install powertop 

Solution 2

This is how I get the best battery life with my Dell XPS 15 9570 (nvidia graphics) on any Ubuntu 18.04+ based system (Elementary OS, Mint, etc.)

enter image description here

Install packages:

sudo apt-get install tlp powertop

Enable tlp:

sudo tlp start

Check that it's running:

sudo tlp-stat -s

Check battery drain watts with AC disconnected and most apps and browser tabs closed (give it a few moments to stabilise):

sudo powertop

powertop drain

Press ESC to exit (it takes a few seconds).


Important for nvidia graphics

Using your onboard intel graphics when you're on battery should make a big difference. However tlp will not power down the nvidia card by default when using your onboard intel because it expects another service such as bumblebee to do so. Bumblebee doesn't work in Ubuntu 18.04+ so tlp is the best option.

sudo nano /etc/default/tlp

Uncomment this line and set value to empty:

RUNTIME_PM_DRIVER_BLACKLIST=""

Switch to your intel graphics, restart and check power usage:

sudo prime-select intel
sudo reboot
sudo powertop

Note in future switching to intel or nvidia only requires a logout depending on your setup.


Optional further steps (applicable to all machines)

Check if --auto-tune reduces your power significantly:

sudo powertop --auto-tune
sudo powertop

If --auto-tune made a big difference then go to the powertop tunables by pressing TAB a few times. Anything you adjust here is temporary. Test which ones make a difference in your power usage without causing any annoying behaviour such as sleeping external USB devices too quickly. Now make them permanent by editing tlp config. This requires some experimentation.

To edit tlp config and restart it afterwards:

sudo nano /etc/default/tlp
sudo systemctl restart tlp

Refresh powertop tunables page by pressing r.

Solution 3

I'm willing to bet that your problem has to do with your nvidia graphics card running all the time, despite switching to intel graphics. That seems to be the problem for everyone running 18.04 Ubuntu and they still hasnt't fixed it...

More info:

Share:
34,456

Related videos on Youtube

Andrea Bellizzi
Author by

Andrea Bellizzi

Updated on September 18, 2022

Comments

  • Andrea Bellizzi
    Andrea Bellizzi over 1 year

    I know there are many questions on this argument, but I want to be sure that the answer for old ubuntu version can be used for this version, so this is the question, how can I improve my battery life on ubuntu 18.04? I installed ubuntu in dual boot with win10 and I've noticed that ubuntu run more frequently the fans and the estimated battery life is less then win10. I've already switched to integrated intel graphics card and I've installed tlp, what can I still do?

    • Andrea Bellizzi
      Andrea Bellizzi over 5 years
      @JoshuaBesneatte is compatible with tlp or are mutual exclusive?
    • Andrea Bellizzi
      Andrea Bellizzi over 5 years
      for now seems they are working together and the battery is improved of 1 hour
  • linrunner
    linrunner over 5 years
    This will not work with TLP: tlp and laptop-mode-tools packages are mutually exclusive.
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    some sources say it will... many say they conflict, I will update my answer accordingly
  • linrunner
    linrunner over 5 years
    The package itself implements "Conflicts: laptop-mode-tools" --> salsa.debian.org/MoonSweep-guest/tlp/blob/master/debian/cont‌​rol . So installing laptop-mode-tools will remove tlp and vice versa. I would not recommend using apt purge because users will loose their edits to /etc/default/tlp (in case they want to reinstall tlp). Btw: I'm TLP's author.
  • Pierre.Vriens
    Pierre.Vriens over 5 years
    So what is the solution or work-around?
  • WinEunuuchs2Unix
    WinEunuuchs2Unix about 5 years
    +1 but I think you meant to say prime-select intel
  • naXa stands with Ukraine
    naXa stands with Ukraine about 4 years
    Ubuntu 19.10: Command 'restart' not found.
  • Tmanok
    Tmanok over 2 years
    Note that powertop needs to run for like an hour before you can use the --auto-tune feature or it will throw an error when attempting. Sometimes the error does not mention it, but generally it will say something along the lines of "not enough samples collected".
  • Tmanok
    Tmanok over 2 years
    Ubuntu and Linux Mint 20 users are no longer experiencing this issue. I'm successfully using Intel Graphics after specifying "On Deman" in NVidia X Server Settings. Note, you can check if your Nvidia GPU is running with nvtop aka Nvidia System Monitor QT which has a debian package on their github.