(&self, f: &mut fmt::Formatter<'_>)
| 266 | |
| 267 | impl fmt::Display for CdiGpuSelectionError { |
| 268 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 269 | match self { |
| 270 | Self::NoAvailableDevices => f.write_str("no NVIDIA CDI GPU devices were discovered"), |
| 271 | Self::AllDevicesDefaultUnsupported => f.write_str( |
| 272 | "default GPU request resolved only to nvidia.com/gpu=all, which is not allowed on this platform; set driver_config.cdi_devices to [\"nvidia.com/gpu=all\"] explicitly to request all GPUs", |
| 273 | ), |
| 274 | Self::InsufficientDevices { |
| 275 | requested, |
| 276 | available: 0, |
| 277 | } => write!( |
| 278 | f, |
| 279 | "GPU sandbox requested {requested} GPUs, but no selectable NVIDIA CDI GPU devices are available" |
| 280 | ), |
| 281 | Self::InsufficientDevices { |
| 282 | requested, |
| 283 | available: 1, |
| 284 | } => write!( |
| 285 | f, |
| 286 | "GPU sandbox requested {requested} GPUs, but only 1 selectable NVIDIA CDI GPU device is available" |
| 287 | ), |
| 288 | Self::InsufficientDevices { |
| 289 | requested, |
| 290 | available, |
| 291 | } => write!( |
| 292 | f, |
| 293 | "GPU sandbox requested {requested} GPUs, but only {available} selectable NVIDIA CDI GPU devices are available" |
| 294 | ), |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | impl std::error::Error for CdiGpuSelectionError {} |
nothing calls this directly
no outgoing calls
no test coverage detected