How To Install NVIDIA Drivers on AlmaLinux 10
In this tutorial, we will show you how to install NVIDIA Drivers on AlmaLinux 10. Installing NVIDIA drivers on AlmaLinux 10 is essential for users who need optimal GPU performance for gaming, machine learning, cryptocurrency mining, or professional graphics workloads. This comprehensive guide walks you through multiple installation methods, troubleshooting techniques, and optimization strategies to ensure your NVIDIA graphics card functions perfectly with AlmaLinux 10.
AlmaLinux 10, as a Red Hat Enterprise Linux (RHEL) rebuild, maintains enterprise-grade stability while providing cutting-edge hardware support. However, proprietary NVIDIA drivers require careful installation to avoid conflicts with the default nouveau drivers and ensure compatibility with the Linux kernel.
Prerequisites and System Preparation
Before beginning the NVIDIA driver installation process, you must prepare your AlmaLinux 10 system properly. This preparation phase prevents installation failures and ensures optimal driver performance.
System Requirements Assessment
First, verify that your system can detect the NVIDIA GPU. Execute the following command to identify your graphics hardware:
lspci | grep -e NVIDIA
This command displays information about your NVIDIA graphics card, including the model number and PCI bus details. A typical output might show: “NVIDIA Corporation GP106 [GeForce GTX 1060 6GB].”
Next, check your current kernel version and ensure your system is fully updated:
uname -r
sudo dnf upgrade --refresh
Updating your AlmaLinux 10 system minimizes potential conflicts during driver installation and ensures you have the latest security patches.
Secure Boot Considerations
Secure Boot can interfere with NVIDIA driver installation. Check your Secure Boot status using:
mokutil --sb-state
If Secure Boot is enabled, you may encounter installation difficulties. Consider disabling Secure Boot in your BIOS/UEFI settings for smoother driver installation.
Repository Configuration
Enable essential repositories for accessing additional packages and dependencies:
sudo dnf config-manager --set-enabled powertools
sudo dnf config-manager --set-enabled crb
sudo dnf install epel-release
sudo dnf makecache
These repositories provide access to development tools, kernel headers, and other packages required for successful NVIDIA driver compilation and installation.
Understanding NVIDIA Driver Installation Methods
AlmaLinux 10 users have three primary methods for installing NVIDIA drivers, each with distinct advantages and use cases.
- Precompiled Binary Drivers offer the easiest installation experience with automatic dependency resolution and streamlined updates. This method is recommended for most users because it provides stability and reliability without requiring manual compilation.
- Source Compilation gives advanced users complete control over driver features and optimizations. However, this approach requires switching to the ELRepo mainline kernel and involves more complex configuration steps.
- Manual .run File Installation provides direct access to the latest NVIDIA drivers but requires manual dependency management and system configuration. This method suits users who need cutting-edge features or specific driver versions.
Method 1: Installing Precompiled Binary Drivers (Recommended)
The precompiled binary driver method offers the most straightforward installation process with minimal user intervention required.
Repository Setup and Configuration
Add the official NVIDIA CUDA repository for RHEL/AlmaLinux compatibility:
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo
sudo dnf makecache
This repository provides precompiled NVIDIA drivers optimized for Red Hat-based distributions.
Dependency Installation
Install essential development packages and kernel components:
sudo dnf install kernel-headers-$(uname -r) kernel-devel-$(uname -r) tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-opengl libglvnd-glx libglvnd-devel acpid pkgconfig dkms
These dependencies ensure proper driver compilation and system integration. The Dynamic Kernel Module Support (DKMS) framework automatically rebuilds drivers when kernel updates occur.
Nouveau Driver Blacklisting
Prevent conflicts between the open-source nouveau driver and proprietary NVIDIA drivers:
echo "blacklist nouveau" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
echo 'omit_drivers+=" nouveau "' | sudo tee /etc/dracut.conf.d/blacklist-nouveau.conf
Regenerate the initial RAM filesystem to apply these changes:
sudo dracut --regenerate-all --force
sudo depmod -a
This process ensures the nouveau driver doesn’t load during system boot.
NVIDIA Driver Installation Process
Install the latest NVIDIA driver module using DNF:
sudo dnf module install nvidia-driver:latest-dkms
The DKMS version automatically handles kernel module recompilation during kernel updates, providing long-term stability.
For CUDA development and machine learning applications, install additional libraries:
sudo dnf install freeglut-devel libX11-devel libXi-devel libXmu-devel make mesa-libGLU-devel freeimage-devel libglfw3-devel
Post-Installation Configuration
After installation, reboot your system to load the new kernel modules:
sudo reboot
Upon restart, verify the installation success using:
nvidia-smi
This command displays GPU information, driver version, and current utilization statistics.
Method 2: Source Compilation with ELRepo Kernel
Advanced users who require cutting-edge kernel features or specific optimizations may prefer compiling NVIDIA drivers from source.
ELRepo Kernel Requirements
Source compilation requires the ELRepo mainline kernel for optimal hardware compatibility. Install ELRepo repository:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo dnf install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm
sudo dnf config-manager --set-enabled elrepo-kernel
sudo dnf makecache
Install the mainline kernel packages:
sudo dnf install kernel-ml kernel-ml-modules kernel-ml-modules-extra kernel-ml-devel kernel-headers
The mainline kernel provides better hardware support and newer features compared to the standard AlmaLinux kernel.
Compilation Environment Setup
Ensure all development tools and dependencies are installed:
sudo dnf groupinstall "Development Tools"
sudo dnf install dkms kernel-devel-$(uname -r)
Configure your system for DKMS-based driver installation:
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo
sudo dnf module install nvidia-driver:latest-dkms
Compilation Process and Verification
After installation, disable nouveau drivers and regenerate the initramfs:
printf 'blacklist nouveau\n' | sudo tee /etc/modprobe.d/nouveau-blacklist.conf
sudo dracut -f --regenerate-all
Switch to multi-user mode for driver loading:
sudo systemctl set-default multi-user.target
sudo reboot
After reboot, return to graphical mode:
sudo systemctl set-default graphical.target
sudo reboot
This process ensures proper driver initialization and system stability.
Method 3: Manual .run File Installation
The manual installation method provides access to the latest NVIDIA drivers directly from NVIDIA’s website.
Preparation for Manual Installation
Download the appropriate driver from NVIDIA’s official website based on your GPU model and Linux distribution. Navigate to the NVIDIA Unix driver archive and select the compatible version.
Verify your download and make the file executable:
ls NVIDIA-Linux-x86_64-*
chmod +x NVIDIA-Linux-x86_64-*.run
System Configuration Changes
Switch to runlevel 3 (multi-user mode without GUI) to prevent X server conflicts during installation:
sudo init 3
Ensure no graphical processes are running that might interfere with driver installation.
Installation Execution
Run the NVIDIA installer with appropriate options:
sudo ./NVIDIA-Linux-x86_64-*.run --accept-license --silent --run-nvidia-xconfig --dkms
The --dkms
flag enables automatic recompilation during kernel updates, while --run-nvidia-xconfig
configures X11 for the new driver.
Post-Installation System Updates
Update the initramfs and GRUB configuration:
sudo dracut -f
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
Return to graphical mode:
sudo systemctl set-default graphical.target
sudo reboot
Verification and Testing
Proper verification ensures your NVIDIA drivers function correctly and provide optimal performance.
Driver Installation Verification
Use the nvidia-smi
command to check driver status:
nvidia-smi
This utility displays GPU temperature, memory usage, driver version, and running processes. A successful installation shows detailed GPU information without errors.
Verify kernel module loading:
lsmod | grep nvidia
You should see multiple NVIDIA kernel modules loaded, including nvidia
, nvidia_modeset
, and nvidia_uvm
.
Performance Testing
Test basic GPU functionality with OpenGL applications:
glxinfo | grep -i nvidia
glxgears
For CUDA-enabled applications, verify CUDA runtime:
nvidia-smi -q
nvcc --version
Monitoring and Maintenance
Install nvtop
for real-time GPU monitoring:
sudo dnf install nvtop
nvtop
This tool provides detailed GPU utilization statistics, memory usage, and process information.
Troubleshooting Common Issues
Even with careful preparation, NVIDIA driver installation can encounter various issues that require specific solutions.
Installation Failure Scenarios
If nvidia-smi
returns “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver,” check kernel module loading:
sudo modprobe nvidia
dmesg | tail -20
Examine kernel messages for error details and potential conflicts.
Secure Boot Conflicts
Secure Boot can prevent unsigned kernel modules from loading. Either disable Secure Boot in BIOS or sign the NVIDIA modules:
sudo mokutil --disable-validation
Reboot and follow the MOK (Machine Owner Key) enrollment process.
Driver Compatibility Problems
For kernel update conflicts, reinstall DKMS drivers:
sudo dnf remove nvidia-driver
sudo dnf module reset nvidia-driver
sudo dnf module install nvidia-driver:latest-dkms
This process rebuilds drivers for the current kernel version.
Performance and Stability Issues
Monitor GPU temperatures and adjust power limits if necessary:
nvidia-smi -pl 250 # Set power limit to 250W
nvidia-smi -lgc 1500 # Set graphics clock limit
Create systemd services for persistent power management settings across reboots.
Best Practices and Optimization
Implementing proper maintenance and optimization strategies ensures long-term stability and performance.
Maintenance and Updates
Regularly check for driver updates:
sudo dnf check-update nvidia-driver
sudo dnf upgrade
Monitor NVIDIA’s release notes for security updates and performance improvements.
Performance Optimization
For server environments, disable unnecessary GUI features:
sudo nvidia-smi -pm 1 # Enable persistence mode
sudo nvidia-smi -e 0 # Disable ECC memory (if supported)
Configure GPU fan curves and temperature limits based on your cooling solution and use case requirements.
Security Considerations
Regularly update drivers to address security vulnerabilities. Monitor CVE databases for NVIDIA-specific security advisories and apply patches promptly.
Implement proper access controls for GPU resources in multi-user environments using cgroups and systemd resource management.
Congratulations! You have successfully installed NVIDIA Driver. Thanks for using this tutorial for installing the NVIDIA Drivers on your AlmaLinux OS 10 system. For additional help or useful information, we recommend you check the official NVIDIA website.