Skip to content

Add CACHE when unsetting CMAKE_CUDA_ARCHITECTURES to ensure it's empty#28019

Open
jmcarcell wants to merge 1 commit intomicrosoft:mainfrom
jmcarcell:fix-cuda-all
Open

Add CACHE when unsetting CMAKE_CUDA_ARCHITECTURES to ensure it's empty#28019
jmcarcell wants to merge 1 commit intomicrosoft:mainfrom
jmcarcell:fix-cuda-all

Conversation

@jmcarcell
Copy link
Copy Markdown

@jmcarcell jmcarcell commented Apr 9, 2026

Description

Add CACHE when unsetting CMAKE_CUDA_ARCHITECTURES to ensure it's empty.

Motivation and Context

Recently, when building passing CMAKE_CUDA_ARCHITECTURES=all configuring fails because CMAKE_CUDA_ARCHITECTURES is not being correctly unsetted and then set to the curated list of architectures.
Error message:

-- Setting CMAKE_CUDA_ARCHITECTURES to all enables a list of architectures OnnxRuntime optimized for, not all architectures CUDA compiler supports.
CMake Error at external/cuda_configuration.cmake:154 (message):
  Unrecognized CUDA architecture: all
Call Stack (most recent call first):
  CMakeLists.txt:715 (setup_cuda_architectures)


-- Configuring incomplete, errors occurred!

I got this error both on Alma 9 and Ubuntu 24.04 and after this change the build starts to compile.

Recently, when building passing `CMAKE_CUDA_ARCHITECTURES=all` fails
because `CMAKE_CUDA_ARCHITECTURES` is not being correctly unsetted and
then set to the curated list of architectures.
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.

1 participant