{"record":{"id":"ca3568c12411cef8","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-ca3568","errorCode":null,"errorMessage":"Failed to create WebGL buffer","messagePattern":"Failed to create WebGL buffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/duotone.ts","lineNumber":229,"sourceCode":"\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, DUOTONE_VS, DUOTONE_FS);\n\n\tconst vao = gl.createVertexArray();\n\tif (!vao) {\n\t\tthrow new Error('Failed to create WebGL vertex array');\n\t}\n\n\tgl.bindVertexArray(vao);\n\n\tconst data = new Float32Array([\n\t\t-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,\n\t]);\n\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\t\tthrow new Error('Failed to create WebGL buffer');\n\t}\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\tgl.enableVertexAttribArray(aPos);\n\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(aUv);\n\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\n\tgl.bindVertexArray(null);\n\n\tconst textureSource = createRgbaTexture(gl);\n\n\tconst colorCanvas = document.createElement('canvas');\n\tcolorCanvas.width = 1;","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/duotone.ts#L211-L247","documentation":"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.","triggerScenarios":"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.","commonSituations":"Many concurrent GPU renders, a crashed GPU process, or a constrained headless environment.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function safeRender(opts) {\n  try {\n    return await renderMedia(opts);\n  } catch (err) {\n    if (/Failed to create WebGL buffer/.test(String(err?.message ?? ''))) {\n      return await renderMedia({...opts, gl: 'swiftshader', concurrency: 1});\n    }\n    throw err;\n  }\n}","preventionTips":["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."],"tags":["webgl","gpu","rendering","effects","runtime"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}