This tutorial will help users that want to install drivers for their NVIDIA GPU on Ubuntu 18.04 LTS OS. Managing graphic hardware on Linux distributions requires precise repository management. If you are setting up this system for development, you might also want to review our guide on how to install Docker on Ubuntu 18.04 to easily containerize your GPU-accelerated applications.
Key Points
- Purging existing graphic driver remnants avoids deployment conflicts.
- The Graphics Drivers PPA provides official compatibility updates for Ubuntu environments.
- Running installation processes inside a screen session prevents SSH session timeout failures.
- Verifying the loaded kernel modules ensures the system runs natively via NVIDIA hardware.
How to Clear Legacy Packages from the System?
Before we start installing the correct driver, we need to clean the system of any previously installed driver that might create software issues. Removing legacy graphic software packages stabilizes the operating system core before upgrading dependencies.
We can do that by using the following command:
sudo apt-get purge nvidia*
How to Choose the Proper Software Version for the GPU?
We need to check what version of the latest drivers our graphic card is capable of running. We can discover this by visiting the following page and seeing what the correct driver version is for our specific hardware layout.
Afterwards, we will visit the graphic driver PPA homepage here and see if our graphic card is compatible with the drivers present in the repository. Matching your card generation with the proper repository archive ensures a stable and responsive desktop environment.
How Do You Implement Adding the Graphic Card PPA?
To successfully resolve how to install nvidia driver for Ubuntu systems, you must add the community-maintained graphics repository. We can add the graphic-driver PPA using the following command:
sudo add-apt-repository ppa:graphics-drivers
How to Fully Prepare the System for Driver Installation?
To retrieve information about the latest version of the packages listed in the repository, run a system index update:
sudo apt-get update
Before we proceed to the next step, we need to install screen to make sure that our installation is not interrupted by network fluctuations that might close our SSH session. Utilizing a terminal multiplexer keeps active installation processes alive even if your remote network connection drops out.
sudo apt-get install screen
We log in into screen using the command:
screen
How Do You Complete the Installation Setup?
Using the previously acquired information from checking your card version, we download and install the latest nvidia drivers Ubuntu 18.04 packages supported by our GPU. Please note that the command is different for each graphic card, depending on the driver available for it:
sudo apt-get install nvidia-XYXYX
(Ex. nvidia-390 is the latest driver version for the GTX 1xxx series).
After the installation is done, we need to reboot the computer to initialize the new kernel configurations:
sudo reboot
If you run a multi-distribution environment across your network hardware, you can also check our instructions on how to install NVIDIA drivers on CentOS 7 for managing alternative Enterprise Linux systems.
How to Verify the Nvidia Driver Installation Status?
After the system has resumed, we can verify that the Ubuntu 18.04 nvidia drivers are active and loaded correctly:
lsmod | grep nvidia
or
nvidia-smi
If there is no output, most likely your driver install process has failed. It is also possible that the GPU driver is not available in your system driver database. You can check if your system is running on the open source driver nouveau. If there is no terminal output returned for nouveau, then your official installation has succeeded.
lsmod | grep nouveau
Where Can You Find System Help Files?
You can find more commands on how to use the driver by accessing the local package documentation files:
dpkg -L nvidia-driver-390
I hope this tutorial has helped you install nvidia drivers Ubuntu configurations successfully on your Ubuntu 18.04 LTS Bionic Beaver Linux machine. If you are completing a comprehensive workstation setup, you can additionally explore our tutorial on what is Java and how to install Java in Ubuntu 18.04 to configure application environments.



