MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / release

Method release

crates/openshell-driver-vm/src/gpu.rs:118–130  ·  view source on GitHub ↗

Release a GPU assignment. The `GpuBindGuard` is dropped, restoring the GPU.

(&mut self, sandbox_id: &str)

Source from the content-addressed store, hash-verified

116
117 /// Release a GPU assignment. The `GpuBindGuard` is dropped, restoring the GPU.
118 pub fn release(&mut self, sandbox_id: &str) {
119 if let Some(slot) = self
120 .slots
121 .iter_mut()
122 .find(|s| s.assigned_to.as_deref() == Some(sandbox_id))
123 {
124 let bdf = slot.info.bdf.clone();
125 slot.assigned_to = None;
126 slot.bind_guard.take();
127 self.persist_state();
128 tracing::info!(bdf = %bdf, sandbox_id = %sandbox_id, "released GPU assignment");
129 }
130 }
131
132 fn persist_state(&self) {
133 let bindings: Vec<GpuBinding> = self

Callers 4

release_gpuMethod · 0.45
release_subnetMethod · 0.45

Calls 2

persist_stateMethod · 0.80
removeMethod · 0.45