AWS Builder Center

Summary of Amazon ECS GPU Sharing (NVIDIA MPS) Support

This article explains how Amazon ECS now lets multiple tasks run on a single NVIDIA GPU, covering the architecture, configuration, and suitable workloads. It also covers points to check before adopting it, such as the loss of task-level GPU utilization metrics and the software-level isolation.

Introduction

On October 27, 2026, AWS announced that Amazon ECS now supports GPU sharing with NVIDIA Multi-Process Service (MPS). With this update, you can run multiple Amazon ECS tasks at the same time on a single GPU.
Even for workloads that don't use the full capability of a GPU, such as inference with small models or generating embeddings, it has been common to allocate an entire GPU to each task. The unused portion simply adds to your cost.
This article summarizes what has changed in this announcement, then walks through how it works, how to configure it, and where it fits. It also covers points to know before adopting it, such as the loss of task-level GPU utilization metrics.



What Has Changed

With this update, Amazon ECS can share a single NVIDIA GPU across multiple tasks. Compared with how GPUs were handled before, two things have changed.
Aspect
Before
After this update
GPU allocation
A container has exclusive use of a GPU
Multiple tasks can use one GPU at the same time
Specifying resource requirements
Specify the number of GPUs
Specify the amount of GPU memory (you can also optionally specify a maximum GPU compute percentage)
When you specify the required amount of GPU memory in the container definition of a task definition, Amazon ECS selects a GPU with enough available memory and places the task on it. The same applies when a service scales or deploys. The announcement also states that no application code changes are required.

Supported Environments

GPU sharing is available in all AWS commercial Regions and the AWS GovCloud (US) Regions. Support by environment is as follows.
Environment
GPU sharing
Amazon ECS Managed Instances
Supported
Amazon ECS on Amazon EC2
Supported
AWS Fargate
Not supported
Amazon ECS Express Mode
Not supported
Amazon ECS managed daemon tasks
Not supported
Amazon ECS Anywhere (task definitions that require  EXTERNAL  compatibility)
Not supported
On Amazon ECS Managed Instances, Amazon ECS monitors the health of the GPUs and the MPS control daemon on each instance. When it detects a GPU hardware failure or a daemon failure, it drains and replaces the instance, and moves the tasks to healthy capacity. The announcement does not describe this behavior for Amazon ECS on Amazon EC2.



Architecture

What Is MPS

A GPU has a scheduler that time-slices work from different CUDA contexts (the per-process execution environments on a GPU). Because work from different contexts can't run at the same time, a process with a small workload may leave GPU compute resources underused.
NVIDIA Multi-Process Service (MPS) is an NVIDIA CUDA feature that lets multiple processes run on the same GPU concurrently. It improves GPU utilization and reduces context-switching overhead.

What Amazon ECS Does

On GPU instances, Amazon ECS starts the MPS daemon, places containers on GPUs based on available GPU memory, and applies per-container limits. Amazon ECS sets the memory limit in the container through the environment variable  CUDA_MPS_PINNED_DEVICE_MEM_LIMIT , and the compute limit through  CUDA_MPS_ACTIVE_THREAD_PERCENTAGE . If you don't specify a compute limit, the latter isn't set, and the default active thread percentage of the MPS server on the instance (100%) applies.
The placement rules are as follows.
  • Amazon ECS places tasks based on GPU memory only, so it doesn't account for the compute limit when making placement decisions.
  • When a task has multiple containers that use a GPU, Amazon ECS adds up the GPU memory they request and looks for a GPU with that much available memory. All containers in the same task are placed on the same physical GPU.
  • As long as memory is available, tasks other than that task can be placed on the same GPU.
  • Tasks that use a shared GPU and tasks that use a dedicated GPU can run on the same instance, but they are placed on different GPUs.

mps-a and mps-b are containers in the same task. The values in the diagram are examples chosen to match the sample response shown next.

Checking GPU Sharing with the CLI

You can check whether a GPU is actually being shared with the  DescribeContainerInstances  API. The  gpuDevices  field in the response includes the sharing mode, the container count, and the remaining memory for each GPU.
aws ecs describe-container-instances \
--cluster <cluster-name> \
--container-instances <container-instance-id>
The following is the sample response from the official documentation (excerpt).
{
"containerInstances": [
{
"ec2InstanceId": "i-0c74b75400ab4228d",
"runningTasksCount": 1,
"gpuDevices": [
{
"gpuId": "GPU-70d3bdaf-8635-81e0-8e44-446248a92c83",
"sharingMode": "NVIDIA_MPS",
"totalMemoryInMiB": 22587,
"remainingMemoryInMiB": 16587,
"containerCount": 2
}
]
}
]
}
If  sharingMode  is  NVIDIA_MPS , the GPU is being shared with MPS. In this example, 6,000 MiB of the 22,587 MiB total memory is allocated to two containers, and 16,587 MiB remains.
Keep the following three points in mind when reading the response.
  •  totalMemoryInMiB  is the amount of memory that the Amazon ECS container agent reported as available to containers, and it can be less than the nominal memory of the GPU.
  •  remainingMemoryInMiB  is calculated from the memory that Amazon ECS allocated to each container. It is not the amount the containers are actually using.
  •  containerCount  is the number of containers that Amazon ECS assigned to the GPU. It is not the number of processes running on the GPU.
From the task side, you can check with the  DescribeTasks  API. For each container,  gpuSharingStrategy  shows the memory and compute limits, and  gpuIds  shows the ID of the GPU it is placed on. Containers that share the same GPU have the same value.

Metrics That Are No Longer Available

For GPUs shared with MPS, Amazon ECS doesn't emit task-level and container-level GPU utilization and memory metrics. The metrics that aren't emitted are  TaskGPUUtilization  and  ContainerGPUUtilization ,  TaskGPUMemoryUtilization  and  ContainerGPUMemoryUtilization ,  TaskGPUMemoryTotal  and  ContainerGPUMemoryTotal , and  TaskGPUMemoryUsed  and  ContainerGPUMemoryUsed .
The metrics that remain available are task-level and container-level metrics such as power draw, temperature, and  TaskGPURestartAppXidCount , as well as instance-level metrics such as  InstanceGPUUsageTotal  and  InstanceGPULimit .
If you have CloudWatch alarms that use metrics that are no longer emitted, take care. You can configure how an alarm treats missing data by choosing from  missing ,  ignore ,  breaching , and  notBreaching . With the default  missing , if all data points in the evaluation range are missing, the alarm goes to the INSUFFICIENT_DATA state; with  notBreaching , the alarm stays in the OK state. With either setting, the alarm can't detect an actual rise in GPU utilization, so review the targets of your alarms before you enable sharing.
As an alternative, you can use instance-level metrics to understand GPU usage. You can also retrieve  remainingMemoryInMiB  from  DescribeContainerInstances  periodically to track how much allocatable GPU memory is left, but as noted above, this doesn't show actual memory usage. If you want to look closely at how each task uses the GPU, you need to set up measurement on the application side.



Configuration

The setup flow is as follows. Prepare a capacity provider that uses NVIDIA GPU instances, configure GPU sharing in the container definition of a task definition, and create a service on that capacity provider.

Prerequisites

GPU sharing is available on the following instance families: G4dn, G5, G6, G6e, G7, G7e, P3, P4d, P5, P5e, P5en, and P6-B200.
With Amazon ECS on Amazon EC2, launch a supported NVIDIA GPU instance with the Amazon ECS AL2023 GPU-optimized AMI. You need Amazon ECS container agent version 1.107.0 or later and AMI version 20261019 or later. The official documentation doesn't list these version requirements for Amazon ECS Managed Instances.

Configuring the Task Definition

In  resourceRequirements  of the container definition, specify  sharingStrategy  instead of  value , which is used to specify a dedicated GPU.  nvidiaMps  in  sharingStrategy  has the following two fields.
Field
Required
Description
 memory 
Yes
The GPU memory limit for the container, in MiB. Specify a value greater than 0. It is treated as a hard ceiling.
 maxComputePercent 
No
The maximum percentage of the GPU's compute capacity that the container can use (an integer from 1 to 100). If you omit it, 100 is used. It is a ceiling, not a reservation, and idle compute resources can be used by other containers on the same GPU.
You can check the total memory of a GPU with  totalMemoryInMiB  in the  DescribeContainerInstances  API. You can also look it up in the instance type specifications.
The following is an excerpt of the parts related to GPU sharing from the sample task definition in the official documentation.
"containerDefinitions": [
{
"name": "model-a",
"resourceRequirements": [
{
"type": "GPU",
"sharingStrategy": {
"nvidiaMps": { "memory": 12288, "maxComputePercent": 50 }
}
}
]
}
]
In this example, model-a requests 12,288 MiB of GPU memory. If you add another container that requests 8,192 MiB to the same task, Amazon ECS adds up the requests within the task and selects a GPU with 20,480 MiB or more of available memory as the placement target. Note that  requiresCompatibilities  in the task definition must be  MANAGED_INSTANCES  for Amazon ECS Managed Instances and  EC2  for Amazon EC2.
Keep the following rules in mind when you configure it.
  • You can't specify both  value  and  sharingStrategy  in a single GPU requirement.
  • All GPU containers in the same task must use the same sharing strategy.
  • You can't specify  sharingStrategy  in a container override of  RunTask  or  StartTask , so define it in the task definition.
  • Don't set the environment variables that Amazon ECS sets automatically, described earlier.

Creating a Service

After you register the task definition, create a service on a capacity provider that uses NVIDIA GPU instances. Once the task starts, use  DescribeContainerInstances  to confirm that  sharingMode  is  NVIDIA_MPS  and that  containerCount  and  remainingMemoryInMiB  are what you expect.



Use Cases

GPU sharing is a good fit for workloads in which a single task doesn't use the full capability of a GPU.
Workload
Why it fits
Small-model inference
Specify the memory each model needs and consolidate multiple models onto one GPU
Multi-model serving
Split models with different roles into separate containers and share the GPU by setting memory and compute limits for each
Embedding generation
Consolidate processing that doesn't fully use a GPU from multiple tasks onto one GPU
AV/ADAS simulation
Combine simulations that use only part of a GPU onto one GPU to increase density
Development and test environments
Run multiple lightweight GPU workloads on the same hardware



Considerations

GPU sharing differs from dedicated GPUs in several ways. For metrics, see "Metrics That Are No Longer Available" above.

Isolation Is at the Software Level

MPS lets you set memory and compute limits per container, but it doesn't partition the GPU in hardware. Containers on the same GPU share the same CUDA context.
For this reason, if a container hits a fatal GPU error (such as an illegal memory access caused by a faulty kernel), other containers that share the same physical GPU might be affected. Containers on a different GPU, even on the same instance, are not affected. The NVIDIA documentation likewise explains that MPS provides no error isolation between clients, and that memory bandwidth and caches are shared.
The official documentation states that GPU sharing isn't suited for the following workloads: training large models that need the entire GPU memory, workloads that must avoid the impact of GPU errors from neighboring containers, and workloads that require hardware-level isolation between processes.
For reference, the following table compares the main methods of sharing a GPU. Amazon ECS now supports MPS.
Method
Isolation level
Characteristics
Time-slicing
No memory or compute isolation
The CUDA scheduler on the GPU time-slices work. It works in software alone and is available on all NVIDIA GPU instance types on AWS.
MPS
Software level
You can set memory and compute limits per container.
MIG
Hardware level
Partitions one physical GPU into multiple instances, each with dedicated memory and compute units. Supported on GPUs such as the A100 and H100, and not supported on G5, G6, and G6e.
The characteristics of time-slicing and MIG are based on the Amazon EKS documentation. They don't mean that these methods are available on Amazon ECS.

Specifying Memory and Compute

The memory value is a hard ceiling and is also used for placement decisions. Specify a value that leaves some headroom over actual usage.  maxComputePercent  isn't used for placement decisions and isn't a reservation, so compute capacity isn't guaranteed. When a container is idle, other containers on the same GPU can use its compute resources.

Tasks from Different Services Can Share the Same GPU

Tasks from different services that use the same capacity provider can be placed on the same GPU. If you don't want services to share a GPU, use a separate capacity provider or cluster for each service.

One GPU Process per Container

GPU sharing assumes that a container runs a single GPU process. For applications that run multiple GPU processes, set  memory  based on the combined peak usage of all processes, and make sure the application keeps the total within that value. If the application uses more GPU memory than the configured value, memory contention can occur.
The announcement states that no application code changes are required, but depending on how your application uses the GPU, you might need to revisit its design.



Summary

With this update, Amazon ECS can now share a single NVIDIA GPU across multiple tasks. For workloads that don't use a GPU fully, such as small-scale inference and embedding generation, you might be able to increase utilization while reducing the number of GPUs.
However, sharing with MPS is software-level sharing. It isn't suited for use cases that need strong isolation or for large-scale training, and task-level GPU utilization metrics are no longer available.
If you're considering adopting it, first check which metrics your existing GPU alarms use. Then start with workloads that use little GPU, and adjust the  memory  values and task density from there.



References

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article