MCPcopy
hub / github.com/deepspeedai/DeepSpeed / installed_cuda_version

Function installed_cuda_version

op_builder/builder.py:47–59  ·  view source on GitHub ↗
(name="")

Source from the content-addressed store, hash-verified

45
46
47def 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
62def get_default_compute_capabilities():

Callers 12

setup.pyFile · 0.90
is_compatibleMethod · 0.85
is_compatibleMethod · 0.85
is_compatibleMethod · 0.85
is_compatibleMethod · 0.85
assert_no_cuda_mismatchFunction · 0.85
nvcc_argsMethod · 0.85
is_compatibleMethod · 0.85
is_compatibleMethod · 0.85
is_compatibleMethod · 0.85
is_compatibleMethod · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…