Skip to content

Commit e2b7b1c

Browse files
committed
skip_resource_reservation
1 parent b00240b commit e2b7b1c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

cuebot/src/main/java/com/imageworks/spcue/dispatcher/CoreUnitDispatcher.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public class CoreUnitDispatcher implements Dispatcher {
9090
private final long MEM_RESERVED_MIN;
9191
private final long MEM_GPU_RESERVED_DEFAULT;
9292
private final long MEM_GPU_RESERVED_MIN;
93+
private final boolean SKIP_GPU_RESERVATION;
9394

9495
private Environment env;
9596

@@ -105,6 +106,7 @@ public CoreUnitDispatcher(Environment env) {
105106
MEM_RESERVED_MIN = getLongProperty("dispatcher.memory.mem_reserved_min");
106107
MEM_GPU_RESERVED_DEFAULT = getLongProperty("dispatcher.memory.mem_gpu_reserved_default");
107108
MEM_GPU_RESERVED_MIN = getLongProperty("dispatcher.memory.mem_gpu_reserved_min");
109+
SKIP_GPU_RESERVATION = getBooleanProperty("dispatcher.gpu.skip_resource_reservation");
108110
}
109111

110112
/*
@@ -115,12 +117,19 @@ private int getIntProperty(String property) {
115117
}
116118

117119
/*
118-
* Return an integer value from the opencue.properties given a key
120+
* Return a long value from the opencue.properties given a key
119121
*/
120122
private long getLongProperty(String property) {
121123
return env.getRequiredProperty(property, Long.class);
122124
}
123125

126+
/*
127+
* Return a boolean value from the opencue.properties given a key
128+
*/
129+
private boolean getBooleanProperty(String property) {
130+
return env.getRequiredProperty(property, Boolean.class);
131+
}
132+
124133
private Cache<String, String> getOrCreateJobLock() {
125134
if (jobLock == null) {
126135
this.jobLock = CacheBuilder.newBuilder()
@@ -188,7 +197,10 @@ private Set<String> getGpuJobs(DispatchHost host, ShowInterface show) {
188197
getIntProperty("dispatcher.job_query_max"));
189198

190199
if (jobs.size() == 0) {
191-
host.removeGpu();
200+
// Only remove GPU resources if skip reservation is disabled (default behavior)
201+
if (!SKIP_GPU_RESERVATION) {
202+
host.removeGpu();
203+
}
192204
jobs = null;
193205
}
194206
}

cuebot/src/main/resources/opencue.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ dispatcher.memory.mem_gpu_reserved_min = 0
205205
# Default = 100GB
206206
dispatcher.memory.mem_gpu_reserved_max = 104857600
207207

208+
# On job dispatch, skip GPU resource reservation when no GPU jobs are found
209+
# Set to true to allow normal frames to use full host resources even when GPU is available
210+
# Environment variable: CUEBOT_DISPATCHER_SKIP_GPU_RESERVATION
211+
dispatcher.gpu.skip_resource_reservation=${CUEBOT_DISPATCHER_SKIP_GPU_RESERVATION:false}
212+
208213
# Whether to satisfy dependents (*_ON_FRAME and *_ON_LAYER) only on Frame success
209214
depend.satisfy_only_on_frame_success=true
210215

0 commit comments

Comments
 (0)