remotion-dev/remotion · error · Error
Failed to create WebGL buffer
Error message
Failed to create WebGL buffer
What it means
Thrown by setupEmboss() when gl.createBuffer() returns null while building the fullscreen-quad VBO. The VAO was created moments before, so a null buffer indicates context loss or buffer-object exhaustion, not bad input.
Source
Thrown at packages/effects/src/emboss.ts:335
const fs = compileShader(gl, gl.FRAGMENT_SHADER, EMBOSS_FS);
const program = linkProgram(gl, vs, fs);
gl.deleteShader(vs);
gl.deleteShader(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 texture = gl.createTexture();
if (!texture) {
throw new Error('Failed to create WebGL texture');
}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 emboss() setup where the driver cannot allocate the 16-byte vertex buffer 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 buffer
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/512722b24ae5860c.
Report an issue: GitHub.