How to install proprietary NVIDIA drivers

nvidia proprietary drivers

NVIDIA has been the target of many attacks by the community of the FOSS, and all of us who closely follow the news of our favorite operating system will remember the expletives that Linus Torvalds himself directed at him at the time. Nobody disputes whether both in that case and in others were well founded or not, the truth is that luckily for those who prefer to have as much free software as possible there is the option of using the drivers New.

These, as we well know, have improved a lot, but sometimes unfortunately it is necessary to resort to the official drivers for reasons of that extra performance margin that they can offer us. So, in this post we are going to see how to install proprietary NVIDIA drivers on Ubuntu, for which first of all we are going to verify which is the graphic card model that we have in our system.

We open a terminal window (Ctrl + Alt + T) and execute:

lspci | grep vga

After which we should see something like:

02: 00.0 VGA compatible controller: NVIDIA Corporation GT215 [GeForce GT 240] (rev a2)

In my case, the graphics card that my computer has is the NVIDIA GeForce GT 240. Perfect, then we are going to install the linux-headers-generic package, which will install the header files of the kernel version that we have installed:

sudo apt-get install build-essential linux-headers-generic

Once that is done, we go to the NVIDIA download page, which is located at http://www.nvidia.es/Download/index.aspx?lang=es, and there we select the driver for our card. In my case, with the information obtained before, I am looking through the options; I would have something like what you see in the upper image of this post and once I have that I click on 'Search', after which we will finally have access to the page from which we can download the drivers for our card.

Once we have the drivers on our computer we go to the download folder and execute it, the file is something of the type 'NVIDIA-Linux-x86_64-340.76.run'. It is a script type file and the part that says '-340.76' will vary according to the type of version. Well, we must execute that script but for this we have to give it execution permission:

sudo chmod +755 NVIDIA-Linux-x86_64-340.76.run

Now we are going to add the Nouveau driver to the Blacklist of kernel modules, to prevent it from loading at system startup:

sudo gedit /etc/modprobe.d/blacklist.conf

And we add at the end of the file the line:

blacklist new

Next, what we will need is to uninstall all the graphics driver packages that came with our Ubuntu installation. For this we execute:

sudo apt-get remove –purge nvidia *

sudo apt-get remove --purge xserver-xorg-video-nouveau

Now we open a new console window (Ctrl + Alt + F2), we log in and enter the following:

sudo /etc/init.d/lightdm stop

With this we finish the graphical environment, and once we have done it we restart the computer:

sudo reboot

This time, when the system starts we will receive a notice that will alert us that Ubuntu is running in low resolution mode, which we must accept. Then, we will receive several alternatives to boot, and what we have to do is select the one that says "Start a session in console mode". We return to a login like the one we saw in the previous step, and this time after entering our data we are going to execute the installation script of the NVIDIA drivers:

sudo sh nvidia-linux-x86_64-340.76.run

The installation begins to run, and the most practical and safe thing to do is to click on "Yes, I accept" to all of them, and at the end we restart the graphical environment:

sudo service lightdm start

Now we can log in to the graphical environment, the only thing left is to run the "NVIDIA Server Configuration Settings" tool, where in the NVIDIA X Server Settings or X Server Display Configuration option we are going to save the configuration to a file , by clicking on «Save to X Configuration File». That's it, now we will be ready and using the best NVIDIA options for our system.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Ruben said

    Hello, my laptop comes with an integrated Intel graphics and a dedicated NVIDIA, by putting lspci | grep VGA I get VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
    Does it mean that I am not using NVIDIA graphics? The truth is that I do not use the computer to play and everything works correctly. Thanks.

  2.   Wire said

    Good article. It would be very interesting to publish one on how to update the kernel with the proprietary drivers installed without suddenly finding yourself with a black screen and without the x ... Why would it be so confusing to have graphics drivers in good conditions in Ubuntu, in Linux in general ... it's a nightmare, really.

  3.   Belial said

    uf too complicated for me the truth is that although I love ubuntu and it is what I have installed, it still makes it difficult for me to update some drivers ... .. actually I think I have to format and install everything again because in some step the I have shit ... .. in truth they should facilitate much more the subject of graphic drivers, it is a horror for those who do not know ...

  4.   Maguin J. Mendez Landa said

    All good until the passage of sudo sh NVIDIA, it does not run I get sh: 0 cant'open

  5.   Felipe Rodriguez said

    Hello, I am trying to install Ubunto from scratch on my Laptop and I have an Nvidia GTX. The point is that it hangs on the first installation screen, not even the first screen to choose the language appears. I've been reading a lot and apparently the problem is with this type of card. I would like to know if you could give me a hand with the installation from scratch, it seems that the solution derives from something similar to this that you are explaining in this article, but I do not have the necessary knowledge to carry it out in the installation from scratch. I appreciate the help. All the best

  6.   Andres Silva said

    How complicated friends I go back to windows 10 apart my laptop with ubuntu 16.04 gets very hot when always using the noveaou driver should have windows option to use the processor graphics and only when it is required to use nvidia.

  7.   David Edward said

    Thank you very much I have tried it with Linux Mint 19.1 and everything has worked perfectly for me, the only thing is that when restarting after having uninstalled the previous drivers, it automatically loads the graphic mode, then it is necessary to end the graphic mode again to be able to start the installation, after, all excellent. Thanks a lot

  8.   darkking said

    Well, it worked perfectly for me with the exception that with the latest Nvidia driver the graphics is slower than with the proprietary drivers that Ubuntu delivers (kubuntu 18.04.3).
    Nvidia = GTX 660M, driver 418.88 slower than Ubuntu 390 or 415.
    Therefore in a few days I will install the ubuntu ones.

  9.   Ernest Lupercio said

    Ernest Lupercio:

    mark errors when executing the run file