Answers: <p>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 -- <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-install.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-install.html</a> -- 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).</p>
  
  <p>To specify the cluster you specify env var ECS_CLUSTER, typically in <code>/etc/ecs/ecs.config</code> prior to running the container agent. <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html" rel="nofollow noreferrer">See here</a>. </p>
  
Answers: CC BY-SA 3.0
Answers: 2017-04-10T21:16:21.830Z
Answers: 2017-04-11T04:10:46.490Z
Answers: 2017-04-11T04:10:46.490Z
Answers: Ezekiel Victor
Body: <p>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 <a href="https://aws.amazon.com/blogs/compute/orchestrating-gpu-accelerated-workloads-on-amazon-ecs/" rel="nofollow noreferrer">here</a> indicating that Amazon itself uses ECS in this way.</p>
  
  <p>I see that there is a an ECS CLI command <a href="http://docs.aws.amazon.com/cli/latest/reference/ecs/register-container-instance.html" rel="nofollow noreferrer">register-container-instance</a> that could theoretically be used like so:</p>
  
  <ol>
  <li>Manually create an EC2 instance with a GPU type.</li>
  <li>Use <code>register-container-instance</code> to register your GPU EC2 instance to an ECS cluster.</li>
  </ol>
  
  <p>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.</p>
  
Comments: CC BY-SA 3.0
Comments: 2017-04-08T14:53:05.490Z
Comments: Seems your answer is in the question...
Comments: Tensibai
Comments: CC BY-SA 3.0
Comments: 2017-04-10T21:13:17.030Z
Comments: Sort of, but `register-container-instance` is definitely not the way to go as it turns out. I will post an answer in a sec.
Comments: Ezekiel Victor
Tags: <amazon-web-services>
Title: Is it possible to host an ECS cluster with p2 or other GPU instance types?
UserDisplayName: Ezekiel Victor
ThreadText: # Is it possible to host an ECS cluster with p2 or other GPU instance types?
  
  (Asked by: username_0 on 2017-04-07)
  
  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](https://aws.amazon.com/blogs/compute/orchestrating-gpu-accelerated-workloads-on-amazon-ecs/) indicating that Amazon itself uses ECS in this way.
  
  I see that there is a an ECS CLI command [register-container-instance](http://docs.aws.amazon.com/cli/latest/reference/ecs/register-container-instance.html) that could theoretically be used like so:
  
  1. Manually create an EC2 instance with a GPU type.
  2. 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.
  
  **Tags:** amazon-web-services
  
  > **Comments:**
  > **username_1**: Seems your answer is in the question...  
  > **username_0**: Sort of, but `register-container-instance` is definitely not the way to go as it turns out. I will post an answer in a sec.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-04-10. Score: 3 | Accepted answer
  
  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](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html).
  
  
  ---
  
  