Customizing the Instance

See: Linux Accelerated Computing Instances in Amazon’s AWS documentation for more information.

1.     To download and install the Nvidia drivers and update the operating system, in the PuTTY terminal window, type:

a.     wget https://us.download.nvidia.com/tesla/535.104.05/NVIDIA-Linux-x86_64-535.104.05.run

b.     sudo apt-get update

c.     sudo apt-get -y install gcc make xserver-xorg libglu1-mesa-dev freeglut3-dev mesa-common-dev libxmu-dev libxi-dev mesa-utils x11vnc xfce4 dkms xvfb

d.     chmod +x NVIDIA-Linux-x86_64-535.104.05.run

e.     sudo ./NVIDIA-Linux-x86_64-535.104.05.run
Click Yes when asked to register the kernel module. Click OK when prompted to do so during the installation.

f.      sudo reboot
The following message is displayed: "Remote side unexpectedly closed network connection". Click OK.

2.     Right-click the title bar of the PuTTY window, and select Restart Session.

3.     To configure the GPU and start the X window system, in the PuTTY terminal window, type:

a.     nvidia-xconfig --query-gpu-info | grep BusID
Copy the value that is outputted. E.g., if the output is "PCI BusID : PCI:0:30:0", select and copy "PCI:0:30:0".

b.     sudo nvidia-xconfig -a --virtual=1280x1024  --busid=<BUSID>
Where <BUSID> is replaced with the value from 2c above, e.g., sudo nvidia-xconfig -a --virtual=1280x1024  --busid=PCI:0:30:0.

Note:    If a warning is displayed that the xconfig file was not located/opened, click OK.

c.     sudo /usr/bin/X :0 &

d.     export DISPLAY=:0

4.     (Optional) To configure VNC in order to verify X runs properly, in the PuTTY terminal window type:

a.     x11vnc -storepasswd
Then type and verify the password

b.     y
This confirms writing the password to /home/Ubuntu/.vnc/passwd.

c.     x11vnc -rfbauth ~/.vnc/passwd &

d.     xfce4-session &

5.     (Optional) Connect with VNC client using your instance's public DNS and the password set in step 4 above.
You can get the public DNS for your instance using the Amazon EC2 console. Check the Public DNS (IPv4) column. If this column is hidden, choose the Show/Hide icon and select Public DNS (IPv4).

6.     To install and configure Wine, do the following:

a.     Open the Start menu and search for cmd to start a command prompt.

b.     Type pscp -i <.ppk file> <wineinst.tar full path>  ubuntu@<fuser IP>:/home/ubuntu/wineinst.tar
Where <.ppk file> is replaced with a full path to the ppk file created in "Convert Your Private Key Using PuTTYgen"; <wineinst.tar full path> is replaced with the full path to the wineinst.tar that is included in the zip folder that can be downloaded from heredownloaded from here; and <fuser IP> is replaced with the Public DNS (IPv4) of the instance.

c.     In the PuTTY terminal window, type:

i.      tar -xvf  wineinst.tar

ii.     sh fuser.sh

Note:    This process can take a few minutes to complete. 

7.     In the Amazon EC2 console, right-click the instance, point to Instance State, and select Stop.

8.     After the instance has stopped, right-click the instance, point to Instance Settings, and select Change Instance Type. The Change Instance Type dialog is displayed.

9.     From the Instance Type dropdown list, select g4ad.4xlarge.

10.   Restart the instance by right-clicking the instance in the Amazon EC2 console, pointing to Instance State, and selecting Start.

11.   Reconnect to the instance via PuTTY by performing the steps in "Connecting to the Instance".

12.   To download and install AMD drivers, in the PuTTY terminal window type:

a.     sudo apt  install awscli

i.      Y to continue

b.     aws s3 cp --recursive s3://ec2-amd-linux-drivers/latest/ .

c.     tar -xf amdgpu-pro*ubuntu*.xz

d.     sudo apt install linux-modules-extra-$(uname -r) -y

e.     Change to the folder of the extracted driver:

i.      Type the following (without pressing ENTER): cd amd

ii.     Press tab once.

iii.    Press ENTER.

f.      cat RPM-GPG-KEY-amdgpu | sudo apt-key add -

g.     ./amdgpu-pro-install -y --opencl=pal,legacy

h.     sudo reboot

13.   The following message is displayed: "Remote side unexpectedly closed network connection". Click OK.

14.   Right-click the title bar of the PuTTY window, and select Restart Session.

15.   Test that the installation was successful:

a.     dmesg | grep amdgpu

b.     Check the response and look for "Initialized amdgpu". This indicates that the installation was successful.