CUDA and NVIDIA GPU Installation

How to Install CUDA Manually

On the user account that will run CUDA:
1. Download the CUDA installation toolkit.
2. In the terminal, cd into the downloads folder.
3. In the terminal, sudo sh [filename here]
4. Press Q to skip the TOS that nobody reads, and type accept to move on.
5. The first prompt will be for the GPU driver installation. Enter No.
6. Accept the rest of the prompts. 

From Ticket:
We technically didn't do this in its entirety due to time constraints, but you need to set the PATH variable and double check some small details. See step 6 here. 

How to Update Official Nvidia GPU Drivers Manually

In the event you need to update to the most recent official Nvidia drivers, download the installation file from their site here, then do the following:
1. Remove the current Nvidia drivers. Ubuntu has other default graphic drivers, so don't worry too much.
sudo apt-get purge nvidia*

# Note this might remove your cuda installation as well
sudo apt-get autoremove 

# [Optional] Recommended if .deb files from NVIDIA were installed
# Change 1404 to the exact system version or use tab autocompletion
# After executing this file, /etc/apt/sources.list.d should contain no files related to nvidia or cuda
sudo dpkg -P cuda-repo-ubuntu1404
2. Execute this to make sure dependencies are installed.
sudo apt-get install build-essential gcc-multilib dkms

3. Restart the computer. On the login screen, press CTRL+ALT+F2, and enter your login credentials. Be sure to enter the username or name of your user folder, not the display name. 
4. (READ THIS STEP ENTIRELY BEFORE EXECUTING). cd to the folder where you downloaded the Nvidia .run file, and do the following:
chmod +x NVIDIA-Linux-x86_64-384.69.run
sudo ./NVIDIA-Linux-x86_64-384.69.run --dkms -s
If the computer claims something along the lines of the drm being in use, then run the following and try to repeat this step. 
systemctl isolate multi-user.target
If there's a specific error, check links I provided or google the error itself.

5. Accept the prompts you need to go through, and reset the computer after everything is completed. Use nvidia-smi to verify the installation completed.

Sources:
Extra Source on Specifically Configuring CUDA (For the steps we didn't get to!)

GPU Driver specific:
Creation date: 4/25/2019 11:16 AM (kkim6102@terpmail.umd.edu)      Updated: 4/25/2019 11:19 AM (kkim6102@terpmail.umd.edu)
Martin Hall room 0123