Installing NVIDIA drivers for Ubuntu 14.04/16.04 with multiple graphics adapters.

Installing NVIDIA drivers for Ubuntu 14.04/16.04 with multiple graphics adapters.

Generally the NVIDIA Linux drivers work with most of their cards. Some cases with Tesla's and higher end cards may have slight differences. The cards I'm working with today are the Quadro and Geforce series. 

FIRST Make sure your primary card is in PCI Slot 1 on CPU1 and your secondary cards on the PCI slot of CPU2 (If applicable)

Step 1: Install Ubuntu Server

Install your version of choice (14.04 or 16.04).

Step 2:  Update/Upgrade

Once you've completed your install, we will need to update the system.

sudo apt-get update
sudo apt-get upgrade -y

Step 3: Blacklisting Nouveau

After updating (could take about ~20mins) we need to blacklist the default graphics driver so it does not conflict with our NVIDIA drivers. Now, I believe the driver installation will blacklist for you, but I've run into issues where sometimes it didn't, so I like to manually do it myself before installation. I made a small script to do this for me, but you can manually do it with your choice of text editor. My recommendation would be NANO for ease of use. It is also important not to reboot the system until after the NVIDIA drivers because you will lose video in most cases.

Copy this:

#generated by nvidia-installer
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

and add it into /etc/modprobe.d/nvidia-driver-disable-nouveau.conf

In addition to this step lets install dkms and update initramfs.

sudo apt-get -y install dkms
sudo update-initramfs


Step 4: NVIDIA installation.

This step will be different depending on which version you've installed. For me 14.04 uses nvidia-351 and 16.04 has nvidia-361. Generally you would want to use the most up to date drivers, but I had problems using anything but the ones included in the Ubuntu repos. 

UBUNTU 14.04:

sudo apt-get install nvidia-351

UBUNTU 16.04:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get upgrade -y
sudo apt install nvidia-367

This process may take up to 30 minutes.

After installation you will now have a GUI on boot with no login credentials. There are two ways to fix this. 

If the you want the system to retain the GUI, you will need to add the desktop component. I did this with using tasksel and selecting Ubuntu Desktop


However, if you do not want the GUI, then lets set the runlevel to default 3. (Verified only on 16.04)

systemctl set-default

After that you're okay to reboot now. 


You should have either a GUI to log into, or a tty log in. 

Verify your NVIDIA drivers are working with nvidia-smi and you should see all your devices.

    • Related Articles

    • Installing a GUI on Ubuntu Server 15.04

      You have just received your new server running Ubuntu 15.04 and realize that you would now like to have a GUI installed instead of using it through the command line all the time.   Here is what you do.   1. Update the server and enter password   2. ...
    • Create Linux LiveCD from Windows using Rufus

      Download Rufus. Download a Linux ISO: Ubuntu: Direct Download: Torrent, Net Install: CentOS: Direct Download or Torrent: ...
    • Default credentials (Linux)

      Q: I just received a system with a pre-installed Linux operating system. What is the password for logging into the system? A: This will depend on the distribution we installed, as various distributions can carry different default access policies. The ...
    • How to Install SuperDoctor on Linux

      Download latest version of SuperDoctor from Supermicro's website: Unzip the archive after it has finished downloading. Locate the SuperDoctor5Installer[...].bin file and rename it to ...
    • How to Create and Boot from a LiveCD/USB Drive

      STAGE 1: Download .ISO image, prepare USB flash drive First, you will need an .ISO image of a Linux OS that you will put onto a USB drive (4GB+ recommended). As far as .ISO images go, you can use one from any OS that you wish. We strongly suggest ...