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

Function discovered_cdi_gpu_device_ids

e2e/rust/tests/gpu/device_selection.rs:182–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180}
181
182fn discovered_cdi_gpu_device_ids() -> Vec<String> {
183 let engine = container_engine();
184 if uses_local_podman_inventory(&engine) {
185 let device_ids = local_podman_cdi_gpu_device_ids();
186 assert!(
187 !device_ids.is_empty(),
188 "local Podman GPU e2e tests require /dev/nvidiaN device nodes or \
189/dev/dxg so bare --gpu can be mapped to a supported NVIDIA CDI device"
190 );
191 return device_ids;
192 }
193
194 let info = container_engine_info(&engine);
195 let device_ids = parse_cdi_gpu_device_ids(&info);
196 assert!(
197 !device_ids.is_empty(),
198 "{} info --format json did not report any discovered NVIDIA CDI GPU devices. \
199Expected DiscoveredDevices entries with Source=cdi and ID like nvidia.com/gpu=0.",
200 engine.name()
201 );
202 device_ids
203}
204
205fn default_cdi_gpu_device_id(device_ids: &[String], allow_all_devices: bool) -> Option<String> {
206 let mut indexed = device_ids

Calls 5

container_engineFunction · 0.85
container_engine_infoFunction · 0.85
parse_cdi_gpu_device_idsFunction · 0.85

Tested by

no test coverage detected