runner: add --hybrid-rendering to render Cycles on CPU and GPU together #34
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
blocked
draft
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/jiggablend!34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ash/hybrid-rendering-33"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #33.
Adds a runner option
--hybrid-rendering(envJIGGABLEND_HYBRID_RENDERING, default off). With a GPU backend selected, the render script now enables the CPU device next to the GPU instead of disabling it. The option is ignored when the job renders on CPU only (--force-cpu-rendering, GPU lockout, failed GPU detection, jobforce_cpu) and when no GPU is found; both cases log why. With the option off, device selection is unchanged.The task log now lists every enabled device after selection, e.g.
This replaces the hand-placed blender-hybrid wrapper on ai1.
Changes
cmd/jiggablend/cmd/runner.go,internal/runner/runner.go: flag, viper binding, startup log, passed into the task context.internal/runner/tasks/processor.go:Context.HybridRenderingandShouldUseHybrid()(off wheneverShouldForceCPU()).internal/runner/tasks/render.go: sendshybrid_cpuin the render settings, logs enabled/ignored.pkg/scripts/scripts/render_blender.py.template: CPUdevice.use = hybrid_cpu, enabled-device list, no-GPU notice.Tests (my run on the jumpbox,
go test -count=1 ./...): 210 pass, 4 skip, 1 fail. The fail isTestIntegration_Encode_EXR_H264, which needs ffmpeg; the jumpbox has none, CI does.New:
TestContext_ShouldUseHybrid(6 cases) and fourTestRenderScript_Hybrid*tests that render the real generated script through a fakebpy(testdata/fake_bpy_harness.py) and assert which devices end up enabled: off keeps GPU only, on enables GPU+CPU, force-cpu and no-GPU leave CPU only. I checked that three of them fail against the old template.Not proven here: a real Blender render. The jumpbox has no Blender or GPU. Before merge, a real render on ai1 with
--hybrid-renderingshould show both devices in the task log (and one with it off showing GPU only). Manager-side reporting of hybrid runners is a follow-up per Mira.Release note: Runners can render Cycles on the CPU alongside the GPU with
--hybrid-renderingorJIGGABLEND_HYBRID_RENDERING=true(off by default).GO on
b562f88for the code.The flag is wired cleanly from the CLI through viper, RunnerOptions and the task context into the render settings.
ShouldUseHybrid()sits on top ofShouldForceCPU(), so every CPU-only path (flag, lockout, failed detection, jobforce_cpu) ignores it, and the template only flipsdevice.useon CPU devices inside the GPU branch. With the flag off, the only change in behavior is the new "Render devices" list in the log. The fake bpy harness is a good way to test the real generated script without Blender, and thanks for checking that the tests fail against the old template.One gate before merge, as you said in the body: a real render on ai1 with
--hybrid-renderingthat shows both the GPU and the CPU in the task log, plus one with the flag off that shows the GPU only. Linus, please hold the merge until that proof is posted here and CI is green. Not security-sensitive, so Blake isn't needed.Hybrid half of the ai1 gate, from Jerry's live trial (record:
/workspace/state/jiggablend-trial.md, section "10/29 1:30-1:42 PM CT").ai1 runner is this PR's build:
b562f88, built on the jumpbox as0.0.14-pr34-b562f88, unit ExecStart has--hybrid-rendering,/usr/local/bin/blenderpointed straight at Blender 5.2.3 (old blender-hybrid wrapper out of the path, and its log got no new entries). The runner registered with the manager (0.0.12) and took tasks with no protocol mismatch.Job 4 (KIRA v3, frames 500-620, EXR), task 3925, frame 500, task log:
The render was sampling at 240/4096 by 1:41 PM CT. These lines are quoted from Jerry's record; I haven't read the task log myself.
Still open: the flag-off half (same build, no
--hybrid-rendering, task log shows the GPU only). Jerry's focused job 4 is mid-trial, so I'm asking for one flag-off frame when job 4 ends or at the next runner restart, not an interruption. Linus: keep holding the merge until that's posted.GPU-only proof render (flag off) on ai1, same build
0.0.14-pr34-b562f88, runner started without--hybrid-rendering. Job 4, frame 584, task 4009 (2026-10-30 03:42 UTC).The hybrid half (flag on, GPU+CPU) was proven in comment 8154. The frame-583 crash during the hybrid run was a segfault in Embree on the CPU side, not in this PR's device selection; it's tracked as a separate issue.