Open lcp29 opened 7 months ago
@lcp29 Thanks for reporting it! Do you mind opening a PR to fix it?
@ashawkey I'm sorry. It seems that nvcc
is not in my path and there is already relevant code in setup.py
:
cpp_standard = 14
# Get CUDA version and make sure the targeted compute capability is compatible
if os.system("nvcc --version") == 0:
nvcc_out = subprocess.check_output(["nvcc", "--version"]).decode()
cuda_version = re.search(r"release (\S+),", nvcc_out)
if cuda_version:
cuda_version = parse_version(cuda_version.group(1))
print(f"Detected CUDA version {cuda_version}")
if cuda_version >= parse_version("11.0"):
cpp_standard = 17
I added a nvcc_try_paths
for such case.
By the way they have updated C++ standard in ATen since PyTorch 2.1.0.
pytorch/pytorch@bcb4444c
Oh I didn't notice that too. In that case this sounds not a reasonable idea, since we assume nvcc
can be found in PATH. Maybe we can delete the whole if
statement and directly change cpp_standard = 17
.
How about we use torch.__version__
? Users with cuda<11 will be unable to build it in c++17.
It doesn't seem very different from current nvcc version... maybe like this:
from packaging import version
if version(torch.__version__) > version("2.1.0"):
cpp_standard = 17
elif os.system("nvcc --version") == 0:
....
A version of PyTorch (mine is torch2.1.2+cu121) requires C++ 17 for its compliation. Directly running
results in the errors including:
After the following patch applied cuBVH was installed successfully:
and functioned as normal.