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?
2 Answers
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.
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.
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.

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.