Skip to content

[Build] CMake configuration fails with CUDA when setting CMAKE_CUDA_ARCHITECTURES=75-virtual #32436

Description

@davidrohr

Describe the issue

The CMake configuration fails when I set the CMake option -DCMAKE_CUDA_ARCHITECTURES=75-virtual.
I believe the problem is when setting directly and only a virtual architecture. E.g., 75 works, and 120-real;75-virtual works as well.
But 75-virtual gets translated internally by ONNXRuntime to 75-virtual-real;75-virtual, where 75-virtual-real is obviously bogus.

Urgency

No response

Target platform

alma linux 10

Build script

cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/home/qon/docker/sw/INSTALLROOT/a3b4a10c4d93e9fbca56c4a3715b401f31384a0c/slc10_x86-64/ONNXRuntime/v1.29.0-local5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib -DPython_EXECUTABLE=/home/qon/docker/sw/slc10_x86-64/Python-modules/1.0-local12/bin/python3 -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_QUIET=OFF -DCMAKE_POLICY_DEFAULT_CMP0170=NEW -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-undefined,dynamic_lookup -DCMAKE_EXE_LINKER_FLAGS=-Wl,-undefined,dynamic_lookup -Dsafeint_SOURCE_DIR=/home/qon/docker/sw/slc10_x86-64/safe_int/v3.0.28a-local1/include -Deigen_SOURCE_PATH=/home/qon/docker/sw/slc10_x86-64/Eigen3/3.4.0-onnx1-local1/include/eigen3 -DCMAKE_IGNORE_PATH=/opt/homebrew/include -DGIT_EXECUTABLE=git is /home/qon/docker/sw/wrapper-scripts/git -Donnxruntime_BUILD_UNIT_TESTS=OFF -Donnxruntime_USE_PREINSTALLED_EIGEN=ON -Donnxruntime_BUILD_BENCHMARKS=OFF -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_USE_OPENMP=OFF -Donnxruntime_USE_TVM=OFF -Donnxruntime_USE_LLVM=OFF -Donnxruntime_ENABLE_DLPACK=OFF -Donnxruntime_USE_NUPHAR=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_TENSORRT=0 -Donnxruntime_TENSORRT_HOME=/usr -Donnxruntime_CROSS_COMPILING=OFF -Donnxruntime_DISABLE_CONTRIB_OPS=OFF -Donnxruntime_PREFER_SYSTEM_LIB=OFF -Donnxruntime_BUILD_SHARED_LIB=ON -Donnxruntime_USE_VCPKG=OFF -DProtobuf_USE_STATIC_LIBS=ON -Donnxruntime_ENABLE_TRAINING=OFF -Donnxruntime_USE_FULL_PROTOBUF=ON -Donnxruntime_ENABLE_PYTHON=OFF -Donnxruntime_MINIMAL_BUILD=OFF --debug-find-pkg=absl -DFETCHCONTENT_SOURCE_DIR_ABSEIL_CPP=/home/qon/docker/sw/slc10_x86-64/abseil/20250814.0-alice1-local1 -Dabseil_cpp_DIR=/home/qon/docker/sw/slc10_x86-64/abseil/20250814.0-alice1-local1 -Dabsl_DIR=/home/qon/docker/sw/slc10_x86-64/abseil/20250814.0-alice1-local1 -DProtobuf_LIBRARY=/home/qon/docker/sw/slc10_x86-64/protobuf/v31.1-local4/lib/libprotobuf.a -DProtobuf_LITE_LIBRARY=/home/qon/docker/sw/slc10_x86-64/protobuf/v31.1-local4/lib/libprotobuf-lite.a -DProtobuf_PROTOC_LIBRARY=/home/qon/docker/sw/slc10_x86-64/protobuf/v31.1-local4/lib/libprotoc.a -DProtobuf_INCLUDE_DIR=/home/qon/docker/sw/slc10_x86-64/protobuf/v31.1-local4/include -DONNX_CUSTOM_PROTOC_EXECUTABLE=/home/qon/docker/sw/slc10_x86-64/protobuf/v31.1-local4/bin/protoc -DRE2_INCLUDE_DIR=/home/qon/docker/sw/slc10_x86-64/re2/2024-07-02-local4/include -DBOOST_INCLUDE_DIR=/home/qon/docker/sw/slc10_x86-64/boost/v1.90.0-alice1-local5/include -DFETCHCONTENT_SOURCE_DIR_MP11=/home/qon/docker/sw/slc10_x86-64/boost/v1.90.0-alice1-local5 -Donnxruntime_USE_MIGRAPHX=1 -DAMD_MIGRAPHX_HOME=/home/qon/docker/sw/slc10_x86-64/ROCm/10.0-local2 -Donnxruntime_ROCM_HOME=/home/qon/docker/sw/slc10_x86-64/ROCm/10.0-local2 -Donnxruntime_CUDA_HOME=/home/qon/docker/sw/slc10_x86-64/CUDA/13.3.1_cudnn_9.25.1.1-local6 -DCMAKE_CUDA_COMPILER_FRONTEND_VARIANT=GCC -DCMAKE_HIP_COMPILER=/home/qon/docker/sw/slc10_x86-64/CUDA/13.3.1_cudnn_9.25.1.1-local6/llvm/bin/clang++ -DCMAKE_HIP_ARCHITECTURES=gfx906 -DCMAKE_CUDA_ARCHITECTURES=75-virtual -Donnxruntime_DISABLE_RTTI=OFF -DMSVC=OFF -Donnxruntime_USE_CUDA=1 -Donnxruntime_USE_CUDA_NHWC_OPS=1 -DFETCHCONTENT_SOURCE_DIR_CUDNN_FRONTEND=/home/qon/docker/sw/slc10_x86-64/cudnn_frontend/v1.24.0-local1 -DFETCHCONTENT_SOURCE_DIR_CUTLASS=/home/qon/docker/sw/slc10_x86-64/cutlass/v4.4.2-local1 -Donnxruntime_FUZZ_ENABLED=OFF -Donnxruntime_USE_FLASH_ATTENTION=OFF -Donnxruntime_USE_LEAN_ATTENTION=OFF -Donnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=ON '-DCMAKE_CUDA_FLAGS=-fPIC -O2 -std=c++20 -isystem /home/qon/docker/sw/slc10_x86-64/ROCm/10.0-local2/include -Wno-error=deprecated-enum-float-conversion -Wno-error -Wno-error=missing-requires -w' '-DCMAKE_HIP_FLAGS=-fPIC -O2 -std=c++20 -isystem /home/qon/docker/sw/slc10_x86-64/ROCm/10.0-local2/include -Wno-error=deprecated-enum-float-conversion -Wno-error -Wno-error=missing-requires -w' '-DCMAKE_CXX_FLAGS=-fPIC -O2 -std=c++20 -isystem /home/qon/docker/sw/slc10_x86-64/ROCm/10.0-local2/include -Wno-unknown-warning -Wno-unknown-warning-option -Wno-pass-failed -Wno-error=unused-but-set-variable -Wno-pass-failed=transform-warning -Wno-error=deprecated -Wno-error=maybe-uninitialized -Wno-error=deprecated-enum-enum-conversion -Wno-error -Wno-error=missing-requires -w' '-DCMAKE_C_FLAGS=-fPIC -O2 -Wno-unknown-warning -Wno-unknown-warning-option -Wno-pass-failed -Wno-error=unused-but-set-variable -Wno-pass-failed=transform-warning -Wno-error=deprecated -Wno-error=maybe-uninitialized -Wno-error=deprecated-enum-enum-conversion -Wno-error -Wno-error=missing-requires -w'

Error / output

2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0: -- CMAKE_CUDA_ARCHITECTURES: 75-virtual-real;75-virtual
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0: CMake Error at /home/qon/docker/sw/slc10_x86-64/CMake/v4.1.4-local1/share/cmake-4.1/Modules/Internal/CMakeCUDAArchitecturesValidate.cmake:9 (message):
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0:   CMAKE_CUDA_ARCHITECTURES:
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0: 
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0:     75-virtual-real;75-virtual
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0: 
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0:   is not one of the following:
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0: 
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0:     * a semicolon-separated list of integers, each optionally
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0:       followed by '-real' or '-virtual'
2026-09-04@11:59:57:DEBUG:ONNXRuntime:ONNXRuntime:v1.29.0:     * a special value: all, all-major, native

Visual Studio Version

No response

GCC / Compiler Version

GCC 14.2 / CUDA 13.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildbuild issues; typically submitted using templateep:CUDAissues related to the CUDA execution provider

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions