Skip to content
Draft
Show file tree
Hide file tree
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
16 changes: 12 additions & 4 deletions install_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,18 @@ def determine_torch_url(torch_nightly_url_base, supported_cuda_versions):
URL string for PyTorch packages
"""
if platform.system().lower() == "windows":
print(
"Windows detected, using CPU-only PyTorch until CUDA support is available"
)
return f"{torch_nightly_url_base}/cpu"
# Try CUDA detection on Windows as well
print("Windows detected, attempting CUDA detection...")
try:
cuda_version = _get_cuda_version(supported_cuda_versions)
major, minor = cuda_version
print(f"Detected CUDA version: {major}.{minor}")
torch_url = _get_pytorch_cuda_url(cuda_version, torch_nightly_url_base)
print(f"Using PyTorch URL: {torch_url}")
return torch_url
except Exception as err:
print(f"CUDA detection failed ({err}), using CPU-only PyTorch")
return f"{torch_nightly_url_base}/cpu"

print("Attempting to detect CUDA via nvcc...")

Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,14 @@ def run(self): # noqa C901
f"-DCMAKE_BUILD_TYPE={cmake_build_type}",
]

# Use ClangCL on Windows.
# Use ClangCL on Windows, but not when building with CUDA
# (CUDA 12.x MSBuild targets have compatibility issues with ClangCL)
if _is_windows():
cmake_configuration_args += ["-T ClangCL"]
# Check if CUDA build is enabled via CMAKE_ARGS environment variable
cmake_args_env = os.environ.get("CMAKE_ARGS", "")
cuda_enabled = "EXECUTORCH_BUILD_CUDA=ON" in cmake_args_env
if not cuda_enabled:
cmake_configuration_args += ["-T ClangCL"]

# Allow adding extra cmake args through the environment. Used by some
# tests and demos to expand the set of targets included in the pip
Expand Down
2 changes: 1 addition & 1 deletion torch_pin.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TORCH_VERSION = "2.10.0"
NIGHTLY_VERSION = "dev20251120"
NIGHTLY_VERSION = "dev20251016"
Loading