How To Install NVIDIA Drivers on Fedora 40
Fedora 40, the latest release of the popular Linux distribution, offers a stable and user-friendly environment for both desktop and server users. For those looking to enhance their graphics performance, installing NVIDIA drivers is essential. NVIDIA’s proprietary drivers unlock the full potential of your GPU, enabling better gaming experiences, smoother video editing, and faster 3D rendering. In this comprehensive guide, we’ll walk you through the process of installing NVIDIA drivers on Fedora 40, ensuring you can take full advantage of your graphics card’s capabilities.
Understanding the Basics
Before diving into the installation process, it’s crucial to understand the differences between NVIDIA’s proprietary drivers and the open-source Nouveau drivers. Nouveau drivers are the default graphics drivers in Fedora, providing basic functionality for NVIDIA GPUs. However, they lack the performance optimizations and features found in NVIDIA’s proprietary drivers. By installing NVIDIA drivers, you’ll gain access to advanced features like CUDA support, better power management, and improved compatibility with the latest games and software.
Prerequisites
Before proceeding with the installation, ensure that your NVIDIA GPU is compatible with Fedora 40. NVIDIA provides a list of supported graphics cards on its website. Additionally, you’ll need to disable Secure Boot in your system’s BIOS settings. Secure Boot prevents the installation of unsigned drivers, which includes NVIDIA’s proprietary drivers. Consult your motherboard’s manual for instructions on disabling Secure Boot.
Methods of Installation
There are two primary methods for installing NVIDIA drivers on Fedora 40: the RPM Fusion method and the manual installation method. The RPM Fusion method is recommended for beginners and users who prefer a hassle-free installation process. It leverages the RPM Fusion repositories, which provide pre-packaged NVIDIA drivers for easy installation. On the other hand, the manual installation method is suitable for advanced users who want more control over driver versions and customization options.
Detailed Installation Guide
1. Installing via RPM Fusion
To install NVIDIA drivers using the RPM Fusion method, follow these step-by-step instructions:
Step 1: Add RPM Fusion Repositories
Open a terminal and run the following commands to add the RPM Fusion free and non-free repositories:
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
Step 2: Update System Packages
Update your system packages to ensure compatibility with the latest NVIDIA drivers:
sudo dnf update
Step 3: Install NVIDIA Drivers
Install the NVIDIA drivers and CUDA support by running the following command:
sudo dnf install akmod-nvidia
Step 4: Reboot and Verify Installation
Reboot your system to apply the changes:
sudo reboot
After the reboot, open a terminal and run the following command to verify the installation:
nvidia-smi
If the command displays information about your NVIDIA GPU, the installation was successful.
2. Manual Installation Method
For advanced users who prefer a manual installation, follow these steps:
Step 1: Prepare the System
Install the necessary kernel headers and development tools:
sudo dnf install kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig
Step 2: Download NVIDIA Driver
Visit the NVIDIA website and download the appropriate driver for your GPU and Fedora version. Save the file to your home directory.
Step 3: Disable Nouveau Driver
Create a file named `blacklist-nouveau.conf
` in the `/etc/modprobe.d/
` directory with the following content:
blacklist nouveau
options nouveau modeset=0
Regenerate the kernel initramfs:
sudo dracut --force
Step 4: Install NVIDIA Driver
Make the downloaded `.run` file executable and run the installer:
chmod +x NVIDIA-Linux-x86_64-xxx.xx.run
sudo ./NVIDIA-Linux-x86_64-xxx.xx.run
Follow the on-screen instructions to complete the installation process.
Step 5: Reboot and Verify Installation
Reboot your system and verify the installation using the `nvidia-smi
` command as mentioned in the RPM Fusion method.
Troubleshooting Common Issues
If you encounter any issues during or after the installation process, here are some common troubleshooting tips:
Black Screen Issues
If you experience a black screen after installing the NVIDIA drivers, try the following solutions:
- Press
Ctrl+Alt+F2
to switch to a virtual console, log in, and uninstall the NVIDIA drivers using the commandsudo dnf remove nvidia-*
. Then, reinstall the drivers following the appropriate method. - Boot into recovery mode, remove the NVIDIA drivers and reconfigure Xorg using the command
sudo Xorg -configure
.
Driver Not Recognized
If the system fails to recognize the installed NVIDIA drivers, ensure that you have disabled Secure Boot in the BIOS settings. Additionally, verify that you have installed the correct driver version for your GPU and Fedora version.