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

Method validate_gpu_request

crates/openshell-driver-podman/src/driver.rs:384–400  ·  view source on GitHub ↗
(
        gpu_requirements: Option<&GpuResourceRequirements>,
        driver_config: &PodmanSandboxDriverConfig,
    )

Source from the content-addressed store, hash-verified

382 }
383
384 fn validate_gpu_request(
385 gpu_requirements: Option<&GpuResourceRequirements>,
386 driver_config: &PodmanSandboxDriverConfig,
387 ) -> Result<(), ComputeDriverError> {
388 let _ = effective_driver_gpu_count(gpu_requirements)
389 .map_err(ComputeDriverError::InvalidArgument)?;
390 if let Some(cdi_devices) = driver_config.cdi_devices.as_deref() {
391 validate_specific_gpu_device_request(
392 gpu_requirements,
393 cdi_devices,
394 "driver_config.cdi_devices",
395 )
396 .map_err(ComputeDriverError::InvalidArgument)?;
397 }
398
399 Ok(())
400 }
401
402 fn refresh_gpu_inventory(&self) {
403 let (inventory, allow_all_default_gpu) = (self.gpu_inventory_refresh)();

Callers

nothing calls this directly

Tested by

no test coverage detected