MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / list_gpus

Method list_gpus

vmm/src/app.rs:1030–1048  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

list_devicesMethod · 0.80
cloneMethod · 0.80
full_product_idMethod · 0.80
in_useMethod · 0.80

Tested by

no test coverage detected