remotion-dev/remotion · error · Error
Failed to create WebGL texture
Error message
Failed to create WebGL texture
What it means
Thrown by setupEmboss() when gl.createTexture() returns null. The VAO/VBO already succeeded, so a null texture means the driver could not allocate a texture object, indicating context loss or texture-resource exhaustion.
Source
Thrown at packages/effects/src/emboss.ts:352
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');
}
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.bindTexture(gl.TEXTURE_2D, null);
return {
gl,
program,
vao,
vbo,
texture,
uniforms: {
uSource: gl.getUniformLocation(program, 'uSource'),
uResolution: gl.getUniformLocation(program, 'uResolution'),View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Render with a software backend: `npx remotion render <comp> --gl=swiftshader`.
- Lower render concurrency to reduce simultaneous texture allocation.
- Restart the render worker 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 texture/.test(String(err?.message ?? ''))) {
return await renderMedia({...opts, gl: 'swiftshader', concurrency: 1});
}
throw err;
}
} Prevention
- Reduce concurrency to lower simultaneous texture allocation pressure.
- Prefer a software GL backend in constrained/headless environments.
- Restart the render worker if you suspect a leaked/lost context.
- Keep GPU drivers / Chromium updated.
When it happens
Trigger: Occurs during setupEmboss() when allocating the source texture that receives each frame's pixel data, on a GPU that has lost the context or exhausted its texture-object budget.
Common situations: Many concurrent GPU-effect frames, a GPU process crash, or a sandboxed headless Chrome with constrained texture memory.
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/dcfc7f05ca89db7c.
Report an issue: GitHub.