MCPcopy
hub / github.com/Dokploy/dokploy / checkGpuInfo

Function checkGpuInfo

packages/server/src/utils/gpu-setup.ts:159–176  ·  view source on GitHub ↗
(serverId?: string)

Source from the content-addressed store, hash-verified

157};
158
159const 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
178const checkCudaSupport = async (serverId?: string) => {
179 let cudaVersion: string | undefined;

Callers 1

checkGPUStatusFunction · 0.85

Calls 2

execAsyncRemoteFunction · 0.90
execAsyncFunction · 0.90

Tested by

no test coverage detected