(&self)
| 1028 | } |
| 1029 | |
| 1030 | pub(crate) async fn list_gpus(&self) -> Result<Vec<GpuInfo>> { |
| 1031 | if !self.config.cvm.gpu.enabled { |
| 1032 | return Ok(Vec::new()); |
| 1033 | } |
| 1034 | let gpus = self |
| 1035 | .config |
| 1036 | .cvm |
| 1037 | .gpu |
| 1038 | .list_devices()? |
| 1039 | .iter() |
| 1040 | .map(|dev| GpuInfo { |
| 1041 | slot: dev.slot.clone(), |
| 1042 | product_id: dev.full_product_id().clone(), |
| 1043 | description: dev.description.clone(), |
| 1044 | is_free: !dev.in_use(), |
| 1045 | }) |
| 1046 | .collect(); |
| 1047 | Ok(gpus) |
| 1048 | } |
| 1049 | |
| 1050 | pub(crate) async fn try_restart_exited_vms(&self) -> Result<()> { |
| 1051 | let running_vms = self |
nothing calls this directly
no test coverage detected