Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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");
}

/*
Expand All @@ -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<String, String> getOrCreateJobLock() {
if (jobLock == null) {
this.jobLock = CacheBuilder.newBuilder()
Expand Down Expand Up @@ -188,7 +197,10 @@ private Set<String> 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;
}
}
Expand Down
5 changes: 5 additions & 0 deletions cuebot/src/main/resources/opencue.properties
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,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

Expand Down
Loading