Skip to content

🎥 Make videos programmatically with React

chore(docs): add ec2 docker gpu guide

kaf-lamed-beytb983b009f895
diff --git a/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar b/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar
index f9ac1cca97..1b47669be0 100644
Binary files a/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar and b/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar differ
diff --git a/packages/docs/docs/contributing/docs.md b/packages/docs/docs/contributing/docs.md
index 6ab2d211fd..6ef05cd69b 100644
--- a/packages/docs/docs/contributing/docs.md
+++ b/packages/docs/docs/contributing/docs.md
@@ -27,7 +27,7 @@ values={[
This method will avoid having to compile all docs. You cannot validate if links to other docs are valid.
-<Step>1</Step> Set up the Remotion repository <a href="/docs/contributing">according the instructions here</a>. <br/>
+<Step>1</Step> Set up the Remotion repository <a href="/docs/contributing">according to the instructions here</a>. <br/>
<Step>2</Step> Run <code>node new-doc.mjs</code> and follow the instructions.<br/>
</TabItem>
diff --git a/packages/docs/docs/miscellaneous/ec2-docker-gpu.md b/packages/docs/docs/miscellaneous/ec2-docker-gpu.md
new file mode 100644
index 0000000000..4ebf35690b
--- /dev/null
+++ b/packages/docs/docs/miscellaneous/ec2-docker-gpu.md
@@ -0,0 +1,109 @@
+---
+image: /generated/articles-docs-miscellaneous-ec2-docker-gpu.png
+title: Setup EC2 for Docker with GPU
+sidebar_label: EC2 GPU with Docker
+crumb: "FAQ"
+---
+
+Follow these Steps to setup EC2 GPU with Docker. Start with the instructions [here](https://www.remotion.dev/docs/miscellaneous/cloud-gpu), first.
+
+## Setup EC2 for Docker with GPU
+
+<Step>1</Step> Install NVIDIA container toolkit<br />
+
+```bash
+curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
+ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
+ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
+ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \
+ && \
+ sudo apt-get update
+```
+
+```bash
+sudo apt-get install -y nvidia-container-toolkit
+```
+
+<Step>2</Step>Install Docker <br />
+
+```bash
+# Add Docker's official GPG key:
+sudo apt-get update
+sudo apt-get install ca-certificates curl gnupg
+sudo install -m 0755 -d /etc/apt/keyrings
+curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
+sudo chmod a+r /etc/apt/keyrings/docker.gpg
+
+# Add the repository to Apt sources:
+echo \
+ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
+ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+sudo apt-get update
+```
+
+```bash
+sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+```
+
+<Step>3</Step> Configure container runtime <br />
+
+```bash
+sudo nvidia-ctk runtime configure --runtime=docker
+```
+
+```bash
+sudo systemctl restart docker
+```
+
+## Files
+
+This makes use of https://github.com/UmungoBungo/remotion-gpu-test.git
+
+It includes `entrypoint.sh`, which will run the render command and upload the output file to [transfer.sh](https://transfer.sh/). `entrypoint.sh` will need to co-located with the dockerfile on the instance.
+
+## Dockerfile.example
+
+```bash
+FROM debian:bookworm-slim
+RUN apt-get update && \
+ apt-get install -y curl gnupg git chromium ffmpeg && \
+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \
+ apt-get update && \
+ apt-get install -y nodejs && \
+ # Enable Corepack
+ corepack enable && \
+ # Install linux dependencies
+ # apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget libgbm-dev && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+# Clone the repo
+RUN git clone https://github.com/UmungoBungo/remotion-gpu-test.git
+WORKDIR /remotion-gpu-test
+RUN pnpm install
+
+# Copy the entrypoint script into the image
+COPY entrypoint.sh .
+
+CMD ["./entrypoint.sh"]
+```
+
+## entrypoint.sh
+
+```bash
+#!/bin/bash
+
+# Run the render-angle command
+pnpm render-angle-egl
+
+# Upload the file once rendering is finished
+curl --upload-file ./out/angle.mp4 https://transfer.sh/angle.mp4
+```
+
+## Run dockerfile
+
+```bash
+sudo docker run --gpus all --runtime=nvidia -e "NVIDIA_DRIVER_CAPABILITIES=all" <docker-image-name>
+```
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 2bdabb9ebd..b90b70e4a9 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -541,6 +541,7 @@ module.exports = {
"miscellaneous/linux-single-process",
"gpu",
"miscellaneous/cloud-gpu",
+ "miscellaneous/ec2-docker-gpu",
],
},
{
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 1239f59636..db39bf7f53 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -674,7 +674,7 @@ export const articles = [
{
id: "font-picker",
title: "Build a Google Font picker",
- relativePath: "docs/font-picker.md",
+ relativePath: "docs/font-picker.mdx",
compId: "articles-docs-font-picker",
crumb: "Building video apps",
},
@@ -1518,6 +1518,13 @@ export const articles = [
compId: "articles-docs-miscellaneous-cloud-gpu",
crumb: "FAQ",
},
+ {
+ id: "miscellaneous/ec2-docker-gpu",
+ title: "Setup EC2 for Docker with GPU",
+ relativePath: "docs/miscellaneous/ec2-docker-gpu.md",
+ compId: "articles-docs-miscellaneous-ec2-docker-gpu",
+ crumb: "FAQ",
+ },
{
id: "embed-studio",
title: "Can I embed the Remotion Studio?",
diff --git a/packages/docs/static/generated/articles-docs-miscellaneous-ec2-docker-gpu.png b/packages/docs/static/generated/articles-docs-miscellaneous-ec2-docker-gpu.png
new file mode 100644
index 0000000000..ec13f11bbe
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-miscellaneous-ec2-docker-gpu.png differ
diff --git a/packages/google-fonts/src/index.ts b/packages/google-fonts/src/index.ts
index 5d7354014d..8617facc59 100644
--- a/packages/google-fonts/src/index.ts
+++ b/packages/google-fonts/src/index.ts
@@ -29,7 +29,6 @@ type FontInfo = {
fontFamily: string;
fonts: Record<string, Record<string, Record<string, string>>>;
unicodeRanges: Record<string, string>;
- waitUntilDone: () => Promise<undefined>;
};
};