Guide to setting up an EC2 instance (p2xlarge)

04 Jan 2018

SO life is tough and i had to fiddle around with this for a while before i could figure out which AMI to use! i swear i started at least 10 instances so far…

i’m not sure if it’s because i’m stingy (i also chose t2.micro for FREE at the beginning hahahah) i just wanted to ‘get my feet wet’ as they all say right, but there were like a lot of cuda issues and stuff i think. i’m not even sure what was going wrong!

finally, i found THIS: https://www.pyimagesearch.com/2017/09/20/pre-configured-amazon-aws-deep-learning-ami-with-python/

amazing stuff - step by step instructions!!

apparently some problems can be resolved by a reboot, and then reinstalling some stuff (lucky he included the installers!)

so…just use this guy man.

ami name: ami-ccba4ab4


as usual i was stingy and used the cheapest possible - c4.xlarge

*hint: it takes about 4 minutes to initialise so don’t faint!!

i git cloned in, verified that my program can finally run (THANK GOD) - at the same speed as within my macbookpro LOL

hands trembling (very drama, i know) - i clicked to spin up an instance with GPU…

*p.s. - remember to terminate all your previous instances!!!!! if not you will be CHARGED.


p2.xlarge GPU IS RUNNING NOW HOLY COW

i can testify - it REALLY runs at 25 times the speed of a normal CPU…


this is miraculous

/#nevergoingbacktocpu


ok one tiny error:

_tkinter.TclError: no display name and no $DISPLAY environment variable

look here for an answer!!

i’m trying to add the below at the top of my script. fingers crossed that this works!!!

import matplotlib
matplotlib.use('Agg')

to download your files from the remote location:

scp -i newpython.pem -r ubuntu@54.191.213.166:~/gan_project/ .