Issue installing NVIDIA Optimus driver

AlexOceanic

Member
Joined
Jun 30, 2022
Messages
71
Reaction score
8
Credits
978
Hi All

I just encountered an error after attempting to install an Nvidia driver and wondered if anyone might know what the problem is please.

Steps followed from this guide:

1. sudo dnf upgrade --refresh
Completed successfully

2. sudo dnf autoremove nvidia* --purge
sudo /usr/bin/nvidia-uninstall
sudo /usr/local/cuda-X.Y/bin/cuda-uninstall
All failed or files didn't exist

3. sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
Both commands reported the repositories were already installed "nothing to do"

4. sudo dnf install akmod-nvidia
sudo dnf install xorg-x11-drv-nvidia-cuda
Both installed successfully

5. reboot
As Fedora was (taking an age to) boot up, just prior to the login screen, an error message reported something like "Nvidia kernel module missing - reverting to nouveau"

Many thanks

Alex

Make and model of machine:
Clevo W170HN
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Model name: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz
RAM - 8GB
Graphics - NVC1 / Mesa Intel® HD Graphics 3000 (SNB GT2)


Distribution and build number:
Fedora Linux 36 (Workstation Edition)
 
Last edited:


If you have secure boot enabled, disabled and then reboot and see what happens?
 
If you have secure boot enabled, disabled and then reboot and see what happens?
Thanks for the suggestion.

I couldn't see a secure boot option in any of the BIOS menus but saw that UEFI boot had been disabled if its a sub option of that perhaps?

I also noticed that the bootloader gives two options for booting into Fedora now.

Fedora Linux (6.1.12-100.fc36.x86_64) 36 (Workstation Edition)
Fedora Linux (5.17.5-300.fc36.x86_64) 36 (Workstation Edition)
Fedora Linux (rescue)
Windows 8 (not used in months now I'm pleased to say!)

I booted into 5.17 out of curiosity but it gives the same nvidia kernel module error aswell.

Is the 5.7 version an automatically created snapshot of the system before I applied system changes?

Any other thoughts?
 
Please remember to wait after the RPM transaction ends, until the kmod get built. This can take up to 5 minutes on some systems.

Once the module is built, "modinfo -F version nvidia" should outputs the version of the driver such as 440.64 and not modinfo: ERROR: Module nvidia not found.
Did you wait five minutes after installing those Nvidia packages? Also which Nvidia graphics card do you have?
 

Did you wait five minutes after installing those Nvidia packages? Also which Nvidia graphics card do you have?
No I didn't wait 5 minutes after installing the packages as they reported "complete" - do you recommend following all steps (including initial removal" and trying the whole process again or just try to reinstall them?

lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)

Update


I just ran:

sudo dnf install akmod-nvidia

Last metadata expiration check: 2:26:13 ago on Thu 23 Feb 2023 20:26:06 GMT.
Package akmod-nvidia-3:525.89.02-1.fc36.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

You're saying I should wait 5 mins before running "sudo dnf install xorg-x11-drv-nvidia-cuda" and then wait another 5 mins before rebooting yes?
 
Last edited:
You're saying I should wait 5 mins before running "sudo dnf install xorg-x11-drv-nvidia-cuda" and then wait another 5 mins before rebooting yes?

The RPMs actually contain some code that has to be compiled. They are installed, but take a few minutes to compile.

Fedora Linux (6.1.12-100.fc36.x86_64) 36 (Workstation Edition)
Fedora Linux (5.17.5-300.fc36.x86_64) 36 (Workstation Edition)
Fedora Linux (rescue)

This is necessary every time you do a kernel upgrade. Often dnf update -y will update the kernel.
When it does, you have to wait a few mins before the next reboot. Sometimes I can reboot immediately
without waiting, but if I do, the next reboot will take a few minutes longer.

Also Fedora36 is really out of support now, you should consider upgrading to 38.
 
The RPMs actually contain some code that has to be compiled. They are installed, but take a few minutes to compile.



This is necessary every time you do a kernel upgrade. Often dnf update -y will update the kernel.
When it does, you have to wait a few mins before the next reboot. Sometimes I can reboot immediately
without waiting, but if I do, the next reboot will take a few minutes longer.

Also Fedora36 is really out of support now, you should consider upgrading to 38

Thanks for the tips

Are you saying it might be worth running "dnf update -y" as it may update the kernel and possibly resolve the issue if I wait 5 min after it completes before rebooting this time?

I've just run the second command and its also reporting as "complete" so am wondering if its not triggering the compiler to run in the background - would you recommend uninstalling the packages then re-installing?

sudo dnf install xorg-x11-drv-nvidia-cuda
Last metadata expiration check: 2:45:03 ago on Thu 23 Feb 2023 20:26:06 GMT.
Package xorg-x11-drv-nvidia-cuda-3:525.89.02-1.fc36.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

I did see Fedora 37 advertised on the default software manager - do I need to upgrade sequentially from 36 to 37 to 38 or can I just jump from 36 to 38?
 
I typically install the nVidia driver, something like this...

dnf install -y akmod-nvidia kmod-nvidia nvidia-gpu-firmware nvidia-modprobe nvidia-settings xorg-x11-drv-nvidia xorg-x11-drv-nvidia-cuda

I've just run the second command and its also reporting as "complete"

Complete just means the RPM code is installed, it doesn't mean the module is compiled yet.

am wondering if its not triggering the compiler to run in the background - would you recommend uninstalling the packages then re-installing?

How do you know the compiler isn't running in the background?

What is the output of...

lsmod | grep nvidia

and

glxinfo | head -n 5
 
I did see Fedora 37 advertised on the default software manager - do I need to upgrade sequentially from 36 to 37 to 38 or can I just jump from 36 to 38?

The official documentation says you can jump 2 versions, I have never done it, I usually go one version at a time.

 
I typically install the nVidia driver, something like this...

dnf install -y akmod-nvidia kmod-nvidia nvidia-gpu-firmware nvidia-modprobe nvidia-settings xorg-x11-drv-nvidia xorg-x11-drv-nvidia-cuda



Complete just means the RPM code is installed, it doesn't mean the module is compiled yet.



How do you know the compiler isn't running in the background?

What is the output of...

lsmod | grep nvidia

and

glxinfo | head -n 5
Thanks - I'll try that method if I can't fix the current situation

The outputs are as follows:

lsmod | grep nvidia
glxinfo | head -n 5
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
(no output from initial command as pasted above from terminal)

I'll reboot now and see if it still gives the error.

Any harm in running "dnf update -y" to potentially initiate a new kernel re-compileif it still gives an error?

Update

Reboot did not resolve the error - I gave it a good 15 mins between each command
 
Last edited:
I typically install the nVidia driver, something like this...

dnf install -y akmod-nvidia kmod-nvidia nvidia-gpu-firmware nvidia-modprobe nvidia-settings xorg-x11-drv-nvidia xorg-x11-drv-nvidia-cuda



Complete just means the RPM code is installed, it doesn't mean the module is compiled yet.



How do you know the compiler isn't running in the background?

What is the output of...

lsmod | grep nvidia

and

glxinfo | head -n 5
Thanks - I'll try that method if I can't fix the current situation

The outputs are as follows:

lsmod | grep nvidia
glxinfo | head -n 5
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
(no output from initial command as pasted above from terminal)

I'll reboot now and see if it still gives the error.

Any harm in running "dnf update -y" if it still gives an error?
I never have any trouble running it multiple times.
You might do a ..

dnf clean all

..first.


It appears the nvidia drivers are not installed.
ok thanks

dnf clean all
0 files removed
dnf update -y
Error: This command has to be run with superuser privileges (under the root user on most systems).
sudo dnf update -y
Last metadata expiration check: 3:42:46 ago on Thu 23 Feb 2023 20:26:06 GMT.
Dependencies resolved.
Nothing to do.
Complete!

I'll give it 15 mins then restart again

Update

The error remains after reboot unfortunately.

I'll have another go at it tomorrow - thanks again for your help
 
Last edited:
lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)

You're saying I should wait 5 mins before running "sudo dnf install xorg-x11-drv-nvidia-cuda" and then wait another 5 mins before rebooting yes?
Looks like you installed the wrong driver, your Nvidia graphics card needs the legacy driver: 390xx.
Version: 390.157
Release Date: 2022.11.22
Operating System: Linux 64-bit
Language: English (US)
File Size: 81.86 MB
Under Supported Products:
GeForce 500M Series (Notebooks):
GeForce GTX 580M, GeForce GTX 570M, GeForce GTX 560M, GeForce GT 555M, GeForce GT 550M, GeForce GT 540M, GeForce GT 525M, GeForce GT 520M, GeForce GT 520MX

Remove all the Nvidia packages you currently have installed and then install the following.
Code:
sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx
sudo dnf install xorg-x11-drv-nvidia-390xx-cuda
I think cuda is optional and I don't think you need it but it can't hurt to install it.
After the transaction is complete run the "top" command in another terminal tab or window then you will see your system load go up and a bunch of compile processes running. Once your system's load average is close to 0 again there should be no more compile processes running then you can reboot.
 
Last edited:
Looks like you installed the wrong driver, your Nvidia graphics card needs the legacy driver: 390xx.

Under Supported Products:


Remove all the Nvidia packages you currently have installed and then install the following.
Code:
sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx
sudo dnf install xorg-x11-drv-nvidia-390xx-cuda
I think cuda is optional and I don't think you need it but it can't hurt to install it.
After the transaction is complete run the "top" command in another terminal tab or window then you will see your system load go up and a bunch of compile processes running. Once your system's load average is close to 0 again there should be no more compile processes running then you can reboot.

Thanks for picking up on the incorrect driver but I still encountered issues per the following:

Tried running "sudo dnf autoremove nvidia* --purge" but it returned an error (below) and seemed to expect a letter appended to "autoremove" so I found "dnf erase *nvidia*" that seemed to do a similar job and this appeared to run successfully.

sudo dnf autoremove nvidia* --purge
usage: dnf autoremove [-c [config file]] [-q] [-v] [--version]
[--installroot [path]] [--nodocs] [--noplugins]
[--enableplugin [plugin]] [--disableplugin [plugin]]
[--releasever RELEASEVER] [--setopt SETOPTS]
[--skip-broken] [-h] [--allowerasing] [-b | --nobest]
[-C] [-R [minutes]] [-d [debug level]] [--debugsolver]
[--showduplicates] [-e ERRORLEVEL] [--obsoletes]
[--rpmverbosity [debug level name]] [-y] [--assumeno]
[--enablerepo [repo]] [--disablerepo [repo] | --repo
[repo]] [--enable | --disable] [-x [package]]
[--disableexcludes [repo]] [--repofrompath [repo,path]]
[--noautoremove] [--nogpgcheck] [--color COLOR]
[--refresh] [-4] [-6] [--destdir DESTDIR]
[--downloadonly] [--comment COMMENT] [--bugfix]
[--enhancement] [--newpackage] [--security]
[--advisory ADVISORY] [--bz BUGZILLA] [--cve CVES]
[--sec-severity {Critical,Important,Moderate,Low}]
[--forcearch ARCH]
[PACKAGE ...]
dnf autoremove: error: unrecognized arguments: --purge


I then ran
sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx
sudo dnf install xorg-x11-drv-nvidia-390xx-cuda
(waiting 5 minutes between each command and before rebooting)
I heard the cooling fan die off before starting the second command and rebooting too as wasn't sure what you meant by the "top" command.

Upon rebooting another kernel was created, the "NVIDIA kernel missing - reverting to nouveau" error remained, the resolution defaulted to minimum and wifi was also disabled for some reason.
NVIDIA gave a message "You do not appear to be using the NVIDIA X Driver.
Please edit your X configuration file (just run "nvidia-xconfig" as root and restart the X server."
When attempting to run this the following error was returned:
"sudo: nvidia-xconfig: command not found"
Although I did see the NVIDIA X Server Settings application under "Activities" and which I was able to open but it displays the
"You do not appear to be using the NVIDIA X Driver.
Please edit your X configuration file (just run "nvidia-xconfig" as root and restart the X server." message when I open it - it does open successfully though.

Running
modinfo -F version nvidia
now returns
modinfo: ERROR: Module nvidia not found.
where it previously returned
390.157
in the new, faulty kernel (low res/no wifi)

I rebooted and reverted to the previous kernel which fixed the resolution and wifi.

Any ideas what I may have done wrong?

Thanks
 
Can you share the output of the following?
Code:
dnf list installed | grep nvidia
 
Can you share the output of the following?
Code:
dnf list installed | grep nvidia

Here you go:

dnf list installed | grep nvidia
akmod-nvidia-390xx.x86_64 3:390.157-1.fc36 @rpmfusion-nonfree-updates
kmod-nvidia-390xx-6.1.13-100.fc36.x86_64.x86_64 3:390.157-1.fc36 @@commandline
nvidia-persistenced.x86_64 3:525.89.02-1.fc36 @rpmfusion-nonfree-nvidia-driver
nvidia-settings-390xx.x86_64 390.157-1.fc36 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx.x86_64 3:390.157-2.fc36 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-cuda.x86_64 3:390.157-2.fc36 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-cuda-libs.x86_64 3:390.157-2.fc36 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-kmodsrc.x86_64 3:390.157-2.fc36 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-libs.x86_64 3:390.157-2.fc36 @rpmfusion-nonfree-updates

Just to add that Blender now seems capable of using the GPU to render images (which was the goal) although the selection option menu greys out after I switch from CPU to GPU - not sure if you're familiar with Blender but just thought I'd mention it as it seems the driver is actually installed and perhaps its the X server config that has an issue (noob guessing here). Blender did render the image when instructed to do so although it was mighty slow but not sure if its just because its an older GPU or if it reverted to CPU despite the settings.
 
Last edited:
Can you share the output of the following commands.
Code:
nvidia-smi
lsmod | grep nvidia
I have no experience with Blender.
Maybe Blender needs a graphics card that supports newer drivers?

Normally the xorg config is located here: /etc/X11/xorg.conf, check if your Monitor setup and Nvidia card is mentioned in there. If not you can either run "sudo nvidia-settings" and then configure your monitors and graphics using that interface and then save it in the location mentioned before. Or you can install "nvidia-xconfig" and use that to generate a xorg configuration.
 
Last edited:
Can you share the output of the following commands.
Code:
nvidia-smi
lsmod | grep nvidia
I have no experience with Blender.
Maybe Blender needs a graphics card that supports newer drivers?

Normally the xorg config is located here: /etc/X11/xorg.conf, check if your Monitor setup and Nvidia card is mentioned in there. If not you can either run "sudo nvidia-settings" and then configure your monitors and graphics using that interface and then save it in the location mentioned before. Or you can install "nvidia-xconfig" and use that to generate a xorg configuration.
nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

lsmod | grep nvidia
(No output)

Thanks for the Blender link

I found an /etc/X11/xorg.conf.d directory (see screenshot) and it only contained a file called "00-keyboard.conf" with the following content:

# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "gb"
EndSection

Screenshot from 2023-02-24 15-29-05.png


When I ran "sudo nvidia-settings" the following all occurred simultaneously:

Terminal:

sudo nvidia-settings

ERROR: NVIDIA driver is not loaded

ERROR: Error querying enabled displays on GPU 0 (Missing Extension).

ERROR: Error querying connected displays on GPU 0 (Missing Extension).

ERROR: nvidia-settings could not find the registry key file. This file should
have been installed along with this driver at
/usr/share/nvidia/nvidia-application-profiles-key-documentation. The
application profiles will continue to work, but values cannot be
prepopulated or validated, and will not be listed in the help text.
Please see the README for possible values and descriptions.

The NVIDIA X Server application also started with a separate error message window

"You do not appear to be using the NVIDIA X Driver.
Please edit your X configuration file (just run "nvidia-xconfig" as root and restart the X server."

(Just to confirm that I'm still in the previous kernel rather than the latest broken one which loaded the basic resolution and broke the wifi)
 
Last edited:
Install nvidia-xconfig and then run it.
Code:
sudo dnf install nvidia-xconfig
sudo nvidia-xconfig
Then reboot and run the following again.
Code:
nvidia-smi
lsmod | grep nvidia
Also check if the file /etc/X11/xorg.conf has been created and the contents of that.
 
Install nvidia-xconfig and then run it.
Code:
sudo dnf install nvidia-xconfig
sudo nvidia-xconfig
Then reboot and run the following again.
Code:
nvidia-smi
lsmod | grep nvidia
Also check if the file /etc/X11/xorg.conf has been created and the contents of that.
Stalled at first step unfortunately:

sudo dnf install nvidia-xconfig

Last metadata expiration check: 3:02:43 ago on Fri 24 Feb 2023 12:48:52 GMT.
Error:
Problem: package kmod-nvidia-390xx-6.1.13-100.fc36.x86_64-3:390.157-1.fc36.x86_64 requires nvidia-390xx-kmod-common >= 3:390.157, but none of the providers can be installed
- package xorg-x11-drv-nvidia-390xx-3:390.157-2.fc36.x86_64 requires nvidia-settings-390xx(x86-64) = 390.157, but none of the providers can be installed
- package nvidia-xconfig-3:510.68.02-1.fc36.x86_64 requires xorg-x11-drv-nvidia >= 3:510.68.02, but none of the providers can be installed
- package xorg-x11-drv-nvidia-3:510.68.02-1.fc36.x86_64 requires nvidia-settings(x86-64) = 3:510.68.02, but none of the providers can be installed
- package xorg-x11-drv-nvidia-3:525.89.02-1.fc36.x86_64 requires nvidia-settings(x86-64) = 3:525.89.02, but none of the providers can be installed
- package nvidia-settings-390xx-390.157-1.fc36.x86_64 conflicts with nvidia-settings provided by nvidia-settings-3:510.68.02-1.fc36.x86_64
- package nvidia-settings-390xx-390.157-1.fc36.x86_64 conflicts with nvidia-settings provided by nvidia-settings-3:525.89.02-1.fc36.x86_64
- conflicting requests
- package nvidia-xconfig-3:525.89.02-1.fc36.x86_64 requires xorg-x11-drv-nvidia >= 3:525.89.02, but none of the providers can be installed
- problem with installed package kmod-nvidia-390xx-6.1.13-100.fc36.x86_64-3:390.157-1.fc36.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)

Where this is a relatively new install (only 2 days old) - would it be easer to reinstall fedora then install the correct drivers perhaps?

Maybe I ran some other command that's messed things up prior to this when enabling the rpm repositories etc - its strange that ffmpeg won't install either when I thought I'd followed the same steps as I did a couple of months ago when trying Fedora for the first time for example.

I could jump to Fedora 38 too but happy to carry on if you have the patience.
 
Last edited:

Members online


Top