Amazon ECS supports workloads that take advantage of GPUs by enabling you to create clusters with GPU-enabled container instances. Amazon EC2 GPU-based container instances using the p2, p3, g3, and g4 instance types provide access to NVIDIA GPUs. For more information, see Linux Accelerated Computing Instances in the Amazon EC2 User Guide for Linux Instances.
Amazon ECS provides a GPU-optimized AMI that comes ready with pre-configured NVIDIA kernel drivers and a Docker GPU runtime. For more information, see Amazon ECS-optimized AMIs.
You can designate a number of GPUs in your task definition for task placement consideration at a container level. Amazon ECS will schedule to available GPU-enabled container instances and pin physical GPUs to proper containers for optimal performance.
The g4 instance type family is supported on version 20190913 and later of the Amazon ECS GPU-optimized AMI. For more information, see Amazon ECS GPU-optimized AMI Versions. It is currently not supported in the Create Cluster workflow in the Amazon ECS console. To use these instance types, you must either use the Amazon EC2 console, AWS CLI, or API and manually register the instances to your cluster.