Skip to content

Commit

Permalink
Hard error on Pytorch Cuda + Cuda toolkit version mismatch (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarilli authored May 22, 2019
1 parent ccffa71 commit 50689f6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 50689f6

Please sign in to comment.