解决办法
注释掉setup.py代码中的第108行,cuda版本检验,这样编译就可以了
if "--cuda_ext" in sys.argv:
from torch.utils.cpp_extension import CUDAExtension
sys.argv.remove("--cuda_ext")
if torch.utils.cpp_extension.CUDA_HOME is None:
raise RuntimeError("--cuda_ext was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.")
else:
# 注释掉这句
# check_cuda_torch_binary_vs_bare_metal(torch.utils.cpp_extension.CUDA_HOME)