Friday, December 25, 2015

How to install NVIDIA driver 352.63 in Linux Mint 17.3

Last March, I wrote a guide to install the NVIDIA 346.35 video card driver on Linux Mint 17.1. A few things have changed since then. Since we're upgrading to Mint 17.3, I'm updating the NVIDIA driver also. Here's how I did it.

Here is the computer I'm doing the driver installation on:
Motherboard: Biostar A960G+
Video card: EVGA GeForce GTX 960 video card
Ram: Corsair 8GB DDR3 CML8GX3M2A1600C9
Processor: AMD FX-6300

Installation procedure
1. Print out these instructions (or have this page open on another device). Read through these instructions before doing anything so you understand the procedure. It's helpful to understand what you're doing, instead of just typing a command because someone said to do it.

2. Backup your system, unless you're starting from a fresh install, like I did. I installed Linux Mint 17.3 from a DVD that I burned.

3. Then I installed the updates, so the system was up to date. Usually you need to check for new updates a second time after you run updates because the first update may only update the updater. I ran all the updates before attempting to install the video driver.

4. Go into the Software Manager, and search for libc. Install the libc6-dev package (Embedded gnu c library: development libraries and header files). The NVIDIA driver will need this for its installation. If you don't have this installed, the NVIDIA driver installation will fail.

5. Download the Nvidia 352.63 driver for Linux.

6. (Optional) Make a backup copy of grub.cfg in case you need to revert back. Open a terminal, and type the following:
    cd /boot/grub
    sudo cp -p grub.cfg grub.cfg.original

7. (Optional) Backup grub
    cd /etc/default
    sudo cp -p grub grub.original

8. Since the driver installation requires that we boot into a terminal instead of the GUI, we need to change that, temporarily. We need to make two changes to the file /etc/default/grub
    sudo gedit /etc/default/grub
    Add the word "text" so that the following line looks like this:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"

    The next edit is important, otherwise, you'll get a black screen instead of booting to terminal. Go down a few lines and uncomment the following line (remove the #)
    GRUB_TERMINAL=console
If you don't uncomment that line, you'll get a black screen instead of a terminal. Not fun.

9. Save the file and exit gedit.

10. Re-build grub.cfg by running the command
    sudo update-grub

I got a "Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMOUT is set is no longer supported." I don't know what's up with this, but I'm continuing anyway.

11. We're still in the GUI now, but after we reboot, it should go straight to a terminal instead of launching the GUI. Reboot now.

12. When the computer turns back on, it should be in the terminal window, asking for login. Type your user name, hit enter, then enter your password. If you got a black screen, you probably didn't uncomment the correct line in step 8.

13. You should be at the command prompt now. I assume you downloaded the NVIDIA driver to your downloads directory. We'll go there now. 
    cd Downloads

14. Login as root with the command su <enter>, and type in your password. The prompt will now be a # instead of a $. Run the installation driver as root by typing:
    sh NVIDIA-Linux-x86_64-352.63.run

Accept the license agreement.

It said "The distribution-provided pre-install script failed! Are you sure you want to continue?"
I selected "continue the installation".

"Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later."
I don't think we'll be updating the kernel module. Even updating from Linux Mint 17.2 to 17.3 doesn't update the kernel, so I'm saying "No" to this question.

"Install NVIDIA's 32-bit compatibility libraries?"
Yes (sure, why not? I'm guessing this is so we can run the graphics with 32 bit applications.)

"Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed up."
Yes

"Your X configuration file has been successfully updated. . . . " Installation is now complete.
<OK>

15. After installation completes, don't reboot yet. We still have to fix grub so it doesn't boot to a terminal again. We'll use the pico editor since we're not in the GUI. I'll assume you're still logged in as root. Open /etc/default/grub to edit:

    pico /etc/default/grub

Remove the word "text" so the line is back to how it was before:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
You should probably leave this line uncommented:
   GRUB_TERMINAL=console

16. Save the file (ctrl-o) and exit pico (ctrl-x). So in the future, if you hit ctrl-alt-F1, you should get a terminal. If you comment the above line again, it just goes to a black screen. To get back to the GUI, hit ctrl-alt-F7 or ctrl-alt-F8, but don't do that now since we're not in the GUI yet.

17. Now we need to rebuild grub.cfg with the following command (still logged in as super-user or root):
    update-grub

18. Shutdown the computer (as root) with the following command line:
     shutdown -h now

19. Turn the computer on, and it should boot up normally, into the GUI with the Nvidia driver. If you look in the system settings under Driver Manager, it should probably look similar to this window:


20. Does this mean that I could have had Mint install the same driver? I don't know. Let me know if you can install the NVIDIA driver using the Driver Manager. Just like I experienced in elementary school, the teacher handed out an assignment that had a list of instructions. It was a long list of things like "tie your neighbor's shoes". Step 1 was to read the entire assignment first. The last step was to ignore all the previous instructions, sign your name to the page, and hand it in.  

Leave a comment if this helped you.
Thanks.