MCPcopy Create free account
hub / github.com/InternLM/InternBootcamp / check_cuda_versions

Function check_cuda_versions

verl/scripts/diagnose.py:187–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185
186
187def check_cuda_versions():
188 if torch.cuda.is_available():
189 try:
190 cuda_runtime_version = torch.version.cuda
191 print(f"CUDA Runtime : {cuda_runtime_version}")
192 import subprocess
193
194 nvcc_output = subprocess.check_output(["nvcc", "--version"]).decode("utf-8")
195 cuda_compiler_version = next((line for line in nvcc_output.splitlines() if "release" in line), None)
196 if cuda_compiler_version:
197 print(f"CUDA Compiler : {cuda_compiler_version.strip()}")
198 else:
199 print("Could not determine CUDA compiler version.")
200 except FileNotFoundError as e:
201 print(f"CUDA compiler : Not found: {e}")
202 except Exception as e:
203 print(f"An error occurred while checking CUDA versions: {e}")
204 else:
205 print("CUDA is not available.")
206
207
208def _get_cpu_memory():

Callers 1

diagnose.pyFile · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected