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.txt — cuda_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)
Environment
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.cmakemissing Blackwellcuda_select_nvcc_arch_flagshas 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.txt—cuda_select_nvcc_arch_flagsdoesn't accept12.0Even after patching the cmake file, the dotted version regex only matches single
digits (e.g.
8.6), so12.0falls through to the unknown-arch error.Fix: bypass
cuda_select_nvcc_arch_flagsentirely and hardcode: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=17at build time,or update
CMakeLists.txtto set these when CUDA >= 12.4.
thrust::unary_functionremoved in Thrust 2.xsrc/simulators/statevector/chunk/thrust_kernels.hppinherits fromthrust::unary_functionandthrust::binary_function, which were removedin Thrust 2.x (bundled with CUDA 12+).
Fix: add a compatibility shim after
#include "misc/wrap_thrust.hpp":Suggested fix
select_compute_arch.cmakethrust::unary_functionwith a bundled shim orstd::equivalentFindCUDAmodule with modernfind_package(CUDAToolkit)