|
8 | 8 | # |
9 | 9 | # Usage: |
10 | 10 | # docker run -v /path/to/projects:/workspace -v agent-persist:/persist -p 3000:3000 ghcr.io/thecodacus/rendiv-studio |
| 11 | +# |
| 12 | +# GPU rendering (NVIDIA, needs the NVIDIA Container Toolkit on the host): add `--gpus all` (compose: |
| 13 | +# deploy.resources.reservations.devices: [{driver: nvidia, count: all, capabilities: [gpu]}]) and render with |
| 14 | +# `--gl angle` (Vulkan) or `--gl egl`. Without a GPU the image still renders on the CPU (SwiftShader). |
11 | 15 | # ============================================================================= |
12 | 16 |
|
13 | 17 | # --------------------------------------------------------------------------- |
@@ -70,8 +74,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ |
70 | 74 | make g++ python3 \ |
71 | 75 | # General utilities |
72 | 76 | git curl \ |
| 77 | + # GPU rendering: Vulkan loader + GLVND EGL/GL so headless Chromium can reach the host GPU driver that |
| 78 | + # --gpus injects. Without these it silently falls back to SwiftShader (CPU) even with a GPU passed in. |
| 79 | + libvulkan1 libegl1 libgl1 libglvnd0 \ |
73 | 80 | && rm -rf /var/lib/apt/lists/* |
74 | 81 |
|
| 82 | +# NVIDIA vendor files for the Vulkan loader and GLVND EGL. The NVIDIA Container Toolkit injects the driver libraries |
| 83 | +# (libGLX_nvidia / libEGL_nvidia) but not always these JSONs; harmless on machines without an NVIDIA GPU. |
| 84 | +RUN mkdir -p /usr/share/vulkan/icd.d /usr/share/glvnd/egl_vendor.d \ |
| 85 | + && printf '%s' '{"file_format_version":"1.0.0","ICD":{"library_path":"libGLX_nvidia.so.0","api_version":"1.3.0"}}' \ |
| 86 | + > /usr/share/vulkan/icd.d/nvidia_icd.json \ |
| 87 | + && printf '%s' '{"file_format_version":"1.0.0","ICD":{"library_path":"libEGL_nvidia.so.0"}}' \ |
| 88 | + > /usr/share/glvnd/egl_vendor.d/10_nvidia.json |
| 89 | +# Ask the NVIDIA runtime for the graphics libraries too (compute-only is the default and has no Vulkan/EGL) |
| 90 | +ENV NVIDIA_DRIVER_CAPABILITIES=all |
| 91 | + |
75 | 92 | # Install pnpm |
76 | 93 | RUN corepack enable && corepack prepare [email protected] --activate |
77 | 94 |
|
|
0 commit comments