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

Function deriveGpuSelection

vmm/ui/src/composables/useVmManager.ts:377–388  ·  view source on GitHub ↗
(gpuConfig?: VmmTypes.IGpuConfig)

Source from the content-addressed store, hash-verified

375 }));
376
377 function deriveGpuSelection(gpuConfig?: VmmTypes.IGpuConfig) {
378 if (!gpuConfig) {
379 return { attachAll: false, selected: [] as string[] };
380 }
381 if (gpuConfig.attach_mode === 'all') {
382 return { attachAll: true, selected: [] as string[] };
383 }
384 return {
385 attachAll: false,
386 selected: (gpuConfig.gpus || []).map((gpu) => gpu.slot).filter(Boolean) as string[],
387 };
388 }
389
390 function recordError(context: string, err: unknown) {
391 console.error(context, err);

Callers 1

showUpdateDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected