Platform setup with Ubuntu 14.04 server edition

Ubuntu 14.04 Server Edition (Amazon EC2 GPU instance)

IMPORTANT: These instructions have been tested on the following AMI: Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-5c120b19.

#update server packages
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install linux-headers-generic linux-headers-virtual linux-image-virtual linux-virtual

#install required packages
sudo apt-get install linux-source linux-image-extra-virtual build-essential xserver-xorg mesa-utils libgl1-mesa-glx libglu1-mesa build-essential unzip xinit

#install kernel header package
sudo apt-get install linux-headers-`uname -r`

# Download NVIDIA Linux Driver

# Make the Driver Executable Runnable
chmod +x

# Install The NVIDIA Driver
sudo ./
# Accept License terms and answer yes to all prompts

#Disable nouveau by adding following lines to conf file
#blacklist nouveau
#blacklist lbm-nouveau
#options nouveau modeset=0
#alias nouveau off
#alias lbm-nouveau off
sudo nano /etc/modprobe.d/blacklist-nouveau.conf

#disable kernerl nouveau
sudo echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf

#update and reboot
sudo update-initramfs -u
sudo reboot now

# Get bus id of the GPU device.
# string will be something similar to: 00:03.0 VGA compatible controller [0300]: NVIDIA Corporation GK104GL [GRID K520] [10de:118a] (rev a1)
#in this case the busId is 0:3:0
lspci -nn | grep VGA

#generate new xorg config file using busId from above
sudo nvidia-xconfig --busid=0:3:0 --use-display-device=None

#locate "Screen" Section and ensure the following sub section information is present
#Virtual     1280 1024
sudo nano /etc/X11/xorg.conf

# start x server
sudo /usr/bin/X :0 &

# set the DISPLAY environment variable
export DISPLAY=:0.0