CUDA 13.0 Compilation Compatibility Issue on Windows
Subject
[Windows] NVCC 13.0 Compilation Fails with "A single input file is required for a non-link phase when an outputfile is specified"
Environment
- OS: Windows 11
- GPU: NVIDIA GeForce RTX 5090 (Blackwell, sm_120)
- CUDA: 13.0
- Python: 3.13
- PyTorch: 2.9.0.dev20250909+cu130 (nightly)
- Visual Studio: 2022 Community (14.44.35207)
Issue Description
SageAttention compilation fails on Windows with CUDA 13.0 due to NVCC's stricter command-line parsing introduced in CUDA 13.0. The error occurs during ninja build execution:
nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified
The problematic command generated by PyTorch's build system includes flags that NVCC 13.0 cannot properly parse:
nvcc --generate-dependencies-with-compile --dependency-output [path].obj.d [other flags] -c file.cu -o output.obj
Root Cause Analysis
NVIDIA made changes to NVCC's command-line parser in CUDA 13.0 that conflict with how PyTorch's ninja build system constructs compilation commands. Specifically:
- Dependency Generation Flags: The combination of
--generate-dependencies-with-compile and --dependency-output with other flags causes parsing conflicts
- Command Structure: NVCC 13.0 is more strict about flag ordering and combinations
- Windows-Specific: This issue appears to be Windows-specific due to path handling and flag escaping differences
Impact
This affects users with:
- RTX 50xx series GPUs (requiring CUDA 12.8+ for sm_120 support)
- CUDA 13.0 installations
- Windows development environments
- Cutting-edge PyTorch nightly builds
Many RTX 5090 users require CUDA 13.0 for optimal performance and compatibility.
Attempted Solutions
We've tried several workarounds:
- Environment variables (
USE_NINJA=0, DISTUTILS_USE_SDK=1)
- PyTorch cpp_extension patching
- Real-time ninja file modification
- Direct setup.py compilation approaches
None successfully resolve the core NVCC command-line parsing issue.
Proposed Solutions
Short-term
- Pre-built Wheels: Provide CUDA 13.0 Windows wheels for major Python versions (3.11, 3.12, 3.13)
- Build Instructions: Document CUDA 12.8 as the recommended version for Windows compilation
- Alternative Toolchain: Investigate MSBuild instead of ninja for Windows CUDA 13.0
Long-term
- NVCC Compatibility: Work with NVIDIA and PyTorch teams to resolve command-line generation
- Build System Updates: Modify build scripts to generate CUDA 13.0-compatible commands
- Conditional Compilation: Detect CUDA version and adjust build flags accordingly
Workaround for Users
Current recommended approach for RTX 5090 users:
- Use CUDA 12.8 instead of 13.0 (performance impact is minimal)
- Install available pre-built wheels when possible
- Use SageAttention 1.0 (Triton-only) as fallback:
pip install sageattention==1.0.6
Additional Context
This issue affects the broader PyTorch ecosystem, not just SageAttention. Similar reports exist for other CUDA extensions on Windows with CUDA 13.0. The issue appears to be a compatibility gap that will likely require coordination between multiple teams (NVIDIA, PyTorch, extension maintainers).
We appreciate the work on SageAttention and understand this is a broader ecosystem challenge. Any guidance or timeline for CUDA 13.0 Windows support would be helpful for the community.
System Information
PyTorch: 2.9.0.dev20250909+cu130
CUDA available: True
CUDA version: 13.0
Device name: NVIDIA GeForce RTX 5090
Compute Capability: (12, 0)
CUDA 13.0 Compilation Compatibility Issue on Windows
Subject
[Windows] NVCC 13.0 Compilation Fails with "A single input file is required for a non-link phase when an outputfile is specified"
Environment
Issue Description
SageAttention compilation fails on Windows with CUDA 13.0 due to NVCC's stricter command-line parsing introduced in CUDA 13.0. The error occurs during ninja build execution:
The problematic command generated by PyTorch's build system includes flags that NVCC 13.0 cannot properly parse:
Root Cause Analysis
NVIDIA made changes to NVCC's command-line parser in CUDA 13.0 that conflict with how PyTorch's ninja build system constructs compilation commands. Specifically:
--generate-dependencies-with-compileand--dependency-outputwith other flags causes parsing conflictsImpact
This affects users with:
Many RTX 5090 users require CUDA 13.0 for optimal performance and compatibility.
Attempted Solutions
We've tried several workarounds:
USE_NINJA=0,DISTUTILS_USE_SDK=1)None successfully resolve the core NVCC command-line parsing issue.
Proposed Solutions
Short-term
Long-term
Workaround for Users
Current recommended approach for RTX 5090 users:
pip install sageattention==1.0.6Additional Context
This issue affects the broader PyTorch ecosystem, not just SageAttention. Similar reports exist for other CUDA extensions on Windows with CUDA 13.0. The issue appears to be a compatibility gap that will likely require coordination between multiple teams (NVIDIA, PyTorch, extension maintainers).
We appreciate the work on SageAttention and understand this is a broader ecosystem challenge. Any guidance or timeline for CUDA 13.0 Windows support would be helpful for the community.
System Information