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

@@ -37,6 +37,8 @@ func init() {
runnerCmd.Flags().String("log-level", "info", "Log level (debug, info, warn, error)")
runnerCmd.Flags().BoolP("verbose", "v", false, "Enable verbose logging (same as --log-level=debug)")
runnerCmd.Flags().Duration("poll-interval", 5*time.Second, "Job polling interval")
runnerCmd.Flags().Bool("force-cpu-rendering", false, "Force CPU rendering for all jobs (disables GPU rendering)")
runnerCmd.Flags().Bool("disable-hiprt", false, "Disable HIPRT acceleration in Blender Cycles")
// Bind flags to viper with JIGGABLEND_ prefix
runnerViper.SetEnvPrefix("JIGGABLEND")
@@ -51,6 +53,8 @@ func init() {
runnerViper.BindPFlag("log_level", runnerCmd.Flags().Lookup("log-level"))
runnerViper.BindPFlag("verbose", runnerCmd.Flags().Lookup("verbose"))
runnerViper.BindPFlag("poll_interval", runnerCmd.Flags().Lookup("poll-interval"))
runnerViper.BindPFlag("force_cpu_rendering", runnerCmd.Flags().Lookup("force-cpu-rendering"))
runnerViper.BindPFlag("disable_hiprt", runnerCmd.Flags().Lookup("disable-hiprt"))
}
func runRunner(cmd *cobra.Command, args []string) {
@@ -63,6 +67,8 @@ func runRunner(cmd *cobra.Command, args []string) {
logLevel := runnerViper.GetString("log_level")
verbose := runnerViper.GetBool("verbose")
pollInterval := runnerViper.GetDuration("poll_interval")
forceCPURendering := runnerViper.GetBool("force_cpu_rendering")
disableHIPRT := runnerViper.GetBool("disable_hiprt")
var r *runner.Runner
@@ -118,7 +124,7 @@ func runRunner(cmd *cobra.Command, args []string) {
}
// Create runner
r = runner.New(managerURL, name, hostname)
r = runner.New(managerURL, name, hostname, forceCPURendering, disableHIPRT)
// Check for required tools early to fail fast
if err := r.CheckRequiredTools(); err != nil {