Follow

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

tasksel


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

systemctl set-default multi-user.target

After that you're okay to reboot now. 

REBOOT

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.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk