Add hardware compatibility flags for CPU rendering and HIPRT control

- Introduced `--force-cpu-rendering` and `--disable-hiprt` flags to the runner command, allowing users to enforce CPU rendering and disable HIPRT acceleration.
- Updated the runner initialization and context structures to accommodate the new flags, enhancing flexibility in rendering configurations.
- Modified the rendering logic to respect these flags, improving compatibility and user control over rendering behavior in Blender.
This commit is contained in:
2026-03-13 21:15:44 -05:00
parent 5303f01f7c
commit dc525fbaa4
6 changed files with 52 additions and 6 deletions

View File

@@ -49,6 +49,10 @@ type Context struct {
GPUDetectionFailed bool
// OnGPUError is called when a GPU error line is seen in render logs; typically sets runner GPU lockout.
OnGPUError func()
// ForceCPURendering is a runner-level override that forces CPU rendering for all jobs.
ForceCPURendering bool
// DisableHIPRT is a runner-level override that disables HIPRT acceleration in Blender.
DisableHIPRT bool
}
// ErrJobCancelled indicates the manager-side job was cancelled during execution.
@@ -73,6 +77,8 @@ func NewContext(
gpuLockedOut bool,
hasHIP bool,
gpuDetectionFailed bool,
forceCPURendering bool,
disableHIPRT bool,
onGPUError func(),
) *Context {
if frameEnd < frameStart {
@@ -97,6 +103,8 @@ func NewContext(
GPULockedOut: gpuLockedOut,
HasHIP: hasHIP,
GPUDetectionFailed: gpuDetectionFailed,
ForceCPURendering: forceCPURendering,
DisableHIPRT: disableHIPRT,
OnGPUError: onGPUError,
}
}
@@ -182,6 +190,9 @@ func (c *Context) ShouldEnableExecution() bool {
// (runner GPU lockout, GPU detection failed at startup for any version, metadata force_cpu,
// or Blender < 4.x when the runner has HIP).
func (c *Context) ShouldForceCPU() bool {
if c.ForceCPURendering {
return true
}
if c.GPULockedOut {
return true
}