NVidia battery life

Yes, the end of the log fiel is at the end of my post.

I looked more into it and I found 2 causes:

  • warning treated as errors, and there are some warnings
  • and the following error (first line: implicit declaration of a fct):
2022/09/16 19:49:53 akmodsbuild: /tmp/akmodsbuild.LFc7zN82/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-drm/nvidia-drm-helper.c:47:5: error: implicit declaration of function 'drm_framebuffer_put' [-Werror=implicit-function-declaration]
2022/09/16 19:49:53 akmodsbuild: cc1: some warnings being treated as errors
2022/09/16 19:49:53 akmodsbuild: error: Bad exit status from /var/tmp/rpm-tmp.36L4hS (%build)
2022/09/16 19:49:53 akmodsbuild: RPM build errors:

I am not sure its something I can change. Version incompatibility of source code problem?

You are posting text as preformatted HTML code which prevents scrolling and the ability to see the full line of text. Please stop using html code for formatting and use the </> Preformatted text tags on the toolbar above so it can all be read as you see it on your screen. I took the liberty to edit your log portion above and removed some of the html code so it is closer to what is seen on screen and the full lines can be scanned.

It would appear from the log that since you are running a kernel that is labeled as fc38 while your installed release is fedora 37 it may be preventing a proper module build and load.

2022/09/16 09:19:37 akmodsbuild: ./scripts/check-local-export /tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-drm/nvidia-drm-gem-user-memory.o
2022/09/16 09:19:37 akmodsbuild: ./scripts/check-local-export /tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-drm/nvidia-drm-gem-dma-buf.o
2022/09/16 09:19:37 akmodsbuild: { echo ; echo &apos;/tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-drm/nvidia-drm-gem-user-memory.o: $(wildcard ./tools/objtool/objtool)&apos; ; } >> /tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-drm/.nvidia-drm-gem-user-memory.o.cmd

What is the output of ls /lib/modules/$(uname -r)/ and ls /lib/modules/

Hi, here it is

[pierre@desktop-r8dh1r0 ~]$ sudo ls -l /lib/modules/$(uname -r)/
total 23872
lrwxrwxrwx. 1 root root       43 Sep 13 02:38 build -> /usr/src/kernels/6.0.0-0.rc5.37.fc38.x86_64
-rw-r--r--. 1 root root   251734 Sep 13 02:38 config
drwxr-xr-x. 1 root root        0 Sep 13 02:38 extra
drwxr-xr-x. 1 root root       84 Sep 13 02:37 kernel
-rw-r--r--. 1 root root  1236035 Sep 15 16:09 modules.alias
-rw-r--r--. 1 root root  1211506 Sep 15 16:09 modules.alias.bin
-rw-r--r--. 1 root root     1680 Sep 13 02:38 modules.block
-rw-r--r--. 1 root root    11804 Sep 13 02:38 modules.builtin
-rw-r--r--. 1 root root    32230 Sep 15 16:09 modules.builtin.alias.bin
-rw-r--r--. 1 root root    14496 Sep 15 16:09 modules.builtin.bin
-rw-r--r--. 1 root root    94264 Sep 13 02:38 modules.builtin.modinfo
-rw-r--r--. 1 root root   517756 Sep 15 16:09 modules.dep
-rw-r--r--. 1 root root   699436 Sep 15 16:09 modules.dep.bin
-rw-r--r--. 1 root root      375 Sep 15 16:09 modules.devname
-rw-r--r--. 1 root root      241 Sep 13 02:38 modules.drm
-rw-r--r--. 1 root root       34 Sep 13 02:38 modules.modesetting
-rw-r--r--. 1 root root     2836 Sep 13 02:38 modules.networking
-rw-r--r--. 1 root root   167210 Sep 13 02:38 modules.order
-rw-r--r--. 1 root root     1039 Sep 15 16:09 modules.softdep
-rw-r--r--. 1 root root   538033 Sep 15 16:09 modules.symbols
-rw-r--r--. 1 root root   654232 Sep 15 16:09 modules.symbols.bin
lrwxrwxrwx. 1 root root        5 Sep 13 02:38 source -> build
-rw-r--r--. 1 root root   173208 Sep 13 02:38 symvers.gz
-rw-------. 1 root root  6368214 Sep 13 02:38 System.map
drwxr-xr-x. 1 root root        0 Sep 13 02:35 systemtap
drwxr-xr-x. 1 root root        0 Sep 13 02:37 updates
drwxr-xr-x. 1 root root       36 Sep 15 16:08 vdso
-rwxr-xr-x. 1 root root 12415336 Sep 13 02:38 vmlinuz
drwxr-xr-x. 1 root root        0 Sep 13 02:37 weak-updates
[pierre@desktop-r8dh1r0 ~]$ sudo ls -l /lib/modules/
total 0
drwxr-xr-x. 1 root root 752 Sep  6 08:19 6.0.0-0.rc3.25.fc38.x86_64
drwxr-xr-x. 1 root root 742 Sep  6 20:01 6.0.0-0.rc4.31.fc38.x86_64
drwxr-xr-x. 1 root root 752 Sep 15 16:09 6.0.0-0.rc5.37.fc38.x86_64
[pierre@desktop-r8dh1r0 ~]$ 

Thx a lot for the help.

That looks normal.

Now how about
$ ls -l /lib/modules/$(uname -r)/extra
and if that shows the nvidia directory as mine does then
$ ls -l /lib/modules/$(uname -r)/extra/nvidia

The extra directory is empty apparently

[pierre@fedora ~]$ sudo ls -l /lib/modules/$(uname -r)/extra
total 0
[pierre@fedora ~]$ 


Why are you using the kernel 6.0 rc ?

Well, it wasn’t actually a choice. I simply did an update/upgrade.

With fedora 36 or 37 beta the installation of the kernel 6.0 rc was a choice, not automatic with an upgrade. Both 36 & 37 currently have the 5.19.9 kernel. At present fedora seems to only have the 6.0 kernel in rawhide.

As previously asked, why the 6.0 kernel?
It seems quite possible that with both akmod-nvidia & akmods for fedora 36 and the kernel for rawhide that it may not be building properly. In order to build for the 6.0 kernel you would also need the matching kernel-devel package. Is that one installed?

I have/had the same hussle.
The experience on Fedora wirh Nvidia is not great.
Fedora should provide a driver manager GUI just like Ubuntu (-based), Manjaro etc for a easier setup for everyone.

I uninstalled all drivers for the Nvidia gpu and only run the integrated amd. This more than doubles the battery life (boost it more with auto-cpufreq).
But that was also not that easy and with the resent new Kernel it changend everything back again with the Nouveau and Nvidia activated.

If this is the case with every new Kernel I have no choice but to move on.

Of course this is mainly Nvidia’s fault but Fedora as a big Distro should provide some assistance for inexperienced users.

Any device installed in the system should have a driver loaded, even if unused. This is why installing a new kernel reactivates the driver.

With most laptops it is very easy to physically open the case and remove the nvidia dGPU so the kernel does not see it and load a driver. That might be an option if you are absolutely certain you do not want it activated.

Well, that is the thing.
First I’d prefere not to open my Laptop and second I might need my Nvidia for some tasks. Darktable for example.
Next Laptop will be amd only probably and from a manufacturer that delivers Linux out of the box.

But for now I need a simple “turn off the Nvidia” for better battery performance and turn on for heavy gpu tasks.

In that case it seems best to actually load the proprietary nvidia driver. With the card installed and the nvidia driver loaded but not used the power usage should always be minimal. I seem to remember others reporting that having no driver loaded caused an excessive power drain as well.

Having the driver loaded or not loaded does not alter the fact that the card uses some small amount of power when physically installed. Not having the driver may cause unexpected results.

what??? I’m not really sure you should be talking or “trying to help” with this kind of comment.

It’s like someone asking to fix something in gnome and you say then to uninstall gnome and install KDE. Or even asking them to install something that doesn’t exist, like saying that you can remove something that is soldered in the motherboard to fix a problem.

But anyway …

Try to revert to the default kernel @sheriffpeter. Im @Fedora37-beta and using 5.19.9-300.fc37.x86_64 and my nvidia laptop is running fine.

I’ll try to poke around the settings again this weekend so my Hybrid(intel+nvidia) runs in a more portable way and will share the results in here, but before that, we should try to enable you to be able to choose normally between full NVIDIA, full INTEL or hybrid.

I was asking about the kernel because I myself in the past was poking around with XANMOD kernel and others and some of them were not able to build the nvidia kmod correctly. Start from a working kernel, the default one, and tweak and improve step by step.

If you’re using some customization like Fedora-Rawhide, you can, obvs, but makes the jobs of trying to help you kind of way harder.

How many kernels and kernel-sources and kernel-devel you have installed in your system? Only the 6-rc ? Try to install one from Fedora-Release like the one I’m using. And try to make a “sudo akmods --force” again to see if Nvidia builds for them.

1 Like

That is how I did it on Zorin but unfortunately I have the same problem like the creater of this topic and my Nvidia settings look like the screenshot he shared. Nothing I can do there.
Clean Fedora Install. Enabled rpm fusion and installed the Nvidia driver with the installation guide.

Apparently I have 2 kernel and 3 kernel-dev installed.

The weird thing is that I have kernel-headers at release 5.

[pierre@fedora ~]$ dnf list installed *kernel*
Installed Packages
abrt-addon-kerneloops.x86_64                                                                                       2.15.1-1.fc36                                                                                       @fedora                
kernel.x86_64                                                                                                      6.0.0-0.rc3.25.fc38                                                                                 @fedora-rawhide-nodebug
kernel.x86_64                                                                                                      6.0.0-0.rc5.37.fc38                                                                                 @fedora-rawhide-nodebug
kernel-core.x86_64                                                                                                 6.0.0-0.rc3.25.fc38                                                                                 @fedora-rawhide-nodebug
kernel-core.x86_64                                                                                                 6.0.0-0.rc4.31.fc38                                                                                 @fedora-rawhide-nodebug
kernel-core.x86_64                                                                                                 6.0.0-0.rc5.37.fc38                                                                                 @fedora-rawhide-nodebug
kernel-devel.x86_64                                                                                                6.0.0-0.rc3.25.fc38                                                                                 @fedora-rawhide-nodebug
kernel-devel.x86_64                                                                                                6.0.0-0.rc4.31.fc38                                                                                 @fedora-rawhide-nodebug
kernel-devel.x86_64                                                                                                6.0.0-0.rc5.37.fc38                                                                                 @fedora-rawhide-nodebug
kernel-devel-matched.x86_64                                                                                        6.0.0-0.rc5.37.fc38                                                                                 @fedora-rawhide-nodebug
kernel-headers.x86_64                                                                                              5.19.4-200.fc36                                                                                     @updates               
kernel-modules.x86_64                                                                                              6.0.0-0.rc3.25.fc38                                                                                 @fedora-rawhide-nodebug
kernel-modules.x86_64                                                                                              6.0.0-0.rc5.37.fc38                                                                                 @fedora-rawhide-nodebug
kernel-modules-extra.x86_64                                                                                        6.0.0-0.rc3.25.fc38                                                                                 @fedora-rawhide-nodebug
kernel-modules-extra.x86_64                                                                                        6.0.0-0.rc5.37.fc38                                                                                 @fedora-rawhide-nodebug
kernel-srpm-macros.noarch                                                                                          1.0-14.fc36                                                                                         @fedora                
libreport-plugin-kerneloops.x86_64                                                                                 2.17.2-1.fc36                                                                                       @updates               
[pierre@fedora ~]$ 

Thanks for the help. I’ll try to set a previous release asap.

1 Like

Did some testing and tried a tool the guys from Nobara use, the supergfx.

All tests after boot, waiting a minute, 50% brightness:

– hybrid ( intel + nvidia )

11.1 W of power consumption == ~ 6 hours, 20 min of battery == no powertop auto-tune
9.8 W == 7hours and 21min

– intel mode ( no nvidia driver loaded, blocked on boot )

11.3 W - no auto-tune
8.48 W - auto-tune

– Nvidia mode

24.2W == 2hours 44 min - no auto-tune
22.5W == 2hours 53 min - auto-tune


I’ll try later, as I said, to test it better. I’m only using superglx and powertop. Got the first in Fedora Copr.

This is just to show you guys that is possible to configure Fedora for a good laptop with nvidia experience. As any other linux, you still need to kind of config it manually. I mean, in my experience, the debian family, arch, garuda, pop, all use some kind of tool that forces you to reboot so they can tweak the boot and config the nvidia module to load in some way or another( or even don’t load at all).

Try to map these systems and configs when you have a problem or situation using nvidia so we can help you better, and maybe improve the current documentation or help to select/filter a management tool that fedora could use in the future. Indeed, we don’t have one.

  • Kernel
  • Module version
  • Bootloader
  • Graphical system + Desktop
  • Nvidia xconfig

Mine are:
5.19.9-300.fc37.x86_64
Nvidia 515.65.01
Bootloader blocking nouveau
KDE Plasma 5.25.5
Default nvidia xconfig

I have an Alienware M15 R6, with nvidia RTX-3070

Unfortunately since fedora does not support or distribute the nvidia proprietary driver it will be difficult to see the actual data in their docs unless someone volunteers to provide it and probably even write the doc themselves.

There is a distinct difference between the software fedora is able to distribute and that which for various reasons must come from a 3rd party source. Documentation seems much the same since employees of RedHat or the fedora project would be limited in what they could do for unsupported software.

Rlx Jeff. I do know how Fedora and any other major open-source projects work and how the principles and stakeholders have to be accounted for.

But I do know as well that Fedora is a community project, this forum(the ancient name of this platform) is used by that community to help each other, and I’m trying to help. Maybe is not exactly what he needs, but maybe someone searching for this problem in the future can read, learn and contribute even further.

Lets be more helpful and optimistic man! Nvidia is opening their drivers ( or at least trying, idk), so I don’t think its impossible that in the next releases a tool could be used OFFICIALLY by Fedora to manage nvidia+intel. Let’s try, let’s review, let’s post in forums, and let’s discuss. But let’s not post something to ask others to stop posting and being negative or something, IDK.

Can you configure ur nvidia drivers in hybrid mode with minimal consumption? What’s ur setup?

Uhhh,
I don’t see how my post could be construed as negative, but each to their own.

My laptop has intel IGP and nvidia dGPU.

I have not checked specifically the power draw, but usually get ~2 1/2 hrs with using the dGPU as primary for normal usage, thus it is used full time

Some are cards in sockets and can easily be removed.

Appreciate your tests and your attitude!

Supergfx is just to much fiddling for me. If something goes wrong I wouldn’t know what and probably could not fix it.
When I uninstall the propriatary Nvidia drivers the Nouveau seems to still be blacklisted. So only the integrated amd is running and I get a okay-ish battery time.
I was checking some of the other programs mentioned on the git page of supergfx. But what I undestood are most of them not usable on Fedora and 1 or 2 are just to “complicated” as they involve multiple Terminal commands and setups.

Fedora should provide such a tool. It would make a better impression for new users if they have an optimus setup. Every other big Linux Distro does and even smaller ones. I understand that it is propriatary stuff is not installed out of the Box and that is absolutely okay but tools to hanlde these things are just quality of life and new Linux useres have a first impression that most of the time will last long. And everyone was a beginner at some point.

That is also my experience but a reboot is not that difficult :sweat_smile:
On ZorinOS I had to reboot (or just log out :thinking:) to deactivate the Nvidia Card.
And auto-cpufreq provided an extra 2 hour battery boost. So I got around 5 to 6 hours watching youtube.

1 Like