Skip to content

Support request for latest CUDA + Python + Torch #262

Description

@manchuwook

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:

  1. Dependency Generation Flags: The combination of --generate-dependencies-with-compile and --dependency-output with other flags causes parsing conflicts
  2. Command Structure: NVCC 13.0 is more strict about flag ordering and combinations
  3. 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:

  1. Environment variables (USE_NINJA=0, DISTUTILS_USE_SDK=1)
  2. PyTorch cpp_extension patching
  3. Real-time ninja file modification
  4. Direct setup.py compilation approaches

None successfully resolve the core NVCC command-line parsing issue.

Proposed Solutions

Short-term

  1. Pre-built Wheels: Provide CUDA 13.0 Windows wheels for major Python versions (3.11, 3.12, 3.13)
  2. Build Instructions: Document CUDA 12.8 as the recommended version for Windows compilation
  3. Alternative Toolchain: Investigate MSBuild instead of ninja for Windows CUDA 13.0

Long-term

  1. NVCC Compatibility: Work with NVIDIA and PyTorch teams to resolve command-line generation
  2. Build System Updates: Modify build scripts to generate CUDA 13.0-compatible commands
  3. Conditional Compilation: Detect CUDA version and adjust build flags accordingly

Workaround for Users

Current recommended approach for RTX 5090 users:

  1. Use CUDA 12.8 instead of 13.0 (performance impact is minimal)
  2. Install available pre-built wheels when possible
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions