NVidia battery life

Hi, An other thread about nvidia card and fedora.
I have a MSI GF63 thin with a GeForce GTX 1650. I installed the correct drivers I guess and I have no pb when starting with fedora.
However the power button is always orange( meaning it uses the nvidia card) and my battery lasts only 1:30h, instead of 8-10h.

For what I got on the internet I should be able to activate/deactivate the use of the nvidia/intel chip when I want. I tried a load of manipulation and system information but none seems to work.
I looked for information about Optimus and I am not sure my card is actually supported.

Do any of you have any further information?

Here are some information

Need any other information

Here are some info as I can’t embed more than 1 pic at a time.

I described a few mechanisms for turning off the Nvidia here (although I’ve used Ubuntu, it should work on Fedora as well): Ubuntu Jammy and Nvidia | Lorenzo Bettini

Please always use text when sharing info if at all possible.

Doing so has several benefits, including the ability for us to see and read it better as well as selecting portions when needed to properly respond. From an image we need to be able to read it (sometimes it may be too small or otherwise illegible) and we would have to copy the portion of interest by typing it instead of copy&paste or quoting.

Text can be entered by copy&paste then formatting maintained by highlighting the text and selecting the </> Preformatted text icon on the toolbar above.

Do you have an external screen attached and active when trying to suspend?
Many systems I have seen use the IGP for the internal screen and the dGPU for the external screen by default. This may be the source of your issue with the internal screen properly sleeping but the external screen keeping the system active.

1 Like

yeah sorry, True that it’s more visible when sharing text, my bad.

I had an external screen attached to my laptop when I screenshoted but that changes nothing. I have the exact same problem when not plugged in to any external screen.

I visited the lorenzo website. I do not seem to have prime-select, looking for it now.
However I do not have all the nvidia option in the interface, only the following:

Thx for the answers

1 Like

Just for curiosity.
What nvidia packages are installed? Please share the output of dnf list installed *nvidia*

[pierre@fedora ~]$ dnf list installed *nvidia*
Installed Packages
akmod-nvidia.x86_64                                                                                             3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                                                                          3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                                                                                      3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64                                                                            3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64                                                                              3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686                                                                                   3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64                                                                                 3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64                                                                                3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
[pierre@fedora ~]$ 

It might not be the good ones, I have been trying to set this up for a while now and maybe everything is mixed up …

1 Like

That shows that not everything is properly installed and the modules are not in use.

Please try this, and give the system time to build the modules after the install completes before you reboot.
sudo dnf remove *nvidia*
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
After the install completes wait at least 5 minutes then reboot.

If everything is properly loaded then lsmod | grep -i nvidia should show several lines of output. If not then the drivers did not get loaded and we will need to do more to find out why. At the very least the earlier command dnf list installed *nvidia* should now also show a package kmod-nvidia

2 Likes

I did remove all the already installed nvidia drivers and installed akmod and xorg.
Unfortunately it seems I can boot now.
I did nothing but install and reboot.
I get stucked when trying to boot on the last entry fedora 36. Maybe there is something to update in the grub script:

load_video
set gfxpayload=keep
insmod gzio
linux ($root)/vmlinuz-6.0.0-0.rc4.31.fc38.x86_64 root=UUIDXXXXXXXXX ro rootflags=subvol=root rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init rhgb quiet video=vesafb:mtrr:3 rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init
initrd ($root)/initram-6.0.0-0.rc4.31.fc38.x86_64.img

Seems odd that I have 2 initcall_blacklist no?
Should I change the nouveau configuration?

Did you mean “Unfortunately it seems I cannot boot now” or “Fortunately it seems I can boot now”

Your earlier post showed that kmod-nvidia had not been built by your system and the steps I suggested were to force the system to build the modules then the lsmod was to confirm the modules were built and loaded.

You do not show the results so it is difficult to understand this latest comment.

When posting comments it always helps if you post the commands used as well as the results exactly as seen on your screen.

yes, sorry for the mistake. My fedora 36 won’t boot now, I have to boot a previous entry with fedora 35.
The dnf remove nvidia and install of akmod et xorg went well. I did not save the output as I was not expected boot problem then.

Therefore I can’t launch the lsmod command

Lsmod has nothing to do with whether the install succeeded or failed. It has everything to do with reading what kernel modules have been loaded in the running kernel.

If you are running F35 then it would not even install the proper packages for F36.

Again, giving us the actual commands and output will allow us to assist. Generalizations cannot be used for an accurate and informed suggestion.

You should be able to boot to a live image and then we can assist. Otherwise our hands are tied.

I don’t know to say.
It should boot iith no problem.
All I did was executing the 2 commandes you suggested( I did’nt take any pics). I upgraded to fedora 36 the day before and was running f35 before.
Then I rebooted.
When the laptop power on I have the list of previous entries that I can boot, (the last one being f35 and the previous ones begin 2 f35 previous releases). When I let the laptop boot to the last one (f36) where I executed your commands, it just get stuckat the boot and won’t go further.
But if I choose to boot to the previous entry (f35) it’s okay, but I still have the driver I showed which are not correct according to your previous post.

On my F36 entry I have no idea why the hell I have boot pb juste because I remove the nvidia drivers and reintalled the worg :confused:

I don’t know if this is part of the issue but your running Fedora 36 and you have the rawhide kernel 6.0 installed.

I saw there that it can prevents fedora from booting from time to time …
That’s a good guess. I will look for more information about it. Thx a lot.

Ok, so Finally I can boot again.

So I rexecuted the lines you guys specified:

sudo dnf remove *nvidia*
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda

Everything went fine, I have the screenshots but don’t think this is usefull here.

I rebooted after a while and executed the

lsmod | grep -i nvidia

It returns nothing, so everything is not properly loaded.

I launched

dnf list installed *nvidia*

wich returns

[pierre@fedora ~]$ dnf list installed *nvidia*
Installed Packages
akmod-nvidia.x86_64                                                                                             3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
nvidia-persistenced.x86_64                                                                                      3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                                                                          3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                                                                                      3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64                                                                                 3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.i686                                                                              3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64                                                                            3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64                                                                              3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686                                                                                   3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64                                                                                 3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64                                                                                3:515.65.01-1.fc36                                                                            @rpmfusion-nonfree-nvidia-driver
[pierre@fedora ~]$ 

Also, when booting I saw an error message really quick under the fedora icon “falling back to nouveau” wich means fedora didn’t found the correct drivers if I remember correctly.

Any idea?

Thx

The nvidia drivers will not load when secure boot is active unless they have been signed.

That listing shows that the kmod-nvidia package was not automaticlly built when akmod-nvidia was installed. It should have happened.

Please run the command sudo akmods --force then wait for that to complete and for at least 5 minutes after then reboot.

Afterward please post the output of cat /etc/default/grub so we can verify the command line includes the proper kernel options for nvidia.
Also post the output of dmesg | grep -iE 'nvidia|secure' and lsmod | grep nvidia and finally the output of dnf list installed kernel

1 Like

OK, so the build failed. Likely the reason why the kmow-nvidia was not automatically build.

I had a first error regarding mock and mockbuild users that dit not belong to the correct groups.
I did :

    yum install mock
    useradd mockbuild
    usermod -G mock mockbuild

Then When building, here are the command, results and the log file.

[pierre@desktop-r8dh1r0 ~]$ sudo akmods --force
[sudo] password for pierre: 
Checking kmods exist for 6.0.0-0.rc5.37.fc38.x86_64        [  OK  ]
Building and installing nvidia-kmod                        [FAILED]
Building rpms failed; see /var/cache/akmods/nvidia/515.65.01-1-for-6.0.0-0.rc5.37.fc38.x86_64.failed.log for details

Hint: Some kmods were ignored or failed to build or install.
You can try to rebuild and install them by by calling
'/usr/sbin/akmods --force' as root.

And the end of the log file:

2022/09/16 09:19:37 akmodsbuild: |     ^~~~~~~~~~~~~~~~~~~
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-format.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-fb.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-linux.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-format.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-format.o.cmd
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-fb.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-fb.o.cmd
2022/09/16 09:19:37 akmodsbuild: cc1: some warnings being treated as errors
2022/09/16 09:19:37 akmodsbuild: ld -m elf_x86_64 -z noexecstack   -r -o /tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-uvm.o @/tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-uvm.mod
2022/09/16 09:19:37 akmodsbuild: ld -m elf_x86_64 -z noexecstack   -r -o /tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-modeset.o @/tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-modeset.mod
2022/09/16 09:19:37 akmodsbuild: make[2]: *** [scripts/Makefile.build:249: /tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64/nvidia-drm/nvidia-drm-helper.o] Error 1
2022/09/16 09:19:37 akmodsbuild: make[2]: *** Waiting for unfinished jobs....
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-linux.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-linux.o.cmd
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-prime-fence.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-prime-fence.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-prime-fence.o.cmd
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-modeset.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-modeset.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-modeset.o.cmd
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/nv-pci-table.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/nv-pci-table.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/.nv-pci-table.o.cmd
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
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-dma-buf.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-dma-buf.o.cmd
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-nvkms-memory.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-nvkms-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-nvkms-memory.o.cmd
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-peermem/nvidia-peermem.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-peermem/nvidia-peermem.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-peermem/.nvidia-peermem.o.cmd
2022/09/16 09:19:37 akmodsbuild: make[1]: *** [Makefile:1862: /tmp/akmodsbuild.zcltlfkb/BUILD/nvidia-kmod-515.65.01/_kmod_build_6.0.0-0.rc5.37.fc38.x86_64] Error 2
2022/09/16 09:19:37 akmodsbuild: make[1]: Leaving directory &apos;/usr/src/kernels/6.0.0-0.rc5.37.fc38.x86_64&apos;
2022/09/16 09:19:37 akmodsbuild: make: *** [Makefile:82: modules] Error 2
2022/09/16 09:19:37 akmodsbuild: error: Bad exit status from /var/tmp/rpm-tmp.5rWz2i (%build)
2022/09/16 09:19:37 akmodsbuild: 
2022/09/16 09:19:37 akmodsbuild: RPM build errors:
2022/09/16 09:19:37 akmodsbuild: Bad exit status from /var/tmp/rpm-tmp.5rWz2i (%build)
2022/09/16 09:19:37 akmodsbuild: 
2022/09/16 09:19:37 akmods: Building rpms failed; see /var/cache/akmods/nvidia/515.65.01-1-for-6.0.0-0.rc5.37.fc38.x86_64.failed.log for details

I then tried the suggested “/usr/sbin/akmods --force” but same result.

Did you look at /var/cache/akmods/nvidia/515.65.01-1-for-6.0.0-0.rc5.37.fc38.x86_64.failed.log as suggested at the very beginning of that post? It told you the details were there.

There should have been no need to do an adduser or create a password since when installing akmod-nvidia it installs all the needed tools for the build, including any needed users. (only ‘root’ is required).

The mock package is not part of using akmods.

# dnf info mock
Last metadata expiration check: 1:15:39 ago on Fri 16 Sep 2022 10:51:40 AM CDT.
Available Packages
Name         : mock
Version      : 3.1
Release      : 1.fc36
Architecture : noarch
Size         : 193 k
Source       : mock-3.1-1.fc36.src.rpm
Repository   : updates
Summary      : Builds packages inside chroots
URL          : https://github.com/rpm-software-management/mock/
License      : GPLv2+
Description  : Mock takes an SRPM and builds it in a chroot.

Using