{"record":{"id":"d24529f5648ceaa1","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-geometry-d24529","errorCode":null,"errorMessage":"Failed to create WebGL geometry","messagePattern":"Failed to create WebGL geometry","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/skew.ts","lineNumber":210,"sourceCode":"\tif (!program) {\n\t\tthrow new Error('Failed to create WebGL program');\n\t}\n\n\tgl.attachShader(program, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(`Skew program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\tconst vao = gl.createVertexArray();\n\tconst vbo = gl.createBuffer();\n\tif (!vao || !vbo) {\n\t\tthrow new Error('Failed to create WebGL geometry');\n\t}\n\n\tgl.bindVertexArray(vao);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(\n\t\tgl.ARRAY_BUFFER,\n\t\tnew Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),\n\t\tgl.STATIC_DRAW,\n\t);\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\tgl.bindVertexArray(null);\n\n\tconst texture = gl.createTexture();","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/skew.ts#L192-L228","documentation":"In setupSkew() the skew() effect calls gl.createVertexArray() and gl.createBuffer() to hold its fullscreen-quad geometry; if either returns null it throws 'Failed to create WebGL geometry'. A null VAO or VBO means the context is lost or out of geometry resources, so the effect has nowhere to upload its vertex data.","triggerScenarios":"Context loss or buffer/VAO exhaustion immediately after program linking in setupSkew(); exceeding the driver's bound on simultaneous vertex array objects or buffers because many WebGL2 effects are live at once.","commonSituations":"High render concurrency with numerous stacked WebGL2 effects; long renders leaking VAOs/VBOs; headless or software-GPU environments with tight resource caps; driver reset mid-setup.","solutions":["Render with ANGLE (--gl=angle / chromiumOptions.gl='angle' / Studio OpenGL=angle).","Cut concurrency and/or the number of WebGL2 effects per frame to free VAO/VBO slots.","Confirm the effect cleanup path (deleteVertexArray/deleteBuffer) actually runs so resources are reclaimed.","Use a host with a conformant GPU and current drivers."],"exampleFix":"// before\nnpx remotion render main MyComp out.mp4 --concurrency=16\n\n// after\nnpx remotion render main MyComp out.mp4 --concurrency=4 --gl=angle","handlingStrategy":"try-catch","validationCode":"// A null VAO/VBO is a context-loss/resource symptom; only generic WebGL2 capability is pre-checkable.\nfunction webgl2Available(): boolean {\n  try {\n    return !!document.createElement('canvas').getContext('webgl2');\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await renderMedia({ composition, codec: 'h264', chromiumOptions: { gl: 'angle' }, concurrency: 4 });\n} catch (err) {\n  if (err instanceof Error && /Failed to create WebGL geometry/.test(err.message)) {\n    console.error('skew() VAO/VBO allocation failed (context lost/exhausted). Reduce concurrency/effects.', err);\n    throw err;\n  }\n  throw err;\n}","preventionTips":["Render with ANGLE and modest concurrency.","Limit the count of stacked WebGL2 effects per frame.","Ensure effect cleanup runs so VAOs/VBOs are released.","Use a host with a real GPU and current drivers."],"tags":["webgl","gpu","effects","skew","geometry","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}