Pegasi Wiki

This wiki acts as a memo for our own work so why not share them? Feel free to browse and use out notes and leave a note while at it.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

nvidia_to_centos [2020/07/03 09:15] (current)
Pekka Kuronen created
Line 1: Line 1:
 +===== How to install Nvidia drivers to CentOS 8 / RHEL 8 workstation with secure boot =====
  
 +Just did this myself and wrote it down here. How to get your NVidia card working with NVidia drivers using UEFI secure boot. A compact list of commands to execute.
 +
 +==== Download drivers ====
 +
 +<​code>​
 +lcpci | grep -i nvidia
 +</​code>​
 +
 +Identify model and download latest Linux drivers from [[https://​www.nvidia.com/​Download/​index.aspx|NVidia]].
 +
 +==== Secure boot extras ====
 +
 +Make a certificate,​ import it and reboot. We will use this key/cert with NVidia driver installer.
 +
 +<​code>​
 +openssl req -new -x509 -newkey rsa:2048 -keyout /​etc/​pki/​tls/​private/​nvidia.key -outform DER -out /​etc/​pki/​tls/​certs/​nvidia.crt -nodes -days 36500 -subj "/​CN=Graphics Drivers"​
 +mokutil --import /​etc/​pki/​tls/​certs/​nvidia.crt ​
 +sync
 +reboot
 +</​code>​
 +
 +==== Add necessary software ====
 +
 +<​code>​
 +dnf groupinstall "​Development Tools"
 +dnf install libglvnd-devel elfutils-libelf-devel
 +</​code>​
 +
 +==== Disable Nouveau ====
 +
 +This should be enough for latest CentOS / RHEL 8:
 +
 +<​code>​
 +grub2-editenv - set "​$(grub2-editenv - list | grep kernelopts) nouveau.modeset=0"​
 +</​code>​
 +
 +The old way is to edit /​etc/​default/​grub to add nouveau.modeset=0 in the end of line CRUB_CMDLINE_LINUX so it looks like this:
 +
 +<​code>​
 +GRUB_CMDLINE_LINUX="​crashkernel=auto <stuff deleted from here> nomodeset quiet nouveau.modeset=0"​
 +</​code>​
 +
 +Feel free to do it since it makes no harm. Next make grub config:
 +
 +<​code>​
 +grub2-mkconfig
 +</​code>​
 +
 +Disable nouveau module by creating vim /​etc/​modprobe.d/​nvidia.conf and adding:
 +
 +<​code>​
 +blacklist nouveau
 +options nouveau modeset=0
 +</​code>​
 +
 +And running:
 +
 +<​code>​
 +dracut --force
 +sync
 +reboot
 +</​code>​
 +
 +==== Install Nvidia driver ====
 +
 +Use the credentials we created earlier to support secure boot. Answer "​yes"​ to installation of NVIDIA'​s 32-bit compatibility libraries, overwrite existing libglvnd files and automatic update of your X configuration file.
 +
 +<​code>​
 +systemctl isolate multi-user.target
 +sh NVIDIA-Linux-x86_64-440.82.run -s --module-signing-secret-key=/​etc/​pki/​tls/​private/​nvidia.key --module-signing-public-key=/​etc/​pki/​tls/​certs/​nvidia.crt ​
 +reboot
 +</​code>​
 +
 +If boot is not successful do:
 +
 +<​code>​
 +systemctl restart systemd-logind
 +reboot
 +</​code>​
 +
 +===== Comments =====
 +
 +All comments and corrections are welcome.
 +
 +{(rater>​id=nvidia_to_centos|type=rate|trace=ip|tracedetails=0|headline=off)}
 +
 +~~DISCUSSION|Leave a comment~~
 +
 +~~QUICKSTATS:​nvidia_to_centos@&​basics~~
 + 
 +~~QUICKSTATS:​nvidia_to_centos&​ip~~~~NOCACHE~~
 +~~QUICKSTATS:​nvidia_to_centos&​basics~~
 +~~QUICKSTATS:​nvidia_to_centos&​ip~~

  //check if we are running within the DokuWiki environment if (!defined("DOKU_INC")){ die(); } //place the needed HTML source codes BELOW this line