os icon indicating copy to clipboard operation
os copied to clipboard

Poor battery life and high temperature on laptop with NVIDIA hybrid graphics

Open jhaygood86 opened this issue 4 years ago • 9 comments

Prerequisites

  • [x] I have searched open and closed issues for duplicates.

Describe the bug

I use an Alienware m15 laptop that has NVIDIA Optimus. It should, in theory, prefer the Intel GPU and only use the NVIDIA GPU sparingly (video games, etc..). However, elementaryOS prefers the NVIDIA GPU which results in the laptop running hot and the battery life being non-existent.

To Reproduce

Steps to reproduce the behavior:

  1. Install elementaryOS
  2. Use laptop
  3. Notice laptop is oven and doesn't work on battery

Expected behavior

I expect the laptop to use the Intel graphics the vast majority of the time. I previously used Fedora on this laptop which did that and it worked beautifully, no overheating, battery life was many hours versus a few minutes. Some applications automatically opened on the NVIDIA card, others required selection in GNOME (GNOME 3.36 has new UI that is available that lets you run apps on NVIDIA card)

Platform Information

  • OS: elementary OS
  • OS Version: Hera
  • Hardware: Alienware m15 w/ Intel Core i7 9750H, NVIDIA Geforce RTX 2060, 32 GB RAM

jhaygood86 avatar Jun 28 '20 06:06 jhaygood86

Have you tried using the System76-power package from system76? It should be able to do this and also have custom profiles.

hanaral avatar Jul 13 '20 13:07 hanaral

System76-power

I have not. However, like I said, it works out of the box on Fedora, so if it doesn't on elementary, I consider that an elementary bug.

elementary does support the hacky "nvidia prime" solution from Ubuntu that requires manually choosing the GPU and then rebooting (blegh, gross). Recent versions of GNOME however use a better integrated solution that elementary should adopt (or improve upon): GNOME is aware of the laptop having 2 different GPUs. By default, it prefers the integrated GPU. Apps that prefer the discrete GPU automatically run on them (using a flag in the .desktop file), and all apps have the option via a right click menu on the application. No rebooting required, and it actually allows most apps to use the Intel card and only a single specific app to use the NVIDIA card.. simultaneously.

jhaygood86 avatar Jul 13 '20 13:07 jhaygood86

The prime driver switching isnt a part of GNOME I believe, since fedora has had it since before it was a part of the UI. I expect this is an issue with the fact that Hera is still based 18.04, hence why System76 created their own system that is portable across their LTS and current versions. That being said, you might want to open an issue asking for UX integration with prime with Odin in mind.

hanaral avatar Jul 13 '20 13:07 hanaral

It is part of GNOME, using switcherooctl. This isn't using the "NVIDIA PRIME" solution that is considered obsolete these days since it requires rebooting. The GNOME implementation doesn't even require the system to be a NVIDIA Optimus system, it works with any system with both an integrated and a separate discrete card.

jhaygood86 avatar Jul 13 '20 14:07 jhaygood86

@jhaygood86 would you mind point me to na official gnome page documenting this solution? Thanks

Lobosque avatar Aug 09 '20 12:08 Lobosque

Probably the easiest would be the GNOME Shell source code: https://gitlab.gnome.org/search?group_id=8&nav_source=navbar&page=2&project_id=546&repository_ref=master&scope=&search=discrete&search_code=true&snippets=false

Specifically, apply_discrete_gpu_env and shell_app_launch in shell-app.c, and then _updateDiscreteGpuAvailable and appDisplay.js

Essentially,

If both an integrated GPU and a discrete GPU is available (detected via switcherooctl dbus API), it displays a menu item for launching with a choice of either "run on Integrated" or "run on Discrete". The desktop file has a preference for whether or not that app should run on the integrated or discrete GPU which triggers that choice.

When the app is started, and its configured to run on the discrete (either due to it being the default choice, or specifically selected), it then uses switcherooctl to get the environment configuration needed to force an app to run on the discrete GPU, and then applies that environment prior to the app starting.

jhaygood86 avatar Aug 09 '20 12:08 jhaygood86

So many things learned today. I always assumed that hybrid graphics management is baked into kernel, not depended of desktop you run. Also, I don't have 'switcherooctl' running on my system, its not even present.

I wish eOS had some elegant way of switching gpus without need for reboot.

kem-a avatar Mar 12 '21 07:03 kem-a

So many things learned today. I always assumed that hybrid graphics management is baked into kernel, not depended of desktop you run. Also, I don't have 'switcherooctl' running on my system, its not even present.

I wish eOS had some elegant way of switching gpus without need for reboot.

eOS 6 will! I scratched my own itch and implemented it.

jhaygood86 avatar Mar 23 '21 11:03 jhaygood86

@jhaygood86 Can you add an update to this issue (or close it), with the current status of how this is on recent versions of elementary OS?

davidmhewitt avatar Jan 14 '22 14:01 davidmhewitt