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

Function checkCudaSupport

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

Source from the content-addressed store, hash-verified

176};
177
178const checkCudaSupport = async (serverId?: string) => {
179 let cudaVersion: string | undefined;
180 let cudaSupport = false;
181
182 try {
183 const cudaCommand = 'nvidia-smi -q | grep "CUDA Version"';
184 const { stdout: cudaInfo } = serverId
185 ? await execAsyncRemote(serverId, cudaCommand)
186 : await execAsync(cudaCommand);
187
188 const cudaMatch = cudaInfo.match(/CUDA Version\s*:\s*([\d.]+)/);
189 cudaVersion = cudaMatch ? cudaMatch[1] : undefined;
190 cudaSupport = !!cudaVersion;
191 } catch (error) {
192 console.debug("CUDA support check:", error);
193 }
194
195 return { cudaVersion, cudaSupport };
196};
197
198export async function setupGPUSupport(serverId?: string): Promise<void> {
199 try {

Callers 1

checkGPUStatusFunction · 0.85

Calls 2

execAsyncRemoteFunction · 0.90
execAsyncFunction · 0.90

Tested by

no test coverage detected