For some time, I have been running an AWS EC2 G2.2xlarge instance to keep from buying a laptop to run Photoshop. With the introduction of Elastic GPUs, I was interested in “converting” that VM to a T2.large instance with an eg1.large Elastic GPU that I believe should save me about $.40 per hour of operation. For my use case, that may only mean a savings $6 per month but if an organization happens to be running G2.2xlarge instances that could be replaced with instances running Elastic GPUs, they could see a significant cost savings.
Now, technically speaking, I didn’t “convert” my existing instance as I was convinced that to do so would cause some kind of apocalyptic tragedy from which I wouldn’t be able to recover….remember I’m fresh off a robbery so I’m fragile.
So here’s what I did:
- Login to the AWS interface and shut down my G instance.
- I created an Amazon Machine Image (AMI) of my G instance so as to keep it intact. If you don’t know what an AMI is, think of it as a VMware VM Template. An AMI includes information such as the operating system, updates, installed applications, etc.
- With the image created, I then deployed a new T2.large instance using the AMI I had just created. On the Configure Instance Details page, select the option to Add GPU and specify the GPU type.
4. You’ll need to create a new or edit an existing security group. Personally, I created a new security group called “Elastic GPU Support”. If the security group configuration does not match that shown below, an elastic GPU will not map to your EC2 instance.
- Create the ingress security group rule:
- For Type, choose Custom TCP Rule. For Protocol, choose TCP. For Port Range, enter 2007. For Source, choose Custom and enter the ID of the security group that you created in the previous step.
- Choose Save
- Select the security group that you just created and choose Actions, Edit outbound rules.
- Create the egress security group rule:
- For Type, choose Custom TCP Rule. For Protocol, choose TCP. For Port Range, enter 0-65535. For Destination, choose Custom and enter the ID of the security group you created in the previous step.
- Choose Save
5. With the instance deployed from the AMI, the Elastic GPU driver must be installed. You can find the EGPU driver here. A reboot is required to complete the installation….you can verify the status of the Elastic GPU using the egcli command executable:
6. When the instance reboots, there should be an Elastic GPU application icon within the Systray and the egcli command should return a state of “Healthy”
7. The “conversion” to an Elastic GPU is complete….just need to test.
I am happy to say, that I’ve not had any performance issues with Photoshop/Lightroom since converting to Elastic GPUs….I even terminated my G2.2xlarge instance.
I did have a couple problems while performing this conversion:
- When setting up my security group, I initially failed to setup the outbound rule, thus resulting in a failure to add the Elastic GPU. **Make sure you setup the security group to support Elastic GPUs.
- EG Infrastructure is not available on this instance
When I originally deployed the new instance from my AMI, I specified a T2.Large (maybe it was T2.xlarge) and when the instance booted, it’s acted as though it was unable to exorcise all of the G2.2xlarge demons. I ran the egcli command to see that an EGPU was not supported on this instance type.
In theory, just because I made my AMI from a G2.2xlarge instance doesn’t mean that every instance I deploy from that AMI has to be a G2.2xlarge instance, thus, the instance type I choose shouldn’t matter. I decided to deploy a T2.medium instance from the AMI and low and behold, everything work fine. I then shut down the T2.medium instance, changed the instance type to a T2.large, and did not have any further issues.