MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / get_gpu_info

Function get_gpu_info

fastdeploy/collect_env.py:200–212  ·  view source on GitHub ↗
(run_lambda)

Source from the content-addressed store, hash-verified

198
199
200def get_gpu_info(run_lambda):
201 if get_platform() == "darwin":
202 if TORCH_AVAILABLE and torch.cuda.is_available():
203 gcnArch = ""
204 return torch.cuda.get_device_name(None) + gcnArch
205 return None
206 smi = get_nvidia_smi()
207 uuid_regex = re.compile(r" \(UUID: .+?\)")
208 rc, out, _ = run_lambda(smi + " -L")
209 if rc != 0:
210 return None
211 # Anonymize GPUs by removing their UUID
212 return re.sub(uuid_regex, "", out)
213
214
215def get_running_cuda_version(run_lambda):

Callers 1

get_env_infoFunction · 0.85

Calls 3

get_platformFunction · 0.85
get_nvidia_smiFunction · 0.85
subMethod · 0.80

Tested by

no test coverage detected