Reduce size of volume

(Thiago Arrais) #101

For future reference:

Use ami-64c5cc1d in and 30G in


I changed my instance to ami-64c5cc1d, ran setup scripts, and ssh’ed in. However, when I ran nvidia-smi I got NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

It seems ami-64c5cc1d doesn’t have GPU?


I checked again. It’s actually a t2.xlarge instance.

(Schmitt) #104

Not sure if this is what you meant, but that ami can be run on either a p2 or a t2 instance.

If you want to run it on a p2 instance, in the script, there is a line that should say:

export instanceId=`aws ec2 run-instances --image-id ami-64c5cc1d --count 1 –instance-type p2.xlarge --key-name aws-key --security-group-ids $securityGroupId --subnet-id $subnetId --associate-public-ip-address --block-device-mapping “[ { “DeviceName”: “/dev/sda1”, “Ebs”: { “VolumeSize”: 30, “VolumeType”: “gp2” } } ]” --query ‘Instances[0].InstanceId’ --output text

If you built it from the script instead, it will start up a t2 instance.

Incidentally, nvidia-smi didn’t work when I first started this ami either, but after rebooting the instance it worked fine.

(Astha Garg) #105

I managed to reduce the volume for my p2 instance by following the instructions here, but I have 2 questions that I could not find the answer to:

  1. I want to also start a t2 instance. Would it still be the same ami - ‘ami-64c5cc1d’? I am using region us-west-2.
  2. If I have both these instances with 30 GB each, would they share the same volume, or will there be different volumes ? Would it mean I am out of the free tier storage and that I need to copy files twice if I want to use both instances with it?

(cynthia) #106

@nunb @jeremy I just signed up the AWS Free Tier. In this case, is it gonna be free to follow exactly this course? Thanks!

(Richard) #107

I just made ami-5e098427 (eu-west-1b) public, created from Ubuntu 16.04 vanilla instance using the setup scripts – seems to work for lesson 1 so far, enjoy! :slight_smile:

(Richard) #108

ami-5e098427 – try it and let me know how it went…

(Richard) #109

I have to delete the AMI :frowning: – turns out that snapshots, and thus AMIs do have a monthly cost at AWS…

However, this is how I created it:

  • create Ubuntu 16.04 instance, p2.xlarge, use volume of 30G


  • sudo apt update
  • sudo apt upgrade
  • sudo apt autoremove
  • git clone
  • # also installs Anaconda, etc
  • conda install -c mila-udem -c mila-udem/label/pre theano pygpu # needed due to old GPU back-end error msg
  • change .theanorc: device=cuda
  • add to the end of .bashrc: export MKL_THREADING_LAYER=GNU

(Alex) #110

No, it will not be completely free.
But some resources will be free under certain usage threshold:

(Himanshu Rawlani) #111

Works perfectly, Thank you so much !!!

(Dipak H. Jotaneeya) #112

Hi numb,

I have downloaded to my Mac and did required changes, according your post, and uploaded it to my git repo by renaming it to “”.

Now after executing bash, I’m getting below error.

An error occurred (InvalidAMIID.NotFound) when calling the RunInstances operation: The image id ‘ami-9c54f4fc’ does not exist

Looking forward for your expert guidance to resolve this.