Installing Nvidia drivers on CentOS 8

Issues related to hardware problems
secetspaces
Posts: 10
Joined: 2020/11/13 12:15:09

Installing Nvidia drivers on CentOS 8

Post by secetspaces » 2020/11/13 12:24:56

Hi everone,
I use this thread for my question because I think it's related:

pre-history:
I had the kmod nvidia drivers working on CentOS7 and even CentOS Stream,
but after putting the OS drive in very differetn system and updating there switching back to the original system disabled the nvidia drivers...

nowadays:
Trying to reinstall the kmod nvidia drivers with results in strange dependency issues

Code: Select all

echo "sudo  dnf install dkms kmod-nvidia nvidia-x11-drv

Error: 
 Problem: cannot install the best candidate for the job
  - package kmod-nvidia-390xx-3:390.138-1.el8.x86_64 obsoletes kmod-nvidia < 3:390.138 provided by kmod-nvidia-450.80.02-1.el8_2.elrepo.x86_64
  - cannot install both kmod-nvidia-3:455.38-1.el8.x86_64 and kmod-nvidia-450.80.02-1.el8_2.elrepo.x86_64
  - package nvidia-x11-drv-450.80.02-1.el8_2.elrepo.x86_64 requires kmod-nvidia = 450.80.02, but none of the providers can be installed
  - package kmod-nvidia-340xx-1:340.108-4.el8.x86_64 requires kmod-nvidia-340xx-4.18.0-147.el8.x86_64 >= 1:340.108-4.el8, but none of the providers can be installed
  - nothing provides kernel(efi) = 0xde6d3e5a needed by kmod-nvidia-450.80.02-2.el8_2.elrepo.x86_64
  - nothing provides kernel < 4.18.0-148.el8 needed by kmod-nvidia-340xx-4.18.0-147.el8.x86_64-1:340.108-4.el8.x86_64

";
I've had set setsebool -P domain_can_mmap_files 1 previously

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing Nvidia drivers on CentOS 8

Post by TrevorH » 2020/11/13 19:37:52

You have a kmod-nvidia installed that is NOT from ELRepo and you need to remove that before you can install the ELRepo version.

Also, it's unclear to me if you are running CentOS Linux 8 or Stream. ELRepo only works with CentOS Linux 8 not the alpha/beta product known as Stream.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing Nvidia drivers on CentOS 8

Post by TrevorH » 2020/11/14 00:02:39

Actually, re-reading that output now, I was wrong, you do not have a non-ELRepo copy of the drivers installed at the moment, it's the other way around. You have added a new repo that also contains kmod-nvidia* packages and it has picked those up - and what looks like the wrong version of them given the -390xx suffix on the package name - and is trying to replace your ELRepo version with those.

What's the output from rpm -qa \*nvidia\* and also from dnf list kmod-nvidia\* --moplugins --showdupli
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

secetspaces
Posts: 10
Joined: 2020/11/13 12:15:09

Re: Installing Nvidia drivers on CentOS 8

Post by secetspaces » 2020/11/16 09:01:21

Thanks for your efforts!
I am running a Stream release, unknowing about incompatibility of elrepo.
How can I roll back to the stable version? I only find threads for the other way around.


rpm -qa \*nvidia\*:
xorg-x11-drv-nvidia-cuda-libs-455.38-1.el8.x86_64

dnf list kmod-nvidia\* --moplugins --showdupli:
Available Packages
kmod-nvidia.x86_64 440.64-1.el8_1.elrepo elrepo
kmod-nvidia.x86_64 440.82-1.el8_1.elrepo elrepo
kmod-nvidia.x86_64 440.82-2.el8_2.elrepo elrepo
kmod-nvidia.x86_64 440.100-1.el8_2.elrepo elrepo
kmod-nvidia.x86_64 450.57-1.el8_2.elrepo elrepo
kmod-nvidia.x86_64 450.66-1.el8_2.elrepo elrepo
kmod-nvidia.x86_64 450.80.02-1.el8_2.elrepo elrepo
kmod-nvidia.x86_64 450.80.02-2.el8_2.elrepo elrepo
kmod-nvidia.x86_64 3:455.38-1.el8 rpmfusion-nonfree-updates
kmod-nvidia-340xx.x86_64 1:340.108-4.el8 rpmfusion-nonfree-updates
kmod-nvidia-340xx-4.18.0-147.el8.x86_64.x86_64
1:340.108-4.el8 rpmfusion-nonfree-updates
kmod-nvidia-390xx.x86_64 390.132-1.el8_1.elrepo elrepo
kmod-nvidia-390xx.x86_64 390.132-2.el8_2.elrepo elrepo
kmod-nvidia-390xx.x86_64 390.138-1.el8_2.elrepo elrepo
kmod-nvidia-390xx.x86_64 3:390.138-1.el8 rpmfusion-nonfree-updates
kmod-nvidia-390xx-4.18.0-193.el8.x86_64.x86_64
3:390.138-1.el8 rpmfusion-nonfree-updates
kmod-nvidia-4.18.0-193.el8.x86_64.x86_64
3:455.38-1.el8 rpmfusion-nonfree-updates

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing Nvidia drivers on CentOS 8

Post by TrevorH » 2020/11/16 10:32:50

So you are picking up the version from rpmfusion and it looks like it's also the wrong package (-390xx).

To revert to non-Stream you would have to uninstall the centos-stream-release (and make sure that centos-release, shortly to be renamed to centos-linux-release) is still installed and that the correct set of repos is enabled. Once that's done a dnf distro-sync ought to get you most of the way back to CentOS Linux 8. Maybe.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

secetspaces
Posts: 10
Joined: 2020/11/13 12:15:09

Re: Installing Nvidia drivers on CentOS 8

Post by secetspaces » 2020/11/16 12:33:06

Ok, I removed rpmfusion stuff.

How would I know that 3900 is the wrong version?

There was a thing for yum prohibiting kmod updates that don't work with the current kernel.
I think it is called 'yum-plugin-kmod'. Is there something like that in DNF as well?

In UEFI boot menu I see below the latest CentOS Stream some CentOS Linux entries,
although I installed Stream from the get go.
Could you please tell me more detailed steps to uninstall Stream?

sudo dnf remove centos-stream-release
Error:
Problem: The operation would result in removing the following protected packages: setup

dnf info centos-release
Error: No matching Packages to list
dnf info centos-linux-release
Error: No matching Packages to list

uname -r
4.18.0-240.el8.x86_64

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing Nvidia drivers on CentOS 8

Post by TrevorH » 2020/11/16 18:51:43

How would I know that 3900 is the wrong version?
Well the only reason I assume it is wrong is that it was trying to replace kmod-nvidia with kmod-nvidia-390xx. The 390xx package is the legacy driver for cards that are not supported any more.

ELRepo have an nvidia-detect package which supplies a script of the same name that looks up the card pci vendor/device and tells you which of their drivers you should use. They also have a kmod-nvidia-390xx as well as the kmod-nvidia that supports current cards.

For centos-stream-release you might try downloading the centos-linux-release package and then using `dnf shell` to install the one and remove the other in one transaction. But I am not sure that it is possible to switch from one to the other.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

secetspaces
Posts: 10
Joined: 2020/11/13 12:15:09

Re: Installing Nvidia drivers on CentOS 8

Post by secetspaces » 2020/11/17 10:27:58

sudo dnf install ./centos-release-8.2-2.2004.0.2.el8.x86_64.rpm --nobest && sudo dnf remove centos-stream-release


Error:
Problem: problem with installed package centos-stream-release-8.4-1.el8.noarch
- installed package centos-stream-release-8.4-1.el8.noarch obsoletes centos-release < 8.2-3 provided by centos-release-8.2-2.2004.0.2.el8.x86_64
- package centos-stream-release-8.4-1.el8.noarch obsoletes centos-release < 8.2-3 provided by centos-release-8.2-2.2004.0.2.el8.x86_64
- conflicting requests

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing Nvidia drivers on CentOS 8

Post by TrevorH » 2020/11/17 10:32:52

Try using dnf shell to do it.

dnf shell
remove centos-stream-release
install ./centos-release-8.2-2.2004.0.2.el8.x86_64.rpm
run
exit
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

secetspaces
Posts: 10
Joined: 2020/11/13 12:15:09

Re: Installing Nvidia drivers on CentOS 8

Post by secetspaces » 2020/11/17 10:35:08

Ok, I succeeded without knowing what a shell actually is.
I needed to execute line by line.
But somehow I am still on the stream kernel I think.

Running transaction
Preparing : 1/1
Running scriptlet: centos-release-8.2-2.2004.0.2.el8.x86_64 1/1
Installing : centos-release-8.2-2.2004.0.2.el8.x86_64 1/2
Erasing : centos-stream-release-8.4-1.el8.noarch 2/2
Running scriptlet: centos-stream-release-8.4-1.el8.noarch 2/2
Verifying : centos-release-8.2-2.2004.0.2.el8.x86_64 1/2
Verifying : centos-stream-release-8.4-1.el8.noarch 2/2
Installed products updated.
Installed:
centos-release-8.2-2.2004.0.2.el8.x86_64
Removed:
centos-stream-release-8.4-1.el8.noarch

dnf distr-sync:
Installing:
centos-stream-release noarch 8.4-1.el8 baseos 21 k
replacing centos-release.x86_64 8.2-2.2004.0.2.el8
I aborted this!

during reboot still the stream kernel is listed

and uname -r says so as well:
4.18.0-240.el8.x86_64

dnf update also wants to get the stream-release back:
centos-stream-release noarch 8.4-1.el8 baseos 21 k
replacing centos-release.x86_64 8.2-2.2004.0.2.el8
Last edited by secetspaces on 2020/11/17 11:05:08, edited 1 time in total.

Post Reply