(serverId?: string)
| 157 | }; |
| 158 | |
| 159 | const checkGpuInfo = async (serverId?: string) => { |
| 160 | let gpuModel: string | undefined; |
| 161 | let memoryInfo: string | undefined; |
| 162 | |
| 163 | try { |
| 164 | const gpuInfoCommand = |
| 165 | "nvidia-smi --query-gpu=gpu_name,memory.total --format=csv,noheader"; |
| 166 | const { stdout: gpuInfo } = serverId |
| 167 | ? await execAsyncRemote(serverId, gpuInfoCommand) |
| 168 | : await execAsync(gpuInfoCommand); |
| 169 | |
| 170 | [gpuModel, memoryInfo] = gpuInfo.split(",").map((s) => s.trim()); |
| 171 | } catch (error) { |
| 172 | console.debug("GPU info check:", error); |
| 173 | } |
| 174 | |
| 175 | return { gpuModel, memoryInfo }; |
| 176 | }; |
| 177 | |
| 178 | const checkCudaSupport = async (serverId?: string) => { |
| 179 | let cudaVersion: string | undefined; |
no test coverage detected