Fedora 38 + Nvidia + Videos Battery drain

Hi This time I broke my own rule i.e. wait min 3 months for things to get stable. But installed F38 (clean) on Dell XPS 7590, it obviously has dual graphics and I always install nvidia graphics from software center, never had any problems before. With F38 I have been having endless problems with battery drains. Currently running wayland and it seems smoother than X11.

Battery drain occurs when I watch videos (youtube) and I can hear the graphics fan running constantly. I tried various options by installing envycontrol to switch between integrated and nvidia in both wayland and X11. Nothing seems to be working. Sometimes, battery drops rapidly to 20% for no reason.

On F37 battery will last for at least 5 hours before fully charging.

Any suggestions? What can be done to reduce the drain effect.

Thanks

There are multiple things that can be done. You don’t have to all off the listed things, but you can. There may be more things, but these two have the biggest impact in my experience.

  1. Install auto-cpufreq. It is a command line tool that adjusts your cpu frequency depending on load. Usually does an incredible job for me. It has a github repo and I would recommend using their installer for it. Note that tweaking the config file can further give you a balance between battery life and usability.
    https://github.com/AdnanHodzic/auto-cpufreq#update-using-auto-cpufreq-installer

  2. Use supergfxctl. This is a CLI tool that basically turns your gpu on and off. The idea being that if you don’t need your dedicated GPU at the moment, may as turn it off to save battery. You can install a gnome extension or a kde plasmoid to provide a GUI to control the tool.
    Copr repo for supergfxctl → https://copr.fedorainfracloud.org/coprs/lukenukem/asus-linux/packages/
    Gnome extension → https://extensions.gnome.org/extension/5344/supergfxctl-gex/
    Copr repo for KDE plasmoid → https://copr.fedorainfracloud.org/coprs/jhyub/supergfxctl-plasmoid/

2 Likes

Thanks Installed auto-cpufreq. Will give this a try. I did install envycontrol to switch between integrated and hybrid. That didn’t work. Hopefully auto-cpufreq will.

Maybe turn on hardware acceleration if it is not already on? Firefox Hardware acceleration - Fedora Project Wiki

Hi Barry yes I have done all that too.
After installing auto-cpufreq it disabled GNOME battery power management. Although I see a slight improvement, but it’s not much.

Watching video’s e.g. was watching F1 live yesterday, graphics fan was screaming. I think I will have to wait for NVIDIA to fix their drivers.

Never gain, will buy NVIDIA based laptop. LOL.

1 Like

When using high power is it the CPU or GPU that is working hard?
If it is the CPU then it is possible that you do not have the required codec libraries installed to allow the GPU to do the video decode.

If you are not a gamer then avoiding nvidia is reasonable.
But for games nvidia is too important sadly.

I am assuming its GPU, because it only happens when watching videos and all relevant codes were installed. How to tell which fan anyway?

I did install all the codecs except eSpeak GStreamer which I have just now. I did try to use the integrated graphics by disabling Nvidia using envy-control cli program. But for some reason, in wayland teams for linux screen sharing has broken. So decided to disable it and after reinstalling nvidia drivers screen sharing worked again. I am not sure if this is isolated to my setup or others are also experiencing the same.

Run top and check that assumption.
Usually these days the cpu use is low when the gpu is doing the decode.

Seems it is the CPU. I installed brave browser to test and the battery is not draining as bad for watching the same content or youtube videos. This is weird because, i have installed all codecs that I can think of. Firefox I use came with the F38 clean install.

Is there a difference in flatpack and fedora version? Perhaps I should give this a try

As it is the CPU the video decode is not being offloaded to the GPU.

Did this not help? Firefox Hardware acceleration - Fedora Project Wiki

One may try the procedure given here to tell the system to use the nvidia GPU.

Doing so with the nvidia drivers enables hardware acceleration on the dGPU, while not using that GPU may require the use of the iGPU and force use of the CPU in all graphics rendering to some extent.

Thank you all for your suggestions. i have been trying various options to make by XPS battery stable after installing F38. Initially I thought the battery drain problem was due to watching videos in firefox. However, that is not the case. Overall, the battery behavior was unstable. It’s not lasting as it used to in F37 and sometimes battery level just drops from e.g. 50% to 3%.

So finally I did the following.

  1. Delete Firefox and all it’s relevant folders (settings etc)
  2. Reinstall Firefox from RPM library
  3. Delete power profile damion that came preinstalled with F38
  4. Enable auto-cpufreq to “powersave”
  5. Use envycontrol to disable hybrid and only enable integtared

The above has improved the battery performance quite drastically. I just reinstalled the firefox to delete old settings and start from scratch.

Also after latest update from teams for linux, screen sharing problem has been resolved. So SS works perfectly with Integrated. If I still have problems I have installed MS Teams (PWA) using MS edge as backup. Only issue I have noticed using integrated, is the Files app takes 2 to 3 seconds to open. I am not sure what is causing the problem. Because with Hybrid or Nvidia, Files app open within a sec.

So, all in all, it would seem like the battery drain is being caused by Nvidia drivers. Because, when I switch to Nvidia using envycontrol, battery wouldn’t last as good as integrated.

It seems to be a fact that using the dGPU on almost all laptops having dual gpu configs will use more power than when using the iGPU.

When one intends to maximize battery life they should avoid using the dGPU except when absolutely necessary and that is dependent upon the users individual workflow circumstances.

It also is normally noted that the iGPU seems always less capable than the dGPU. I would guess this is normally a trade off by the manufacturers between power saving and performance in that they try to balance between both worlds in giving extended battery life with the iGPU and better graphics with the dGPU. They know that users may at different times want both.

I recall that on my work Dell laptop there is a battery state report in the BIOS.
It maybe worth seeing is that report says your battery is healthy.

That report is used by Dell support to decide if a battery needs replacing.

I agree, there will be a difference in consumption between iGPU vs hybrid. But the difference shouldn’t be huge like I have experienced. I never had any problems with F37. Battery lasted for at least 5 to 6 hours during hybrid i.e. if I don’t use VMPlayer.

However, I must say, when I installed F37, I had similar issue, but then I just disabled NVIDIA for a few months until the drivers are sorted and ran with IGPU.

So there seems to be a pattern developing; For every release I believe Nvidia drivers takes time to sort out.

I have a Dell Inspiron and it does report bad battery even with a new battery replacement from Dell. I turns out it also looks at the charger, and my charger is not Dell. My point being, don’t trust that report 100%, verify it’s output.

FWIW, I have removed powerprofiles daemon from my system in favour of Tuned and it is way quieter and behaves as I expect.

What does it do if the charger is not connected? Just curious.

Since deleting PPD and switching to integrated, the consumption is much stable. Yesterday I used it for more than 5 hours and battery was at 38% when I shutdown.

Previously after a full charge I would get 2 hours worth, depending on usage, but not more.

image