(serverId?: string)
| 16 | } |
| 17 | |
| 18 | export async function checkGPUStatus(serverId?: string): Promise<GPUInfo> { |
| 19 | try { |
| 20 | const [driverInfo, runtimeInfo, swarmInfo, gpuInfo, cudaInfo] = |
| 21 | await Promise.all([ |
| 22 | checkGpuDriver(serverId), |
| 23 | checkRuntime(serverId), |
| 24 | checkSwarmResources(serverId), |
| 25 | checkGpuInfo(serverId), |
| 26 | checkCudaSupport(serverId), |
| 27 | ]); |
| 28 | |
| 29 | return { |
| 30 | ...driverInfo, |
| 31 | ...runtimeInfo, |
| 32 | ...swarmInfo, |
| 33 | ...gpuInfo, |
| 34 | ...cudaInfo, |
| 35 | }; |
| 36 | } catch { |
| 37 | return { |
| 38 | driverInstalled: false, |
| 39 | driverVersion: undefined, |
| 40 | runtimeInstalled: false, |
| 41 | runtimeConfigured: false, |
| 42 | cudaSupport: false, |
| 43 | cudaVersion: undefined, |
| 44 | gpuModel: undefined, |
| 45 | memoryInfo: undefined, |
| 46 | availableGPUs: 0, |
| 47 | swarmEnabled: false, |
| 48 | gpuResources: 0, |
| 49 | }; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | const checkGpuDriver = async (serverId?: string) => { |
| 54 | let driverVersion: string | undefined; |
no test coverage detected