(name="")
| 45 | |
| 46 | |
| 47 | def installed_cuda_version(name=""): |
| 48 | import torch.utils.cpp_extension |
| 49 | cuda_home = torch.utils.cpp_extension.CUDA_HOME |
| 50 | if cuda_home is None: |
| 51 | raise MissingCUDAException("CUDA_HOME does not exist, unable to compile CUDA op(s)") |
| 52 | # Ensure there is not a cuda version mismatch between torch and nvcc compiler |
| 53 | output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True) |
| 54 | output_split = output.split() |
| 55 | release_idx = output_split.index("release") |
| 56 | release = output_split[release_idx + 1].replace(',', '').split(".") |
| 57 | # Ignore patch versions, only look at major + minor |
| 58 | cuda_major, cuda_minor = release[:2] |
| 59 | return int(cuda_major), int(cuda_minor) |
| 60 | |
| 61 | |
| 62 | def get_default_compute_capabilities(): |
no test coverage detected
searching dependent graphs…