Fix build failure when both CUDA and MiGraphX execution providers are enabled#27798
Merged
Fix build failure when both CUDA and MiGraphX execution providers are enabled#27798
Conversation
…h CUDA and MiGraphX Move arena_extend_strategy variable definition and extern declaration from separate CUDA-only and MiGraphX-only preprocessor blocks into a combined block: #if defined(USE_MIGRAPHX) || defined(USE_CUDA) || defined(USE_CUDA_PROVIDER_INTERFACE) This fixes a redefinition error when building with both --use_cuda and --use_migraphx enabled. Fixes #25193 Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/onnxruntime/sessions/6edbd6b9-8180-470c-baa7-1c7947f7803a
Copilot
AI
changed the title
[WIP] Fix build issue with cuda and migraphx
Fix build failure when both CUDA and MiGraphX execution providers are enabled
Mar 21, 2026
Contributor
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
tianleiwu
approved these changes
Mar 21, 2026
apsonawane
approved these changes
Apr 7, 2026
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
arena_extend_strategywas defined in separate#if defined(USE_CUDA)and#if defined(USE_MIGRAPHX)preprocessor blocks, causing a redefinition error when both providers are enabled.Consolidates the definition and extern declaration into a single combined guard:
Both files updated:
onnxruntime/python/onnxruntime_pybind_state_common.cc— variable definitiononnxruntime/python/onnxruntime_pybind_state_common.h— extern declarationNo other duplicate symbols found across CUDA/MiGraphX conditional blocks.
Motivation and Context
Building with
--use_cuda --use_migraphxfails with:Both providers share this config variable; it just needs a unified guard.
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.