How can I run NVIDIA-accelerated FFmpeg in an ECS container on EC2?

September 7, 2026 2 answers
Asked by MellowOak42
I'm trying to run FFmpeg with NVIDIA hardware acceleration in Docker on AWS. The workloads would run as ECS tasks using the EC2 launch type rather than serverless Fargate. My current plan is to use a GPU-backed instance such as G7e, install the appropriate NVIDIA GRID drivers and container toolkit, and use an FFmpeg image whose binary was compiled with NVIDIA support. Has anyone deployed this reliably, and are there working examples or important configuration details I'm missing?

Answers

BrightCedar7
GPU passthrough isnโ€™t available for regular Fargate tasks, so youโ€™ll need ECS on EC2 with a GPU-capable instance. The usual setup is an ECS GPU-optimized AMI with the NVIDIA drivers and ECS agent already configured, plus a task definition that requests a GPU resource. The container also needs an FFmpeg build with NVIDIA support and any required user-space libraries. Iโ€™d validate it incrementally: launch the GPU-optimized AMI and confirm `nvidia-smi` works, run FFmpeg directly on the instance, test a container that only runs `nvidia-smi`, then test the FFmpeg image before wiring everything into the ECS cluster, launch template, and task definition.

MellowOak42: Thatโ€™s very helpful. Moving from Fargate to standard ECS is a little more involved because these jobs were going to be triggered by Step Functions, but Iโ€™ll first validate the GPU setup directly on an ECS EC2 instance.

Reply to this answer
QuietMaple19
You may not need a G7e specifically. G7 and G6 instances can also be good choices for transcoding and similar workloads, and theyโ€™re generally less expensive if you donโ€™t need graphics-heavy capabilities. Check the current AWS driver and instance compatibility tables rather than assuming only G7e is supported.

MellowOak42: Iโ€™ll revisit G7 and G6. I found documentation that mentioned G7e but not those instance families, although that may simply have been incomplete rather than a real driver limitation.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions