Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
SUPPORTED_ARCHS = {"8.0", "8.6", "8.9", "9.0", "12.0"}

# Compiler flags.
TORCH_CUDA_ARCH_LIST = os.environ.get("TORCH_CUDA_ARCH_LIST", "")
CXX_FLAGS = ["-g", "-O3", "-fopenmp", "-lgomp", "-std=c++17", "-DENABLE_BF16"]
NVCC_FLAGS = [
"-O3",
Expand Down Expand Up @@ -76,6 +77,9 @@ def get_nvcc_cuda_version(cuda_dir: str) -> Version:
continue
compute_capabilities.add(f"{major}.{minor}")

if TORCH_CUDA_ARCH_LIST:
compute_capabilities = set(TORCH_CUDA_ARCH_LIST.split(","))

nvcc_cuda_version = get_nvcc_cuda_version(CUDA_HOME)
if not compute_capabilities:
raise RuntimeError("No GPUs found. Please specify the target GPU architectures or build on a machine with GPUs.")
Expand Down