Reduce size of volume

For future reference:

Use ami-64c5cc1d in setup_p2.sh and 30G in setup_instance.sh

2 Likes

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.

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 setup.sh 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 setup_t2.sh 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.

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?

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

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:

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

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

Then:

  • sudo apt update
  • sudo apt upgrade
  • sudo apt autoremove
  • git clone https://github.com/fastai/courses.git
  • install-gpu.sh # 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
4 Likes

No, it will not be completely free.
But some resources will be free under certain usage threshold: http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-free-tier.html

Works perfectly, Thank you so much !!!

Hi numb,

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

Now after executing bash setup_t2SLarge.sh, 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.

Thanks,
Deejo.