remotion-dev/remotion · error · Error
Failed to create WebGL program
Error message
Failed to create WebGL program
What it means
Thrown by emboss's linkProgram() when gl.createProgram() returns null after both shaders compiled. Allocation of the shader objects succeeded, but the program object could not be created, signalling context loss or GPU resource exhaustion.
Source
Thrown at packages/effects/src/emboss.ts:289
gl.shaderSource(shader, source);
gl.compileShader(shader);
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
const log = gl.getShaderInfoLog(shader);
gl.deleteShader(shader);
throw new Error(`Emboss shader compile failed: ${log ?? '(no log)'}`);
}
return shader;
};
const linkProgram = (
gl: WebGL2RenderingContext,
vs: WebGLShader,
fs: WebGLShader,
): WebGLProgram => {
const program = gl.createProgram();
if (!program) {
throw new Error('Failed to create WebGL program');
}
gl.attachShader(program, vs);
gl.attachShader(program, fs);
gl.linkProgram(program);
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
const log = gl.getProgramInfoLog(program);
gl.deleteProgram(program);
throw new Error(`Emboss program link failed: ${log ?? '(no log)'}`);
}
return program;
};
const setupEmboss = (target: HTMLCanvasElement): EmbossState => {
const gl = target.getContext('webgl2', {
premultipliedAlpha: true,
alpha: true,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Render with a software backend: `npx remotion render <comp> --gl=swiftshader`.
- Reduce render concurrency.
- 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 program/.test(String(err?.message ?? ''))) {
return await renderMedia({...opts, gl: 'swiftshader'});
}
throw err;
}
} Prevention
- Render with a software GL backend when GPU resources are constrained.
- Limit concurrency to keep the per-frame context load within GPU limits.
- Restart render workers periodically to avoid context-loss accumulation.
- Update GPU drivers / Chromium.
When it happens
Trigger: Occurs in setupEmboss() on a frame whose WebGL2 context is lost or whose program-object budget is exhausted between compileShader() and linkProgram().
Common situations: GPU process crash/reset, many concurrent GPU-effect renders, or a constrained containerized GPU.
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/7451bdfb88b84aa7.
Report an issue: GitHub.