Quick note for those not familiar with the CentOS 7 peculiarity and especially the repository peculiarity.
Receiving the follwoing error:
--> Finished Dependency Resolution
Error: Package: 3:kmod-nvidia-latest-dkms-418.87.00-2.el7.x86_64 (cuda)
Requires: dkms
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
It means you need a package (or meta-package, which might pull multiple packages and dependencies offering a big framework, for example), which could not be found in the existing repositories. In this very case, we need the DKMS (Dynamic Kernel Module Support) – https://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support
The DKMS is offered in epel repository and it could not be found in the CentOS 7 official repositories. Just add the epel repository.
Nvidia CUDA Toolkit supports CentOS 7 and it is relatively simple to install it. Nvidia provides three types of installation – a big setup file, a big rpm file and an official Nvidia repository, which we are going to use it in this article. The Nvidia repository contains the Nvidia video driver for the Nvidia video cards like GeForce, GTX, RTX and so on. You may need CUDA Toolkit if you are a game developer or you want to build yourself some of the mining software like XMR-STAK.
In this article, we are going to use the NVIDIA official repository for CUDA and the video driver module. There are other ways to install CUDA, which are not the purpose of this article. Using an official repository is the best practice for installing software on your system.
STEP 1) Update and install the NVIDIA official repository.
Fedora 28 comes with open source driver for NVIDIA cards, so you’ll get a decent and stable driver for your video, but without hardware acceleration and a machine not good for gaming like Steam, not good for scientific usage or crypt mining! In fact in recent open source versions (called nouveau) of the NVIDIA driver some cards got partial hardware acceleration, but most of the latest cards out there still need the proprietary driver!
Our test system is equipped with ASUS ROG Poseidon GeForce® GTX 1080 TI 11GB Platinum Edition by default here is the linux kernel output:
[myuser@localhost ~]$ lspci |grep -i nvidia
0a:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
0a:00.1 Audio device: NVIDIA Corporation GP102 HDMI Audio Controller (rev a1)
[myuser@localhost ~]$ dmesg|grep -i nvidia
[ 4.606404] nouveau 0000:0a:00.0: NVIDIA GP102 (132000a1)
[ 7.776389] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input14
[ 7.776487] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input15
[ 7.776548] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[ 7.776608] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[myuser@localhost ~]$ cat /proc/modules |grep nouveau
nouveau 2019328 21 - Live 0x0000000000000000
video 45056 2 asus_wmi,nouveau, Live 0x0000000000000000
drm_kms_helper 200704 1 nouveau, Live 0x0000000000000000
mxm_wmi 16384 1 nouveau, Live 0x0000000000000000
ttm 126976 1 nouveau, Live 0x0000000000000000
drm 454656 24 nouveau,drm_kms_helper,ttm, Live 0x0000000000000000
i2c_algo_bit 16384 2 nouveau,igb, Live 0x0000000000000000
wmi 28672 4 asus_wmi,wmi_bmof,nouveau,mxm_wmi, Live 0x0000000000000000
Here are the steps to install NVIDIA proprietary driver on Fedora 28:
STEP 1) Disable UEFI Secure Boot
Check in your BIOS if this feature is enabled. You should disabled it or after a successful installation of the kernel module you must sign it, which is not the goal of this howto. It is probably disabled if you use Linux, but it could be enabled if you use signed kernel, so it is good to check this settings because your driver won’t run if this feature is enabled.
STEP 2) Update your system and reboot. Then install the dependencies for the NVIDIA driver
DKMS is used for building the NVIDIA kernel module when a new kernel is installed. So you do not have to worry if you update your kernel. At first best way is to become root with sudo.
STEP 3) Download the official NVIDIA installer application
Here is the NVIDIA search driver page – https://www.nvidia.com/Download/Find.aspx, just find the card you own and download the driver. Here are the steps we’d past:
So at the end you get a file NVIDIA-Linux-x86_64-390.67.run
Select your video card and click on “Search”, we selected GeForce GTX 1080 Ti. Select your video card
Click on the top driver, which is not “beta”. Click on the driver to download
Infromation for the NVIDIA display driver. The most recent is version 390.67. Click on “Download”. Click on download
Click on download again to begin downloading the installation file. You can download NVIDIA End User License Agreement, too. Click on download again to begin downloading the installation file.
STEP 4) Disable the open source nouveau.
The driver must be blacklisted on two places, when the initramfs loads and during the fedora 28 systemd booting. So first put the following in
This is just an example, do not copy the whole line, just add at the end before the ending quotes rd.driver.blacklist=nouveau
STEP 5) Update grub configuration and remove the open source driver from x11 and initram
[root@localhost ~]# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.17.3-200.fc28.x86_64
Found initrd image: /boot/initramfs-4.17.3-200.fc28.x86_64.img
Found linux image: /boot/vmlinuz-4.16.3-301.fc28.x86_64
Found initrd image: /boot/initramfs-4.16.3-301.fc28.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-d11e97619bd242a39cd53700ce473c6c
Found initrd image: /boot/initramfs-0-rescue-d11e97619bd242a39cd53700ce473c6c.img
Found Windows Boot Manager on /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi
Found Ubuntu 16.04.4 LTS (16.04) on /dev/sda2
done
[root@localhost ~]# #commeted, use only if your BIOS is not in UEFI mode!!!
[root@localhost ~]# #grub2-mkconfig -o /boot/grub2/grub.cfg
[root@localhost ~]# dnf remove xorg-x11-drv-nouveau
Dependencies resolved.
=======================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================
Removing:
xorg-x11-drv-nouveau x86_64 1:1.0.15-4.fc28 @anaconda 229 k
Transaction Summary
=======================================================================================================================================================================
Remove 1 Package
Freed space: 229 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : xorg-x11-drv-nouveau-1:1.0.15-4.fc28.x86_64 1/1
Running scriptlet: xorg-x11-drv-nouveau-1:1.0.15-4.fc28.x86_64 1/1
Verifying : xorg-x11-drv-nouveau-1:1.0.15-4.fc28.x86_64 1/1
Removed:
xorg-x11-drv-nouveau.x86_64 1:1.0.15-4.fc28
Complete!
[root@localhost ~]# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
[root@localhost ~]# dracut /boot/initramfs-$(uname -r).img $(uname -r)
[root@localhost ~]# systemctl set-default multi-user.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/multi-user.target.
[root@localhost ~]# reboot
As you can see the grub configuration tool found two more operating systems Microsoft Windows 10 and Ubuntu 16 and they are saved in the new configuration, so it is safe to make the new configuration it will preserve the other grub configuration and you’ll be able to boot them if you choose it from the grub menu.
We removed the unnecessary package xorg-x11-drv-nouveau.x86_64, regenerated the initramfs for our kernel and instructed the system to set the default console login – you do not need GUI and you won’t have it (you’ve just removed the GPU driver!) the next time you boot your machine.
STEP 6) Run the NVIDIA installation file from root user
After the restart your system won’t boot in GUI, there will be the login console prompt: Console login
Login with your user and then become root, the installation need to be executed by the root user. Then execute NVIDIA-Linux-x86_64-390.67.run, but before you must change the permissions to executable.
[myuser@localhost myuser]# chmod 755 ./NVIDIA-Linux-x86_64-390.67.run
[myuser@localhost myuser]# sudo su
[root@localhost myuser]# ./NVIDIA-Linux-x86_64-390.67.run
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 390.67.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Select “Yes” using tab key and hit enter.
NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)
Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build
a new module, if you install a different kernel later.
Yes No
NVIDIA Software Installer for Unix/Linux www.nvidia.com
This will allow DKMS to automatically build a new module, if you install a different kernel later.
Select “Yes” using tab key and hit enter.
NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)
Install NVIDIA's 32-bit compatibility libraries?
Yes No
NVIDIA Software Installer for Unix/Linux www.nvidia.com
Install NVIDIA’s 32-bit compatibility libraries
Select “Yes” using tab key and hit enter.
NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that
the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed
up.
Yes No
NVIDIA Software Installer for Unix/Linux www.nvidia.com
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file.
Hit enter to continue. Your NVIDIA driver is isntalled successfully.
NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)
Your X configuration file has been successfully updated. Installation of the NVIDIA Accelerated Graphics
Driver for Linux-x86_64 (version: 390.67) is now complete.
OK
NVIDIA Software Installer for Unix/Linux www.nvidia.com
Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 390.67) is now complete.
STEP 7) Return the default login to be GUI and reboot your machine.
Do not forget you must be root user or execute the commands with sudo.
NVIDIA X server settings – X Server Information. NVIDIA X server settings
NVIDIA X server settings – GPU 0 – (GeForce GTX 1080 Ti) infromation tab. You can see the BIOS version, CUDA cores of 3584, Total Memory 11264 MB, current GPU utilization and more.
[myuser@localhost ~]$ nvidia-smi
Mon Jul 2 03:43:33 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.67 Driver Version: 390.67 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 108... Off | 00000000:0A:00.0 On | N/A |
| 0% 51C P8 14W / 275W | 244MiB / 11175MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1843 G /usr/libexec/Xorg 12MiB |
| 0 2110 G /usr/bin/gnome-shell 49MiB |
| 0 2400 G /usr/libexec/Xorg 61MiB |
| 0 2489 G /usr/bin/gnome-shell 118MiB |
+-----------------------------------------------------------------------------+
vainfo – VA-API driver, the video acceleration API driver
Here is the nouveau – as you can see no acceleration supported:
[myuser@localhost ~]$ vainfo
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/nouveau_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: mesa gallium vaapi
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
And here is after installing the NVIDIA proprietary driver, you get video acceleration for your video player!
We use technologies like cookies to store and/or access device information. We do this to improve browsing experience and to show personalized ads. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.