Skip to content

🎥 Make videos programmatically with React

GPU

Jonny Burger62ed8acfe0ca
diff --git a/packages/docs/docs/gpu.md b/packages/docs/docs/gpu.md
new file mode 100644
index 0000000000..b73f5db2cd
--- /dev/null
+++ b/packages/docs/docs/gpu.md
@@ -0,0 +1,35 @@
+---
+id: gpu
+title: Using the GPU
+sidebar_label: Using the GPU
+---
+
+Some types of content in Remotion can benefit from a GPU being available on the machine that is used for rendering. That is:
+
+- WebGL content (Three.JS, P5.js, Mapbox etc.)
+- 2D Canvas graphics
+- GPU-accelerated CSS properties such as `filter: blur()`
+
+If a GPU is available, it should be enabled by default while rendering the preview. However, in headless mode, Chromium disables the GPU, leading to a significant
+slowdown in rendering time.
+
+## The way forward: Chrome 98
+
+In Chrome 98 (scheduled for release in February 2022), the GPU can be used in headless mode. Testing a Chromium build that is compiled from source, we found that a video rendered on a `<canvas>` on macOS content is many times faster than in the stable version of Chrome.
+
+We will continue to observe this area and update this document with our findings and share best practices.
+
+## Considerations
+
+For rendering content that can benefit from a GPU, you might want to choose a cloud rendering solution to which a GPU can be attached to over AWS Lambda (which does not have a GPU). Most bigger cloud providers have some GPU-enabled VPS offerings. Apple M1 VPS instances might also be able to accelerate graphics rendering and be more economical than VPS instances with desktop graphic cards.
+
+Note that to realize these gains, the Chrome update has yet to arrive. We have not yet done any testing in the cloud.
+
+## Software emulation
+
+You can still render all types of content without having a GPU, it will just be slower.
+The graphics content will be software-emulated using [ANGLE](https://github.com/google/angle) or [SwiftShader](https://github.com/google/swiftshader) (when using Lambda).
+
+## What are your experiences?
+
+We'd love to learn and document more findings about the GPU. Let us know and we will amend this document!
diff --git a/packages/docs/docs/prereleases.md b/packages/docs/docs/prereleases.md
index aaba154c30..5baa0916d1 100644
--- a/packages/docs/docs/prereleases.md
+++ b/packages/docs/docs/prereleases.md
@@ -12,4 +12,4 @@ import {Prerelease} from "../components/PrereleaseVersion"
Make sure that you remove the `^` character from the version. If you don't, you get the version with the alphabetically highest hash, which is a random version of Remotion rather than the one you want.
:::
-Afterwards, run `yarn` or `npm i` respectively.
+Afterwards, run `yarn`, `npm i` or `pnpm i` respectively.
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 2a0cfc1b7a..0015a2a8d5 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -139,6 +139,12 @@ module.exports = {
"flickering",
],
},
+ {
+ type: "category",
+ label: "Miscellaneous",
+ collapsed: false,
+ items: ["chromium-flags", "prereleases", "gpu"],
+ },
"2-0-migration",
"license",
],