[Drivers] Ubuntu NVIDIA driver installation/re-installation

Instructions for Ubuntu 14.04

1) Update necessary packages used for Ubuntu

apt -y update && apt -y upgrade && apt -y dist-upgrade

2) Download NVIDIA driver from website

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run

3) Update permissions on the file you just downloarded

chmod 700 ./NV *tab key to fill in the rest*

4) Remove nouveau related files that prevents system from installing NVIDIA drivers

apt-get remove nvidia* && apt-get autoremove

5) Blacklist nouveau files from re-installing themselves when you restart the system

echo "blacklist nouveau" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "blacklist lbm-nouveau" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "options nouveau modeset=0" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "alias nouveau off" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "alias lbm-nouveau off" >> /etc/modprobe.d/blacklist-nouveau.conf && echo options nouveau modeset=0 | tee -a /etc/modprobe.d/nouveau-kms.conf

6. Updates your system to boot with the settings you JUST changed

update-initramfs -u

7. Reboot

reboot

8. Run this command as root user

service lightdm stop

or

systemctl stop lightdm.service

If Ubuntu 16.04, it is 'service lightdm stop' instead

9. Install NVIDIA driver

./NV *tab key to fill in rest*

Re-installing drivers (Ubuntu 16.x)

  1. Download '.run' driver from NVIDIA site, or use '.run' driver in '/home' folder
  2. Exit GUI and stop all NVIDIA-related services; perform the following commands in text/console mode

    ##To stop the GUI, used command:
    systemctl stop lightdm
  3. Run '.run' file as root

Re-installing drivers (If using NVIDIA-docker) (Ubuntu 16.x)

  1. Download '.run' driver from NVIDIA site, or use '.run' driver in '/home' folder
  2. Exit GUI and stop all NVIDIA-related services; perform the following commands in text/console mode

    ##To stop the GUI, used command:
    systemctl stop lightdm
    
    ##To stop the docker digits, use:
    docker stop <docker ID>
  3. Run '.run' file as root

Example of looking Docker container ID

##Use command 'docker ps -a' to list docker IDs

spc@u09292017001:~$ docker ps -a
CONTAINER ID        IMAGE                 COMMAND              CREATED             STATUS              PORTS                              NAMES
4ddbe2048db6        nvidia/digits         "python -m digits"   10 minutes ago      Up 10 minutes       0.0.0.0:5000->5000/tcp, 6006/tcp   digits-640594574-0
1d070d81dbcb        portainer/portainer   "/portainer"         11 minutes ago      Up 11 minutes       0.0.0.0:9000->9000/tcp             portainer-304854449-0
spc@u09292017001:~$