They next update to the guide will have the details on how to setup the Ubuntu 14.04 Linux AMIs. But in the meantime, try this. Make sure you use (ami-3d50120d)
First install the following Linux libraries and dependencies:
ubuntu@ip-10-236-190-141:~$ sudo apt-get update
ubuntu@ip-10-236-190-141:~$ sudo apt-get install linux-image-generic linux-image-extra-virtual linux-image-extra-$(uname –r) linux-headers-$(uname –r) linux-source*
ubuntu@ip-10-236-190-141:~$ sudo apt-get install build-essential gcc g++ gcc-multilib lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
ubuntu@ip-10-236-190-141:~$ sudo apt-get install unzip make pkg-config mesa-utils libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglew-dev freeglut3-dev libx11-dev libxmu-dev libxi-dev libXxf86vm-dev ubuntu-desktop x11vnc xserver-xorg
Remove the nouveau driver and blacklist it using the instructions below:
ubuntu@ip-10-236-190-141:~$ sudo apt-get purge nvidia*
ubuntu@ip-10-236-190-141:~$ sudo apt-get purge xserver-xorg-video-nouveau
ubuntu@ip-10-236-190-141:~$ sudo vim /etc/modprobe.d/blacklist.conf
# Add to the end of this file and save the blacklist.conf file “:wq!”
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
# update the boot initrd (option)
ubuntu@ip-10-236-190-141:~$ sudo update-initramfs -u
# now reboot, to ensure that nouveau not loaded
ubuntu@ip-10-236-190-141:~$ sudo reboot
Create the symbolic links for GLEW, X11, and other needed libraries if you need to make sure you support the linux 32-bit opengl libraries and also 32-bit opengl apps:
# First create symbolic links for i386
ubuntu@ip-10-236-190-141:~$ cd /usr/lib/i386-linux-gnu
ubuntu@ip-10-236-190-141:~$ sudo ln –s libGLU.so.1 libGLU.so
ubuntu@ip-10-236-190-141:~$ sudo ln –s libGLEW.so.1.6 libGLEW.so
ubuntu@ip-10-236-190-141:~$ sudo ln –s libGLEWmx.so.1.6 libGLEWmx.so
ubuntu@ip-10-236-190-141:~$ sudo ln –s libXi.so.6 libXi.so
ubuntu@ip-10-236-190-141:~$ sudo ln –s libX11.so.6 libX11.so
ubuntu@ip-10-236-190-141:~$ sudo ln –s libXrandr.so.2 libXrandr.so
ubuntu@ip-10-236-190-141:~$ sudo ln –s libXxf86vm.so.1 libXxf86vm.so
ubuntu@ip-10-236-190-141:~$ sudo ln –s libstdc++.so.6 libstdc++.so
# Now repeat the same creating symbolic links for x86_64 if it is not already created.
ubuntu@ip-10-236-190-141:~$ cd /usr/lib/x86_64-linux-gnu
To install the NVIDIA GRID driver, you must be root or sudo to do so. The driver can be found here in the package: {GRIDSDK_Installation}\Drivers{Driver Version}. Install the NVIDIA driver. When prompted, choose to install the 32-bit OpenGL compatibility libraries.
ubuntu@ip-10-236-190-141:~$ sudo service lightdm stop
ubuntu@ip-10-236-190-141:~$ sudo pkill X
ubuntu@ip-10-236-190-141:~$ cd GRID
ubuntu@ip-10-236-190-141:~/GRID$ unzip grid-sdk-x.x-linux.zip
ubuntu@ip-10-236-190-141:~/GRID$ cd drivers
ubuntu@ip-10-236-190-141: chmod +x NVIDIA*
ubuntu@ip-10-236-190-141:~/GRID/drivers$ sudo sh NVIDIA-Linux-x86_64-xxx.xx.run
Now connect remotely to the Linux AMI, you will need to setup X11VNC.
First check to make sure the NVIDIA GPU is present using lspci to get the PCI-e bus ID of a K520.
ec2-user@ip-10-236-190-141:~$ lspci | grep NVIDIA
00:03.0 VGA compatible controller: NVIDIA Corporation GK104GL [GRID K520] (rev a1)
ec2-user@ip-10-236-190-141:~$ cd ~/GRID/drivers
ec2-user@ip-10-236-190-141:~/GRID/drivers$ sudo nvidia-xconfig --busid=PCI:0:3:0 --use-display-device=None –virtual=1280x720
Take care of “busid”, the result of “lspci” is in hexadecimal but “nvidia-xconfig” needs a decimal. The “—virtual” option assigns the resolution of the virtual screen, you can set it as any other values you like.Check the Device section and Screen section of /etc/X11/xorg.conf in the table below. Refer to table with the highlighted lines :
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:0:3:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Headless"
DefaultDepth 24
Option "UseDisplayDevice" "None"
SubSection "Display"
Virtual 1280 1024
Depth 24
EndSubSection
EndSection
Use sudo vim /etc/X11/xorg.conf to edit the file and delete all monitor sections, and add following monitor section and save this file with “:wq!”.
Section “Monitor”
Identifier “Headless”
HorizSync 80.0 - 80.0
VertRefresh 75.0
Modeline "1280x1024_75.00" 138.45 1280 1368 1504 1728 1024 1025 1028 1069 -Hsync +Vsync
EndSection
Alternatively you can also open up ports 5900-5903 before you start the Linux AMI by updating the Network Security Group on the EC2 dashboard. But if you don’t want to do that, you can create a SSH tunnel for the purpose of VPN between the local machine and the SSH Linux AMI. Here we are going to tunnel into the the Linux AMI VNC port 5900 to your local client machine via port 5902 . To determine the local IP address of the Linux AMI, it can be found by IP address at the bash prompt. <ipaddr_local> = IP address of the Linux AMI as seen on the EC2 internal network. <ipaddr_public> = Publically accessible IP address of the Linux AMI as seen from the EC2 console.
<port_client>:<ipaddr_local> = 5902 is what we will use from localhost
<port_server> userid@<ipaddr_public> = 5900 is what x11vnc will see
ubuntu@ip-172-31-12-137:~$ ssh –L 5902:172.31.12.137:5900
ubuntu@<ipaddr_public> -i {path}/keypair.pem
Stop the X-Server. You need to be root or use sudo:
ubuntu@ip-172-31-12-137:~$ sudo service lightdm stop
ubuntu@ip-172-31-12-137:~$ sudo pkill X
Now we want to run dpkg-reconfigure to allow Any User to start up the X server without having to be sudo. When prompted by the tool, choose Anyone.
ubuntu@ip-172-31-12-137:~$ sudo dpkg-reconfigure x11-common
ubuntu@ip-172-31-12-137:~$ X &
ubuntu@ip-172-31-12-137:~$ export DISPLAY=:0
ubuntu@ip-172-31-12-137:~$ x11vnc -display :0 &
ubuntu@ip-172-31-12-137:~$ unity &
Now remotely log into the Linux AMI from VNC, specifying the port want to run.
From VNC dialog or vncviewer command line client, enter localhost:<port_client> to remotely connect via VNC into the Linux AMI and use the NVIDA Graphics GPU. In order to confirm that we are running the NVIDIA GPU driver, enter this at the prompt.
ubuntu@ip-172-31-12-137:~$ vncviewer localhost:5902
ubuntu@ip-172-31-12-137:~$ glxinfo | more
Change to the GRID SDK folder. From here you can make the samples and run them
cd {GRIDSDK_Installation}\Samples
make