31

I downloaded the Nvidia driver for Linux from the official Nvidia website to install in my laptop. It is a file named NVIDIA-Linux-x86_64-390.67.run. How to install this file?

1
  • check your gpu type before instal it, amd/ati or amd/nvidia
    – id_ID
    Jul 6, 2022 at 5:15

7 Answers 7

36

Determine the latest version of Nvidia driver available for your graphics card

  1. Visit the graphics drivers PPA homepage here and determine the latest versions of Nvidia drivers

  2. Verify that your graphics card is capable of running the latest drivers.

If your graphic is supported, you can go ahead and remove all previously installed Nvidia drivers on your system. Enter the following command in terminal.

sudo apt-get purge nvidia*

Add the graphics drivers PPA

​Let us go ahead and add the graphics-driver PPA -

sudo add-apt-repository ppa:graphics-drivers

sudo apt-get update

Install (and activate) the latest Nvidia graphics drivers. Enter the following command to install the version of Nvidia graphics supported by your graphics card -

sudo apt-get install nvidia-XXXX 

OR

sudo apt-get install nvidia-driver-xxxxx                            

(xxxx - is the Supported Version for your Nvidia driver)

Reboot your computer for the new driver to kick-in. You can check your installation status with the following command

lsmod | grep nvidia

If there is no output, then your installation has probably failed. It is also possible that the driver is not available in your system's driver database. You can run the following command to check if your system is running on the open-source driver nouveau. If the output is negative for nouveau, then all is well with your installation.

lsmod | grep nouveau

This is my terminal output of Nvidia Drivers.

My Nvidia Drivers

devansh@varshney:~$ nvidia-smi
Wed Apr 24 01:14:16 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.56       Driver Version: 418.56       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce 940MX       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   52C    P5    N/A /  N/A |    254MiB /  2004MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      3975      G   /usr/lib/xorg/Xorg                           108MiB |
|    0      4002      G   /usr/lib/firefox/firefox                       1MiB |
|    0      4350      G   /usr/bin/gnome-shell                         137MiB |
|    0      5204      G   /usr/lib/firefox/firefox                       1MiB |
|    0     24924      G   /usr/lib/firefox/firefox                       1MiB |
+-----------------------------------------------------------------------------+
3
  • 7
    Note: On Kubuntu I had to do sudo apt-get install nvidia-driver-xxxxx (specifically, 415) Feb 7, 2019 at 0:44
  • 3
    Similarly, on Ubuntu 18.04 I needed nvidia-driver-430 instead of nvidia-430 which was not found. Aug 10, 2019 at 4:33
  • Note that this is probably not the recommended way that NVIDIA wants people to do it since the PPA isn't maintained by NVIDIA, but it seems to have (empirically) worked well for me on Ubuntu 18 (and 16) systems. Aug 5, 2022 at 22:08
20

I am using the nvidia-driver-390 driver version 390.48 in 18.04 which was installed with the following command:

sudo ubuntu-drivers install 
sudo reboot  

When installing a proprietary graphics driver, it is not necessary to uninstall the open source graphics driver. The two graphics drivers can be installed alongside each other allowing the open source graphics driver to be used as a fallback alternative in case there is a problem using the proprietary graphics driver.

The sudo ubuntu-drivers install command installs drivers that are appropriate for automatic installation including their dependencies, and the Nvidia driver will also be updated automatically when an update is available. Sometimes sudo apt upgrade even upgrades the proprietary graphics driver packages to more recent packages, in which case sudo apt autoremove removes the older packages which were replaced by the newer ones. For most users there's no reason to guess about which proprietary graphics driver to install, because if your system deserves a graphics driver upgrade it will get one.

If you visit the official AMD or NVIDIA websites you will often see that the latest version of the proprietary graphics driver for your GPU is a little bit more up-to-date than the version of the same graphics driver that is available from the default Ubuntu repositories. Don't worry about this, because if the difference between version numbers of the two proprietary graphics drivers is small, then you will get similar performance by using either of the two drivers. If you install a graphics driver from the default Ubuntu repositories, you will also get automatic updates for that driver which are sometimes linked to kernel updates.

2
  • This also works for me for Ubuntu 20, when I already had CUDA but needed to clean up my Ubuntu drivers. To be safe I also did sudo apt-get purge nvidia* before doing the autoinstall command. Aug 6, 2022 at 0:01
  • Or even sudo apt-get purge ^nvidia* to make the command more specific.
    – karel
    Aug 6, 2022 at 2:53
9

To do this, you would add the graphics driver PPA with the following commands in terminal:

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

After this, you should now remove any current NVIDIA drivers by entering the following into your terminal:

sudo apt-get purge nvidia*

Now that you have done this, it is safe to install the latest version:

sudo apt-get install nvidia-driver-396

Please note that it is nvidia-driver-396 on Ubuntu 18.04, it is nvidia-396 on Ubuntu 16.04 but you are not using 16.04.

1

A simple double click should do the trick. If it doesn’t, right click -> Permissions -> enable execute permission and then try the double click again

1

After following a ton of links and suggestion I'll put here what worked for me. The reason why I needed the driver from NVIDIA was to be able to run TensorFlow on my laptop with the configuration

  • Linux Mint 19.1 Tessa on 18.04 Ubuntu
  • RTX 2060 graphics card

What follows next were the steps I took:

  1. Go to the BIOS of your laptop (press F2 at the beginning of rebooting your computer) and disable secure booting.

  2. Once you login back to the computer again, open up a terminal and run:

    sudo apt install nvidia-settings
    

    This will allow you to modify settings for the driver you will install.

  3. Go to https://www.tensorflow.org/install/gpu and follow the steps for Ubuntu 18.04.

  4. Now, the major issue I ran into that took me forever to fix was the fact that after rebooting the computer I was running into a black screen. This was happening because the laptop was not using the original "Intel" graphics card anymore and had switched to "NVIDIA". If you run into a similar situation, use the command CTRL+ALT+F1 to go to a tty screen (teletype terminal). There you may be able to login using your username/password. Then run the code:

    sudo apt install nvidia-prime
    

    The purpose of this last command was to be able to change which graphics card my laptop was using. I then ran:

    sudo prime-select intel
    

To leave the tty and go back to your regular screen you may either reboot or do a CTRL+ALT+F7" (at least this is the command that worked for me).

Once logged in again I was able to change back to the NVIDIA card (sudo prime-select nvidia) and reboot normally.

0

I'm not sure I agree with manually installing specific drivers via

sudo apt-get install nvidia-XXXX 

Isn't it always better to wait until the new driver is available via Software & Updates?

I thought that was the purpose of adding the PPA?

1
  • The purpose of adding a PPA is generally to be on the edge, so you can installed the most current version instead of waiting for a new version of Ubuntu which includes the newer version of the software you want on the edge. Sep 22, 2019 at 4:35
0

After nvidia-435 stopped working for my 18.04, I purged the driver as before, downloaded the driver 450 from NVIDIA and ran their installer. After rebooting, I could not log in any more.

After changing to Wayland on the login screen (a very tiny widget on an UHD monitor), login was possible. Once logged in I could reconfigure my both monitors and I'm happy again.

1
  • Sounds strange. Usually the default Nvidia drivers installed via the software app run a lot better than the stuff downloaded by Nvidia. Why did you do it this way?
    – kanehekili
    Jul 30, 2020 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .