Configure the render backend
Choose the OpenGL or Vulkan render backend of an instance, let it render on a software Vulkan device where there is no GPU, enable vector exports, and fix UNIMPLEMENTED_ERROR and NO_3D_RENDERER.
For the administrator of an instance. Everything the server renders — the thumbnails of the tree, the screenshots the API returns, the snapshots in a BCF export, the images in a BRL report and the vector drawings — goes through its render backend. That backend is OpenGL by default; a Vulkan backend can run on a GPU or on a software device such as Mesa's lavapipe or SwiftShader, which run the same shaders on the CPU. An instance without a GPU then renders the same images, ten to fifty times slower. Vector exports need Vulkan in any case.
Before you start#
- Access to the configuration of the node that executes render tasks, and a way to restart it: the backend is created at start-up, not on a configuration reload.
- The container images ship the Mesa Vulkan drivers, which cover AMD and Intel GPUs and the CPU device in one package. Outside the images, install a Vulkan driver for the GPU, or lavapipe or SwiftShader for the CPU.
1. Choose the backend#
rendering:
type: local # render on this node
enabled: true # false (default): nothing is rendered
backend: opengl # opengl (default) | vulkan | auto
device_index: -1 # -1: automatic, discrete GPU first
allow_software: false # true: accept a CPU Vulkan device
max_concurrent_renders: 0 # 0: min(4, gpus × 2), at least 1typehas no default: arenderingsection without it is rejected.localis the kind these settings belong to. Withoutenabled: truethe node renders nothing, and a render call answersNO_3D_RENDERER.- Which backend comes up also depends on
resources.gpus.openglneeds a positive value; without one the node has no render backend. vulkanis tried whenresources.gpusis positive orallow_softwareis on. If Vulkan then does not come up, the node refuses to start and logs the cause; with neither, it starts without a render backend.autotries Vulkan the same way and falls back to OpenGL with a warning, which again needs a positiveresources.gpus.- The device is the first discrete GPU by default, or the one
device_indexnames. - A CPU device is excluded unless
allow_softwareis on, so a production instance never renders on the CPU by accident, with what would look like a mysterious slowdown. When it is on and no GPU is found, the server logs that it renders on a software device and carries on.
2. Give a CPU-only node render work#
Rendering tasks run on nodes that can render: a node with a positive resources.gpus, or one with backend: vulkan (or auto) and allow_software: true, which counts as one render slot. A CPU-only node therefore needs no resources.gpus value; leave it at 0, so the OpenGL backend stays off and the render concurrency is sized for a CPU device. A node that can do neither passes render requests to a fleet node with a GPU, and without one answers that a GPU is needed.
3. Enable vector exports#
Vector export (Export a vector drawing) is enabled by default (features.vector_svg; false switches it off), but its visibility pass needs the Vulkan backend. Merge these settings into the configuration of the node executing the export, keeping its other resource settings:
rendering:
type: local
enabled: true
backend: vulkan
resources:
gpus: 1On a CPU-only node, set rendering.allow_software: true instead of resources.gpus (the container images ship lavapipe; elsewhere install a software Vulkan device).
Restart the node. Its start-up log contains Render backend: with the selected Vulkan device.
If an export fails#
UNIMPLEMENTED_ERRORfromExportVectorSvg: the instance has switched vector export off. The response'serror.userSafeMessagesays "The vector_svg feature is not enabled on this instance". Removefeatures.vector_svg: falsefrom the configuration, or set it totrue.NO_3D_RENDERER: the feature is enabled, but the node executing the task has no initialised Vulkan backend. Ordinary screenshots can work with the defaultopenglbackend while vector exports fail, because their visibility pass requires Vulkan;backend: autocan fall back to OpenGL, which still cannot run the export. Setbackend: vulkan(step 3) and restart.
Limits#
Very old or limited Vulkan devices are rejected. The speed difference of a software device is real: plan for it on an instance that renders many report images.
Check#
After the restart the log names the Vulkan device after Render backend:, and the demo on Render a screenshot on the server returns an image.