Skip to content

Build fails on NVIDIA Blackwell (sm_120, CC 12.0) with CUDA 13.2 — patches required #2415

Description

@dmeliksetian

Environment

  • GPU: NVIDIA RTX PRO 4500 Blackwell (Compute Capability 12.0)
  • Driver: 595.45.04
  • CUDA: 13.2
  • OS: Ubuntu (GCC 13.3.0)
  • Qiskit Aer: 0.17.2
  • Python: 3.12.3

Problem

Building qiskit-aer from source fails with four separate issues when targeting
NVIDIA Blackwell (sm_120 / CC 12.0) with CUDA 13.2. All are caused by the source
predating the Blackwell architecture and CUDA 13.x.

Failures and fixes

1. select_compute_arch.cmake missing Blackwell

cuda_select_nvcc_arch_flags has a hardcoded arch list that stops at Ampere (8.6).
Fix: add version blocks for Hopper (11.8), Ada (12.0), and Blackwell (12.8) to the
known arch list and the named-arch elseif chain.

2. CMakeLists.txtcuda_select_nvcc_arch_flags doesn't accept 12.0

Even after patching the cmake file, the dotted version regex only matches single
digits (e.g. 8.6), so 12.0 falls through to the unknown-arch error.
Fix: bypass cuda_select_nvcc_arch_flags entirely and hardcode:

set(AER_CUDA_ARCH_FLAGS "-gencode arch=compute_120,code=sm_120")
set(AER_CUDA_ARCHITECTURES "120")
set(CMAKE_CUDA_ARCHITECTURES "120")

3. C++14 incompatible with CUDA 13.2 Thrust/CCCL

CUDA 13.2 bundles Thrust/CCCL which requires C++17. Aer defaults to C++14.
Fix: pass -DCMAKE_CXX_STANDARD=17 -DCMAKE_CUDA_STANDARD=17 at build time,
or update CMakeLists.txt to set these when CUDA >= 12.

4. thrust::unary_function removed in Thrust 2.x

src/simulators/statevector/chunk/thrust_kernels.hpp inherits from
thrust::unary_function and thrust::binary_function, which were removed
in Thrust 2.x (bundled with CUDA 12+).
Fix: add a compatibility shim after #include "misc/wrap_thrust.hpp":

namespace thrust {
  template<typename Arg, typename Result>
  struct unary_function {
    typedef Arg argument_type;
    typedef Result result_type;
  };
  template<typename Arg1, typename Arg2, typename Result>
  struct binary_function {
    typedef Arg1 first_argument_type;
    typedef Arg2 second_argument_type;
    typedef Result result_type;
  };
}

Suggested fix

  • Update the minimum C++ standard to 17 when CUDA >= 12 is detected
  • Add Blackwell/Hopper/Ada to select_compute_arch.cmake
  • Replace thrust::unary_function with a bundled shim or std:: equivalent
  • Consider replacing the legacy FindCUDA module with modern find_package(CUDAToolkit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions