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.
register-container-instanceto 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.