Install Nvidia Driver on Ubuntu

These instructions will help you to install latest Nvidia driver on your Ubuntu. This guide requires "Secure Boot" to be turned off from BIOS (if exists), before proceeding to below steps, or Nvidia driver loading will fail.

Identify the Graphics Adapters

You can identify which graphic adapter is installed in your laptop, desktop or server machine using the following command:

sudo lspci | egrep "3D|VGA"

As you can see in the below screenshot, we have a laptop with dual graphics adapter, one is Intel and other is Nvidia GeForce GTX 950M.


After fresh installation of Ubuntu 18.04 desktop, we found that Intel Integrated GPU is taken into account and Nvidia GeForce GTX 950M driver is not yet installed.

 
 

Adding PPA to your system

You can check the correct Nvidia driver version for your graphics adapter from here. Afterwards, visit the graphics driver PPA homepage here and see if your graphics card is compatible with the drivers present in the repository.

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Installing Nvidia Driver

 Find appropriate latest available Nvidia driver with below command:

sudo apt list | egrep "xserver-xorg-video-nvidia|nvidia-utils|nvidia-kernel-source|nvidia-driver|nvidia-dkms"

You will see the output like below:
 

If you look carefully, you will see the latest available driver package is *nvidia-460, so we need to install latest driver packages using the command below:
 
sudo apt -y install xserver-xorg-video-nvidia-460 nvidia-utils-460 nvidia-kernel-source-460 nvidia-driver-460 nvidia-dkms-460
 
Once installed, reboot your system to make changes to take effect.

sudo shutdown -r now
 
Once your system started, execute the following command on terminal:
dmesg | grep nvidia-drm

As you can see in the output below, nvidia driver is loaded.



Verify Nvidia Driver:

Type the following command to verify your Nvidia driver functionality:

sudo nvidia-smi

You will see the output like below:


Type the following command to open up NVIDIA X Server Settings screen.

sudo nvidia-settings


Navigate to Ubuntu Settings > Devices > About and you will see your Nvidia GPU is taken into account.


Conclusion

Now that you have successfully installed latest Nvidia driver on your Ubuntu, you can begin testing its functionality with any applications, tools or games of your choice.

3 comments:

  1. This does not work for me, the latest driver looks like installed correctly but the settings are showing like a blank window with only 'quit' option

    ReplyDelete
    Replies
    1. Please post sudo lspci and yum list *nvidia* output here.

      Delete
  2. AnonymousJuly 20, 2020

    Thank you very much for that!!!!!!!! :--D After one week!!!, i finally got the driver installed in my ubuntu 20.04 system. I wasn't disabling the nouveau driver, and the sudo commands above did the trick!

    ReplyDelete

Powered by Blogger.