Install nvidia drivers for Fedora and RHEL

Setting up rpmfusion


sudo dnf install$(rpm -E %fedora).noarch.rpm
sudo dnf install$(rpm -E %fedora).noarch.rpm

RHEL like

sudo dnf install --nogpgcheck$(rpm -E %rhel).noarch.rpm
sudo dnf install --nogpgcheck$(rpm -E %rhel).noarch.rpm$(rpm -E %rhel).noarch.rpm
sudo dnf config-manager --enable powertools

Run update

sudo dnf upgrade -y

Install nvidia 5xx driver

sudo dnf install akmod-nvidia -y
sudo dnf install xorg-x11-drv-nvidia-cuda -y #optional for cuda/nvdec/nvenc support

Install nvidia 470xx driver

sudo dnf install xorg-x11-drv-nvidia-470xx akmod-nvidia-470xx -y
sudo dnf install xorg-x11-drv-nvidia-470xx-cuda -y #optional for cuda up to 11.4 support

WARNING FOR 390 AND 340 DRIVERS!!! Attention: 3D applications will not work in Wine-based projects (Steam Proton, Bottles and others) or will work very slowly. Also, the Wayland session will not be available

Install nvidia 390xx driver

sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx -y
sudo dnf install xorg-x11-drv-nvidia-390xx-cuda -y #optional for cuda up to 9.2 support

Install nvidia 340xx drive

sudo dnf install xorg-x11-drv-nvidia-340xx akmod-nvidia-340xx -y
sudo dnf install xorg-x11-drv-nvidia-340xx-cuda -y #optional for cuda up to 6.5 support