Repository navigation
MPS GPU sharing: advertise ecs.capability.gpu-sharing-mps - #5053
Merged
Merged
Conversation
harishxr
force-pushed
the
mps-gpu-sharing
branch
from
July 20, 2026 21:02
adec34c to
a17ed62
Compare
harishxr
marked this pull request as ready for review
July 20, 2026 21:34
harishxr
force-pushed
the
mps-gpu-sharing
branch
from
July 20, 2026 23:34
a17ed62 to
f62cc6a
Compare
Yiyuanzzz
reviewed
Jul 21, 2026
Yiyuanzzz
reviewed
Jul 21, 2026
Yiyuanzzz
reviewed
Jul 21, 2026
harishxr
force-pushed
the
mps-gpu-sharing
branch
from
July 22, 2026 00:47
f62cc6a to
94adf26
Compare
harishxr
force-pushed
the
mps-gpu-sharing
branch
from
July 22, 2026 00:57
94adf26 to
139c9dd
Compare
Yiyuanzzz
approved these changes
Jul 22, 2026
prateekchaudhry
approved these changes
Jul 22, 2026
harishxr
enabled auto-merge (rebase)
July 22, 2026 18:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO:
Summary
Adds a new container instance capability, ecs.capability.gpu-sharing-mps, which the agent advertises when the instance is able to run GPU workloads sharing a single physical GPU through the NVIDIA Multi-Process Service (MPS) control daemon.
The agent advertises the capability only when all of the following hold:
If any condition is unmet the capability is withheld and the agent logs the specific reason. This pairs with the AL2023 GPU AMI change (aws/amazon-ecs-ami#744) that ships and enables nvidia-mps.service.
Implementation details
The facts are gathered on the host by ecs-init and consumed by the agent, mirroring how the existing NVIDIA driver version already flows:
ecs-init/gpu/nvidia_gpu_manager.gogathers three new facts during GPU setup and persists them in/var/lib/ecs/gpu/nvidia-gpu-info.json:systemctl is-enabled nvidia-mps.service(keys off the printed state, since is-enabled exits non-zero for a known-but-disabled unit),agent/gpu/nvidia_gpu_manager_unix.goreads the three new fields from the JSON and exposes them via getters;agent/app/agent_capability_unix.gobuilds the inputs (GPU-present derived from discovered devices), calls the shared decider, and appends capability.GPUSharingMps on success or logs each unmet reason otherwise. No-op stubs are added for the windows/unspecified builds.ecs-agent/capability/capability.go.Testing
New tests cover the changes: yes
Verified end-to-end on g6.xlarge, covering all four gate conditions via DescribeContainerInstances and the agent log:
Description for the changelog
Feature - Add ecs.capability.gpu-sharing-mps capability for NVIDIA MPS GPU sharing
Additional Information
Does this PR include breaking model changes? If so, Have you added transformation functions? No
Does this PR include the addition of new environment variables in the README? No
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.