Skip to content

Fix Windows CUDA 12.9 SM120 compilation - #32114

Merged
Hariharan Seshadri (hariharans29) merged 2 commits into
mainfrom
copilot/build-issue-fix-windows-cuda
Aug 24, 2026
Merged

Hariharan Seshadri (hariharans29) merged 2 commits into
mainfrom
copilot/build-issue-fix-windows-cuda

Conversation

Copilot AI commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Description

  • CUDA header workaround
    • Shadow CUDA 12.9’s generated clusterlaunchcontrol.h for MSVC builds.
    • Replace invalid 32-bit long2 PTX operands with upstream-correct longlong2.
  • Scope
    • Applies only to MSVC with CUDA 12.9.
    • Preserves native SM120 compilation and becomes a no-op for corrected headers.

Motivation and Context

CUDA 12.9’s clusterlaunchcontrol.h uses Windows’ 32-bit long for PTX operands requiring 64 bits. This causes widespread .cu compilation failures when targeting SM120 on Windows, while Linux builds succeed.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build failure of ONNX Runtime 1.26.0 on Windows with CUDA 12.9 Fix Windows CUDA 12.9 SM120 compilation Aug 16, 2026
@tianleiwu
Tianlei Wu (tianleiwu) marked this pull request as ready for review August 23, 2026 04:36
Copilot AI balanced review requested due to automatic review settings August 23, 2026 04:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Windows CUDA 12.9 compilation for SM120 by shadowing the faulty toolkit header with a generated corrected copy.

Changes:

  • Adds a CMake helper replacing invalid long2 PTX operand casts with longlong2.
  • Applies the workaround only for MSVC and CUDA 12.9.x.
  • Removes stale shadow headers when the installed toolkit no longer needs correction.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmake/external/cuda_configuration.cmake Adds the header-patching helper.
cmake/CMakeLists.txt Activates and prioritizes the CUDA 12.9 workaround on MSVC.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@hariharans29
Hariharan Seshadri (hariharans29) merged commit 939e180 into main Aug 24, 2026
88 checks passed
@hariharans29
Hariharan Seshadri (hariharans29) deleted the copilot/build-issue-fix-windows-cuda branch August 24, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Build] Build of 1.26.0 fails on Windows with CUDA 12.9 and sm_120

4 participants