Fix Linux CUDA 13.3 build (abseil + CCCL parse errors)#29042
Open
tianleiwu wants to merge 4 commits into
Open
Conversation
This was referenced Jun 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores the Linux CUDA build on CUDA 13.3 by applying targeted workarounds for NVCC 13.x host-side parser regressions affecting Abseil container macros and CCCL (CUB) headers, integrated into both the FetchContent and vcpkg-overlay dependency paths.
Changes:
- Add an Abseil patch that introduces a top-level alias template (
IfRRefAddPtr) to avoid an NVCC 13.3 mis-parse ininsert_or_assign/try_emplacemacro code paths. - Apply the Abseil patch in both the vcpkg overlay port and the non-vcpkg FetchContent path.
- Add a CMake-time CCCL header rewrite step for CUDA >= 13.0 that generates fixed copies into the build tree and prepends them to the include path.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmake/vcpkg-ports/abseil/portfile.cmake | Adds the new Abseil patch to the vcpkg overlay port’s PATCHES list. |
| cmake/vcpkg-ports/abseil/absl_cuda13_member_template.patch | Introduces IfRRefAddPtr and rewrites Abseil container macro usage to avoid NVCC 13.3 parsing issues (vcpkg path). |
| cmake/patches/abseil/absl_cuda13_member_template.patch | Same Abseil workaround patch for the FetchContent/non-vcpkg path. |
| cmake/external/abseil-cpp.cmake | Extends ABSL_PATCH_COMMAND to apply the new Abseil patch during FetchContent. |
| cmake/onnxruntime_providers_cuda.cmake | Adds CCCL header patching (generate fixed headers + prepend include dir) for CUDA >= 13.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes two NVCC 13.3 (
cudafe++/ EDG front-end) parse regressions that break the Linux CUDA build of ONNX Runtime. Both are host-side parser bugs in the CUDA 13.3 toolkit that reject valid C++ which compiles fine on CUDA 13.2 and earlier.Abseil member alias template. NVCC 13.3 mis-parses the qualified-id
IfRRef<...>::AddPtr<Other>used inside abseil'sinsert_or_assign/try_emplacemacros, failing withusing template type parameter ... after 'typename'. A new patch introduces a top-level alias templateIfRRefAddPtr<T, Other>and routes the macros through it. Because it stays an alias template, substitution remains in the immediate context, so forming a pointer-to-reference is still a soft (SFINAE) failure rather than a hard error — the original behavior is preserved.CCCL global-qualified partial specializations.
<cub/device/device_transform.cuh>and<cub/device/dispatch/tuning/tuning_transform.cuh>declarestruct ::cuda::proclaims_copyable_arguments<...> : ::cuda::std::true_type {};at global scope, which NVCC 13.3 rejects withglobal qualification of class name is invalid before ':' token. Since the affected headers ship inside the (often read-only) CUDA toolkit, the build now generates corrected copies — rewriting the specializations into namespace-reopened form (_CCCL_BEGIN_NAMESPACE_CUDA ... _CCCL_END_NAMESPACE_CUDA) — into the build tree and places that directory ahead of the toolkit CCCL include path. The transform is a no-op on toolkits that do not contain the offending pattern, so it is safe to keep enabled across CUDA versions.Summary of changes
cmake/patches/abseil/absl_cuda13_member_template.patchIfRRefAddPtralias template and rewriting the abseil container macros to use it.cmake/vcpkg-ports/abseil/absl_cuda13_member_template.patchcmake/vcpkg-ports/abseil/portfile.cmakePATCHESlist.cmake/external/abseil-cpp.cmakecmake/onnxruntime_providers_cuda.cmakeort_cuda13_patch_cccl_header()and, for CUDA >= 13.0, generate fixed CCCL headers into the build tree and prepend that directory to the CUDA include path.Motivation and Context
The CUDA 13.3 toolkit introduced
cudafe++parser regressions that reject valid template code accepted by CUDA 13.2 and earlier, so the Linux CUDA build fails before producing any libraries. These workarounds restore the build on CUDA 13.3 while remaining no-ops on toolkits without the regressions, so existing CUDA versions are unaffected.How was this tested?
CMAKE_CUDA_ARCHITECTURES="89;90", Release) completes successfully and produces theonnxruntime_gpuwheel; the two previously-failing translation units (bias_softmax_impl.cuandmoe_kernel.cu) now compile.exit 0.