Is it possible to host an ECS cluster with p2 or other GPU instance types? It seems from the GUI that it is not possible (the GPU instance types are simply not listed when you go to create an ECS cluster and look at the list of instance types). However, there is an official AWS blog article here indicating that Amazon itself uses ECS in this way.

I see that there is a an ECS CLI command register-container-instance that could theoretically be used like so:


Manually create an EC2 instance with a GPU type.
Use register-container-instance to register your GPU EC2 instance to an ECS cluster.


However, the documentation notes that this command is supposed to be internal use only, and also it is a bit of a hack and a lot of extra work.
You can use custom instances of any type with ECS -- the key is running the ECS container agent on the instance of your choice. So, in general, I followed this documentation on that process with success -- http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-install.html -- but do note that you probably want to also specify the ECS cluster into which the instance goes (otherwise it will go to "default" cluster).

To specify the cluster you specify env var ECS_CLUSTER, typically in /etc/ecs/ecs.config prior to running the container agent. See here.