How to Purge NVIDIA runFile Driver Installations from Rocky Linux

Garry Gayles
Garry Gayles
  • Updated
Purging NVIDXIA *.run file driver installations from Rocky Linux
 
An Overview:
 
To remove an NVIDIA driver installed via a runfile installer on Rocky Linux ...
 
Use the built-in uninstaller for the installer. 
 
  1. Locate the directory where the installer was run (often /usr/local/cuda-X.Y/bin for CUDA installations).
  2. Execute the uninstaller script with root privileges. 
     
Example: sudo /usr/local/cuda-X.Y/bin/cuda-uninstaller. 
 
If the driver was installed by other means such as aRPM or a metapackage, use dnf remove with the appropriate package names, such assudo dnf remove nvidia-driver. 
 
After uninstallation, it may be necessary to clean up leftover files or configurations using dnf autoremove and potentially manually removing files if the uninstaller does not detect and remove everything. 
 
Procedure:
 
1. Identify the Installation Method:
  •  
     
    If a .run file ( such as the CUDA installer ) was used, an uninstall.sh script or a similar script will be found in the installation directory ( e.g., /usr/local/cuda-X.Y/bin/cuda-uninstaller ) .
  •  
    If RPM packages were used, it will be necessary to identify the specific packages ( e.g., nvidia-driver, nvidia-settings, xorg-x11-drv-nvidia) and use dnf remove. 
     
2. Using the Runfile Uninstaller:
  • Navigate to the directory where the installer was run (e.g., /usr/local/cuda-X.Y/bin) .
  • Execute the uninstaller script with sudo: sudo /usr/local/cuda-X.Y/bin/cuda-uninstaller or sudo sh uninstall.sh .
  • Enter a password when prompted. 
 
3. Using DNF for RPM/Metapackage Installs:
  • Identify the installed NVIDIA packages using dnf list installed | grep nvidia .
  • Use sudo dnf remove <package_name> to remove them. 

    For example: sudo dnf remove nvidia-driver nvidia-settings.

This video shows how to use DNF to remove Nvidia drivers on Rocky Linux:
 
4. Cleaning Up:
 
  • dnf autoremove:
    After removing packages, run sudo dnf autoremove to remove any orphaned dependencies.
  • Manual Cleanup:
    If the uninstaller or dnf doesn't remove all files, you might need to manually locate and remove remaining NVIDIA-related files and directories. You can use commands like find /usr/lib -iname "*nvidia*" to search for them and then carefully delete them if needed.
  • Reboot:
    After uninstalling, it's often recommended to reboot your system to ensure that all changes are properly applied. 
     
Important Considerations:
 
  • Version Compatibility:
    Ensure that the kernel module and NVIDIA driver versions are compatible. You might need to reinstall the driver or kernel if there are mismatches.
  • Backup:
    Before making significant changes, it's always a good idea to back up your system or create a system snapshot.
  • Documentation:
    Refer to the official NVIDIA documentation for your specific driver and CUDA versions for the most accurate and up-to-date instructions. 
     
    Purging NVIDXIA *.run file driver installations from Rocky Linux complete. 

Related to

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.