remotion-dev/remotion · error · Error
Failed to create WebGL buffer
Error message
Failed to create WebGL buffer
What it means
Thrown by setupDuotone() when gl.createBuffer() returns null while building the fullscreen-quad VBO. The VAO was created moments before, so a null buffer points to context loss or buffer-object exhaustion rather than bad input.
Source
Thrown at packages/effects/src/duotone.ts:229
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
const program = createProgram(gl, DUOTONE_VS, DUOTONE_FS);
const vao = gl.createVertexArray();
if (!vao) {
throw new Error('Failed to create WebGL vertex array');
}
gl.bindVertexArray(vao);
const data = new Float32Array([
-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,
]);
const vbo = gl.createBuffer();
if (!vbo) {
throw new Error('Failed to create WebGL buffer');
}
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
const aPos = gl.getAttribLocation(program, 'aPos');
const aUv = gl.getAttribLocation(program, 'aUv');
gl.enableVertexAttribArray(aPos);
gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
gl.enableVertexAttribArray(aUv);
gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
gl.bindVertexArray(null);
const textureSource = createRgbaTexture(gl);
const colorCanvas = document.createElement('canvas');
colorCanvas.width = 1;View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Render with a software backend: `npx remotion render <comp> --gl=swiftshader`.
- Lower render concurrency.
- Restart the render worker / relaunch Chrome to recover a lost context.
- Update GPU drivers / Chromium.
Defensive patterns
Strategy: try-catch
Try / catch
async function safeRender(opts) {
try {
return await renderMedia(opts);
} catch (err) {
if (/Failed to create WebGL buffer/.test(String(err?.message ?? ''))) {
return await renderMedia({...opts, gl: 'swiftshader', concurrency: 1});
}
throw err;
}
} Prevention
- Lower concurrency to reduce simultaneous buffer allocation.
- Use a software GL backend in constrained environments.
- Restart the render worker to recover a lost context.
- Keep GPU drivers / Chromium updated.
When it happens
Trigger: First-frame duotone() setup where the driver cannot allocate the 16-byte Float32Array vertex buffer, typically because the context was lost or GPU buffer memory is exhausted.
Common situations: Many concurrent GPU renders, a crashed GPU process, or a constrained headless environment.
Related errors
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL texture
- Failed to create WebGL vertex array
- Failed to create WebGL shader
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/ca3568c12411cef8.
Report an issue: GitHub.