(run_lambda)
| 198 | |
| 199 | |
| 200 | def 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 | |
| 215 | def get_running_cuda_version(run_lambda): |
no test coverage detected