If you're experiencing issues with your Nvidia GPU drivers on Ubuntu, or if you just need to reinstall them for any reason, this guide will walk you through the process step by step.
Why Reinstall Nvidia Drivers?
- Fix Graphics Issues: If your screen is flickering, freezing, or performing poorly, reinstalling the drivers can often help.
- After a System Update: Sometimes, system updates can cause driver conflicts, and a fresh installation of the drivers can resolve these issues.
- Upgrade to the Latest Drivers: If you want to make sure you’re using the latest drivers available, a reinstall can help.
Steps to Reinstall Nvidia Drivers:
-
Remove Existing Drivers:
First, you'll need to remove any existing Nvidia drivers from your system. Open a terminal and run the following commands:
sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo apt-get autoclean
These commands will remove all Nvidia packages from your system, along with any dependencies that are no longer needed.
-
Add the Nvidia PPA (Optional but Recommended):
To make sure you get the latest drivers, you can add the official Nvidia PPA (Personal Package Archive):
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
This step is optional, but it’s a good idea if you want to ensure you have the most recent drivers.
-
Install the Nvidia Drivers:
Now you can install the Nvidia drivers. The following command will automatically detect your GPU and install the appropriate driver:
sudo ubuntu-drivers autoinstall
If you prefer to install a specific version, you can use:
sudo apt-get install nvidia-driver-XX
Replace
XX
with the version number you want to install (e.g.,nvidia-driver-535
). -
Reboot Your System:
After the installation is complete, reboot your system to apply the changes:
sudo reboot
-
Verify the Installation:
Once your system has restarted, you can check if the drivers were installed correctly by running:
nvidia-smi
This command should display information about your GPU and the driver version you’re using.
Troubleshooting Tips:
- Black Screen on Boot: If you encounter a black screen after rebooting, try booting into recovery mode and reinstalling the drivers.
- Driver Conflicts: Ensure that other conflicting drivers, like the Nouveau driver, are not installed. You can disable Nouveau by adding it to the blacklist.
That's it!
If you have any questions or run into issues, feel free to ask for help here. Good luck!