remotion-dev/remotion · error · Error
Failed to create WebGL buffer
Error message
Failed to create WebGL buffer
What it means
Thrown by setupVenetianBlinds when gl.createBuffer() returns null. The buffer is needed to hold the fullscreen-quad vertex data (positions + UVs as a Float32Array). A null return indicates context loss or buffer object exhaustion.
Source
Thrown at packages/effects/src/venetian-blinds.ts:265
const fs = compileShader(gl, gl.FRAGMENT_SHADER, VENETIAN_BLINDS_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
- Reduce concurrent render processes to free GL buffer allocations
- Register webglcontextlost and re-run after webglcontextrestored
- Update GPU drivers and verify VRAM availability
- Reduce the resolution or number of source textures to free GPU memory
Defensive patterns
Strategy: try-catch
Try / catch
try {
const state = setupVenetianBlinds(canvas);
} catch (err) {
if (err instanceof Error && err.message === 'Failed to create WebGL buffer') {
throw new Error('WebGL2 context lost or buffer limit reached for venetian-blinds. Retry render.');
}
throw err;
} Prevention
- Lower render concurrency to reduce simultaneous GL buffer allocations
- Monitor webglcontextlost to detect context loss proactively
- Restart render browser instances periodically to avoid GL state degradation
When it happens
Trigger: After the VAO is created and bound, gl.createBuffer() returns null. Occurs when the GL context is in a lost state or the driver cannot allocate another buffer object.
Common situations: Context loss during a render with many effects; driver resource exhaustion in high-concurrency rendering; GPU memory pressure from large textures consuming VRAM.
Related errors
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL vertex array
- Failed to create WebGL texture
- Failed to create WebGL buffer
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/0ca1315872d47cf2.
Report an issue: GitHub.