To install Nvidia driver on other Linux distributions, follow our Nvidia Linux Driver guide.
In this tutorial you will learn:
- How to perform an automatic Nvidia driver installation using standard Ubuntu Repository
- How to perform an Nvidia driver installation using PPA repository
- How to install the official Nvidia.com driver
- How to uninstall/switch back from Nvidia to Nouveau opensource driver
Software Requirements and Conventions Used
|Category||Requirements, Conventions or Software Version Used|
|System||Installed or upgraded Ubuntu 21.04 Hirsute Hippo|
|Other||Privileged access to your Linux system as root or via the |
|Conventions|| # - requires given linux commands to be executed with root privileges either directly as a root user or by use of |
How to install Nvidia Drivers using a standard Ubuntu Repository step by step instructionsThe first method is the easiest to perform and in most cases it is the recommended approach.
GNOME GUI Nvidia Installation Method
Command Line Nvidia Installation Method
- First, detect the model of your nvidia graphic card and the recommended driver. To do so execute the following command. Please note that your output and recommended driver will most likely be different:
ubuntu-drivers devices WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001C03sv00001043sd000085ABbc03sc00i00 vendor : NVIDIA Corporation model : GP106 [GeForce GTX 1060 6GB] driver : nvidia-driver-450-server - distro non-free driver : nvidia-driver-460-server - distro non-free driver : nvidia-driver-390 - distro non-free driver : nvidia-driver-450 - distro non-free driver : nvidia-driver-460 - distro non-free recommended driver : nvidia-driver-418-server - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin
- Install driver.
If you agree with the recommendation feel free to use the
ubuntu-driverscommand again to install all recommended drivers:
$ sudo ubuntu-drivers autoinstallAlternatively, install desired driver selectively using the
aptcommand. For example:
$ sudo apt install nvidia-driver-460
- Once the installation is concluded, reboot your system and you are done.
$ sudo reboot
Automatic Install using PPA repository to install Nvidia Beta drivers
graphics-driversPPA repository allows us to install bleeding edge Nvidia beta drivers at the risk of an unstable system. To proceed first add the
ppa:graphics-drivers/pparepository into your system:
$ sudo add-apt-repository ppa:graphics-drivers/ppa
- Next, identify your graphic card model and recommended driver:
$ ubuntu-drivers devices WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001C03sv00001043sd000085ABbc03sc00i00 vendor : NVIDIA Corporation model : GP106 [GeForce GTX 1060 6GB] driver : nvidia-driver-450-server - distro non-free driver : nvidia-driver-418-server - distro non-free driver : nvidia-driver-450 - distro non-free driver : nvidia-driver-460 - distro non-free recommended driver : nvidia-driver-390 - distro non-free driver : nvidia-driver-460-server - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin
- Install Nvidia Driver
Same as with the above standard Ubuntu repository example, either install all recommended drivers automatically:
$ sudo ubuntu-drivers autoinstallor selectively using the
$ sudo apt install nvidia-driver-460
- All done.
Reboot your computer:
$ sudo reboot
Manual Install using the Official Nvidia.com driver step by step instructions
- identify your NVIDIA VGA card.
The below commands will allow you to identify your Nvidia card model:
$ lshw -numeric -C display or $ lspci -vnn | grep VGA or $ ubuntu-drivers devices
- Download the Official Nvidia Driver.
Using your web browser navigate to the official Nvidia website and download an appropriate driver for your Nvidia graphic card.
Alternatively, if you know what you are doing you can download the driver directly from the Nvidia Linux driver list. Once ready you should end up with a file similar to the one shown below:
$ ls NVIDIA-Linux-x86_64-460.67.run
- Install Prerequisites
The following prerequisites are required to compile and install Nvidia driver:
$ sudo apt install build-essential libglvnd-dev pkg-config
- Disable Nouveau Nvidia driver.
Next step is to disable the default nouveau Nvidia driver. Follow this guide on how to disable the default Nouveau Nvidia driver.
Depending on your Nvidia VGA model your system might misbehave. At this stage be ready to get your hands dirty. After the reboot you may end up without GUI at all. Be sure that you have the SSH enabled on your system to be able login remotely or use
CTRL+ALT+F2to switch TTY console and continue with the installation.
- Stop Desktop Manager.
In order to install new Nvidia driver we need to stop the current display server. The easiest way to do this is to change into runlevel 3 using the
telinitcommand. After executing the following linux command the display server will stop, therefore make sure you save all your current work ( if any ) before you proceed:
$ sudo telinit 3Hit
CTRL+ALT+F1and login with your username and password to open a new TTY1 session or login via SSH.
- Install Nvidia Driver.
To start installation of Nvidia driver execute the following linux command and follow the wizard:
$ sudo bash NVIDIA-Linux-x86_64-460.67.run OR $ sudo bash NVIDIA-Linux-x86_64-*.run
- The Nvidia driver is now installed.
Reboot your system:
$ sudo reboot
- Configure NVIDIA X Server Settings.
After reboot your should be able to start NVIDIA X Server Settings app from the Activities menu.
How to Uninstall Nvidia DriverFollow our guide on how to uninstall Nvidia Driver hence switch back from Nvidia to Nouveau opensource driver.
WARNING: Unable to find suitable destination to install 32-bit compatibility librariesDepending on your needs, this can be safely ignored. However, if you wish to install steam game platform this issue cannot be ignored. To resolve execute:
$ sudo dpkg --add-architecture i386 $ sudo apt update $ sudo apt install libc6:i386and re-run the nvidia driver installation.
An incomplete installation of libglvnd was found. All of the essential libglvnd libraries are present, but one or more optional components are missing. Do you want to install a full copy of libglvnd? This will overwrite any existing libglvnd libraries.You are missing the
libglvnd-devpackage. Execute the following command to resolve this issue:
$ sudo apt install libglvnd-dev
Oct 9 10:36:20 linuxconfig gdm-password]: gkr-pam: unable to locate daemon control file Oct 9 10:36:20 linuxconfig gdm-password]: pam_unix(gdm-password:session): session opened for user linuxconfig by (uid=0) Oct 9 10:36:20 linuxconfig systemd-logind: New session 8 of user linuxconfig. Oct 9 10:36:20 linuxconfig systemd: pam_unix(systemd-user:session): session opened for user linuxconfig by (uid=0) Oct 9 10:36:21 linuxconfig gdm-password]: pam_unix(gdm-password:session): session closed for user linuxconfig Oct 9 10:36:21 linuxconfig systemd-logind: Session 8 logged out. Waiting for processes to exit. Oct 9 10:36:21 linuxconfig systemd-logind: Removed session 8. Oct 9 10:36:45 linuxconfig dbus-daemon: [system] Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms)To resolve do not overwrite any existing libglvnd libraries during the Nvidia driver installation.
WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files. Check that you have pkg-config and the libglvnd development libraries installed, or specify a path with --glvnd-egl-config-path.Make sure to install
$ sudo apt install pkg-config