Unverified Commit 50689f6a authored by mcarilli's avatar mcarilli Committed by GitHub
Browse files

Hard error on Pytorch Cuda + Cuda toolkit version mismatch (#323)

parent ccffa71c
......@@ -47,10 +47,9 @@ def check_cuda_torch_binary_vs_bare_metal(cuda_dir):
print(raw_output + "from " + cuda_dir + "/bin\n")
if (bare_metal_major != torch_binary_major) or (bare_metal_minor != torch_binary_minor):
# TODO: make this a hard error?
print("\nWarning: Cuda extensions are being compiled with a version of Cuda that does "
"not match the version used to compile Pytorch binaries.\n")
print("Pytorch binaries were compiled with Cuda {}\n".format(torch.version.cuda))
raise RuntimeError("Cuda extensions are being compiled with a version of Cuda that does "
"not match the version used to compile Pytorch binaries. "
"Pytorch binaries were compiled with Cuda {}.\n".format(torch.version.cuda))
if "--cuda_ext" in sys.argv:
from torch.utils.cpp_extension import CUDAExtension
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment