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

  1. Render with a software backend: `npx remotion render <comp> --gl=swiftshader`.
  2. Lower render concurrency to reduce simultaneous texture allocation.
  3. Restart the render worker to recover a lost context.
  4. 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

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


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/dcfc7f05ca89db7c. Report an issue: GitHub.