Setup EC2 for Docker with GPU
Follow these steps closely to render videos on EC2 in a Docker container.
These steps are opinionated, but specify a reference that works.
A word of warning: Deviating from the instructions, like:
- choosing a different AMI
- choosing a different Docker base
- choosing something else than EC2
- choosing a different host machine
may lead to the GPU not working. In this case, it is hard to debug.
We recommend to first follow these instructions and make changes once you have a working setup.
Setup EC2 for Docker with GPU
1
  Follow the instructions for GPUs on EC2. You can skip installing Chrome, Node.js and cloning the repo to render a video.2
  Install NVIDIA Container toolkit:Add keyringbash
Add keyringbash
Install toolkitbash
Install toolkitbash
3
 Install Docker: Add Docker's official GPG keybash
Add Docker's official GPG keybash
Add keyringbash
Add keyringbash
Install Dockerbash
Install Dockerbash
4
 Configure Docker to use the NVIDIA runtime Configure the NVIDIA container runtimebash
Configure the NVIDIA container runtimebash
5
  Create two files, Dockerfile and entrypoint.sh. You can for example create them using the nano ./file-to-create command. Use CtrlX to save and quit. Dockerfilebash
Dockerfilebash
entrypoint.shbash
entrypoint.shbash
6
  Build the container and run a sample render: bash
bash
Debugging
Use the npx remotion gpu command to get the output of chrome://gpu to verify that the GPU is working.

