From e2b7b1c34d23e30afa97e219b0f1ad18c31d5015 Mon Sep 17 00:00:00 2001 From: abrand Date: Thu, 4 Dec 2025 12:57:43 -0500 Subject: [PATCH] skip_resource_reservation --- .../spcue/dispatcher/CoreUnitDispatcher.java | 16 ++++++++++++++-- cuebot/src/main/resources/opencue.properties | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/CoreUnitDispatcher.java b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/CoreUnitDispatcher.java index 7b3cd911f..1055234f6 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/CoreUnitDispatcher.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/CoreUnitDispatcher.java @@ -90,6 +90,7 @@ public class CoreUnitDispatcher implements Dispatcher { private final long MEM_RESERVED_MIN; private final long MEM_GPU_RESERVED_DEFAULT; private final long MEM_GPU_RESERVED_MIN; + private final boolean SKIP_GPU_RESERVATION; private Environment env; @@ -105,6 +106,7 @@ public CoreUnitDispatcher(Environment env) { MEM_RESERVED_MIN = getLongProperty("dispatcher.memory.mem_reserved_min"); MEM_GPU_RESERVED_DEFAULT = getLongProperty("dispatcher.memory.mem_gpu_reserved_default"); MEM_GPU_RESERVED_MIN = getLongProperty("dispatcher.memory.mem_gpu_reserved_min"); + SKIP_GPU_RESERVATION = getBooleanProperty("dispatcher.gpu.skip_resource_reservation"); } /* @@ -115,12 +117,19 @@ private int getIntProperty(String property) { } /* - * Return an integer value from the opencue.properties given a key + * Return a long value from the opencue.properties given a key */ private long getLongProperty(String property) { return env.getRequiredProperty(property, Long.class); } + /* + * Return a boolean value from the opencue.properties given a key + */ + private boolean getBooleanProperty(String property) { + return env.getRequiredProperty(property, Boolean.class); + } + private Cache getOrCreateJobLock() { if (jobLock == null) { this.jobLock = CacheBuilder.newBuilder() @@ -188,7 +197,10 @@ private Set getGpuJobs(DispatchHost host, ShowInterface show) { getIntProperty("dispatcher.job_query_max")); if (jobs.size() == 0) { - host.removeGpu(); + // Only remove GPU resources if skip reservation is disabled (default behavior) + if (!SKIP_GPU_RESERVATION) { + host.removeGpu(); + } jobs = null; } } diff --git a/cuebot/src/main/resources/opencue.properties b/cuebot/src/main/resources/opencue.properties index 233d00516..0baed6527 100644 --- a/cuebot/src/main/resources/opencue.properties +++ b/cuebot/src/main/resources/opencue.properties @@ -205,6 +205,11 @@ dispatcher.memory.mem_gpu_reserved_min = 0 # Default = 100GB dispatcher.memory.mem_gpu_reserved_max = 104857600 +# On job dispatch, skip GPU resource reservation when no GPU jobs are found +# Set to true to allow normal frames to use full host resources even when GPU is available +# Environment variable: CUEBOT_DISPATCHER_SKIP_GPU_RESERVATION +dispatcher.gpu.skip_resource_reservation=${CUEBOT_DISPATCHER_SKIP_GPU_RESERVATION:false} + # Whether to satisfy dependents (*_ON_FRAME and *_ON_LAYER) only on Frame success depend.satisfy_only_on_frame_success=true