Skip to content

fix(renderer): make --gl egl/angle actually use the GPU; add GPU userspace to the Docker image - #13

Open
thecodacus wants to merge 1 commit into
masterfrom
fix/gpu-rendering
Open

thecodacus wants to merge 1 commit into
masterfrom
fix/gpu-rendering

Conversation

@thecodacus

@thecodacus thecodacus commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Problem

rendiv render --gl egl / --gl angle still rendered on the CPU. Headless Chromium picks SwiftShader for plain --use-gl=egl and --use-gl=angle, even with a GPU passed into the container. The Studio image also has no Vulkan loader, no GLVND EGL and no NVIDIA vendor files, so Chromium can't reach the driver the NVIDIA runtime injects.

Measured inside the Studio container (RTX 3060, --gpus all) by printing the WebGL renderer string:

flags renderer
--use-gl=egl (old --gl egl) ANGLE (Google, Vulkan 1.3.0 (SwiftShader …))
--use-gl=angle (old --gl angle) ANGLE (Google, Vulkan 1.3.0 (SwiftShader …))
--use-gl=angle --use-angle=gl-egl ANGLE (NVIDIA Corporation, NVIDIA GeForce RTX 3060/PCIe/SSE2, OpenGL ES 3.2)
--use-gl=angle --use-angle=vulkan ANGLE (NVIDIA, Vulkan 1.4.329 (NVIDIA GeForce RTX 3060))

(the last two only after adding the loaders + vendor files below)

Changes

  • renderer: egl → --use-gl=angle --use-angle=gl-egl, angle → --use-gl=angle --use-angle=vulkan. swiftshader unchanged. Same option names, no API change.
  • Dockerfile (runtime stage): libvulkan1 libegl1 libgl1 libglvnd0, the NVIDIA Vulkan ICD + GLVND EGL vendor JSONs, ENV NVIDIA_DRIVER_CAPABILITIES=all, and a usage note for --gpus all. No GPU → still renders on the CPU.
  • Docs: CLI help, the rendiv-video skill table and docs/rendering-performance.md describe what each mode uses.

Result

Full render of an ~18-min, GL-heavy video (three.js/WebGL plates + motion blur) in the patched Studio container: ~3 h → ~13 min.

Summary by CodeRabbit

  • New Features
    • Linux rendering can use GPU acceleration through ANGLE on Vulkan or EGL/GLES. SwiftShader remains available for CPU rendering.
    • Docker rendering supports NVIDIA GPUs when launched with GPU access enabled; the image includes the required graphics runtime components.
  • Documentation
    • Updated rendering guidance with GPU setup instructions and a performance comparison between GPU rendering and SwiftShader.

…space to the Docker image

Plain --use-gl=egl / --use-gl=angle let headless Chromium fall back to SwiftShader even with a GPU and drivers
present, so "GPU" renders silently ran on the CPU. egl now passes --use-angle=gl-egl and angle --use-angle=vulkan
(verified on an NVIDIA RTX 3060 in Docker via the WebGL renderer string).

The Studio image gains the Vulkan loader and GLVND EGL/GL (libvulkan1, libegl1, libgl1, libglvnd0), the NVIDIA
Vulkan ICD and EGL vendor JSONs, and NVIDIA_DRIVER_CAPABILITIES=all, so a container run with --gpus all can render
on the GPU. Without a GPU it still renders on the CPU. Measured: a GL-heavy 18-min video went from ~3 h to ~13 min.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1403f482-4d70-42a8-82e1-726e34671837

📥 Commits

Reviewing files that changed from the base of the PR and between 6d6aca2 and 4abf31c.

📒 Files selected for processing (5)
  • Dockerfile
  • docs/rendering-performance.md
  • packages/cli/src/commands/render.ts
  • packages/renderer/src/browser.ts
  • packages/skills/rendiv-video/rules/cli-and-studio.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The render options now select explicit ANGLE backends for EGL/GLES and Vulkan. The Docker image adds Vulkan and GLVND libraries and NVIDIA vendor configuration. The rendering guide and CLI descriptions document GPU options and Docker GPU access.

Changes

GPU Rendering

Layer / File(s) Summary
GL backend selection
packages/cli/src/commands/render.ts, packages/renderer/src/browser.ts, packages/skills/rendiv-video/rules/cli-and-studio.md
The --gl descriptions identify the EGL/GLES and Vulkan backends. The renderer maps egl to ANGLE’s gl-egl backend and angle to Vulkan.
Docker GPU support
Dockerfile, docs/rendering-performance.md
The Docker image adds Vulkan and GLVND libraries, NVIDIA vendor configuration files, and NVIDIA_DRIVER_CAPABILITIES=all. Docker comments and the rendering guide document GPU access and rendering options.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4abf3

This change makes the egl and angle GPU render modes select explicit ANGLE backends and adds NVIDIA GPU support to the Docker image. No actionable merge-blocking risk remains. Default CPU rendering is unchanged.

Architecture Summary

Architecture risk: 🔵 Low · up to 4abf3

The change affects 5 systems.

Changed systems: packages/cli, packages/renderer, Dockerfile, docs, packages/skills

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/cli (library) was modified; 1 changed file maps to changed impact.
  • observed — packages/renderer (library) was modified; 1 changed file maps to changed impact.
  • observed — Dockerfile (service) was modified; 1 changed file maps to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in Dockerfile: The usage comments add NVIDIA GPU setup instructions, identify angle/Vulkan and egl rendering options, and state that rendering falls back to CPU SwiftShader without a GPU.
  • observed — Modified behavior in Dockerfile: The runtime image adds Vulkan and GLVND libraries, creates NVIDIA ICD and EGL vendor JSON files for the injected driver libraries, and sets NVIDIA_DRIVER_CAPABILITIES=all. Previously, this install block only removed apt package lists after installing the existing dependencies.
  • observed — Modified behavior in docs/rendering-performance.md: The software GL fix now recommends --gl angle on Vulkan or --gl egl on Linux GPU, and documents Docker’s --gpus all setup and a measured RTX 3060 rendering comparison. It replaces the prior --use-gl=egl or native-GPU guidance; the macOS headless-GPU caveat remains.
  • observed — Modified behavior in packages/cli/src/commands/render.ts: The --gl option description now specifies the EGL/GLES and Vulkan backends for egl and angle; the available values and swiftshader default are unchanged.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main renderer fix and the Docker image GPU userspace changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant