Skip to content

[CMAKE] Enable realtime cmake component in CUDA-Q#4709

Open
1tnguyen wants to merge 3 commits into
NVIDIA:mainfrom
1tnguyen:tnguyen/realtime-cmake
Open

[CMAKE] Enable realtime cmake component in CUDA-Q#4709
1tnguyen wants to merge 3 commits into
NVIDIA:mainfrom
1tnguyen:tnguyen/realtime-cmake

Conversation

@1tnguyen

Copy link
Copy Markdown
Collaborator
  • Added realtime to CUDAQ_ALL_PROJECTS. This is still disabled by default, -DCUDAQ_ENABLE_PROJECTS=...;realtime to enable. Once enabled, it will build realtime along the local simulator support for device_call's realtime dispatch.

  • Added source-tree cudaq::cudaq-realtime* aliases so that in-source builds use the same target names as installed realtime exports.

There are some other cmake fixes in test mainly to facilitate in-source build (-DCUDAQ_ENABLE_PROJECTS=...;realtime) under various build configurations (e.g., wheels/installers) of CUDA-Q.

Note: there will be a follow-up CI update to enable realtime in the main CUDA-Q CI.

1tnguyen and others added 2 commits June 9, 2026 23:59
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

CI Summary (push) — ✅ passed

Run #27246949100 · ✅ 6 · ⏩ 7 · ❌ 0 · ⛔ 0

Top-level jobs (13)
Job Result
binaries ⏩ skipped
build_and_test ✅ success
config_devdeps ✅ success
config_source_build ⏩ skipped
config_wheeldeps ✅ success
devdeps ✅ success
docker_image ⏩ skipped
gen_code_coverage ⏩ skipped
metadata ✅ success
python_metapackages ⏩ skipped
python_wheels ⏩ skipped
source_build ⏩ skipped
wheeldeps ✅ success
⏩ Skipped jobs (7) — intentionally skipped on PR builds; run on merge_group / workflow_dispatch
Job
binaries
config_source_build
docker_image
gen_code_coverage
python_metapackages
python_wheels
source_build
All sub-jobs (42) — every matrix leg, with links
Job Status Link
Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, gcc12, openmpi) / Dev environment (Python) ✅ success view
Build and test (amd64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, llvm, openmpi) / Dev environment (Python) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Python) ✅ success view
CI Summary ❔ in_progress view
Configure build (devdeps) ✅ success view
Configure build (source_build) ⏩ skipped view
Configure build (wheeldeps) ✅ success view
Create CUDA Quantum installer ⏩ skipped view
Create Docker images ⏩ skipped view
Create Python metapackages ⏩ skipped view
Create Python wheels ⏩ skipped view
Gen code coverage ⏩ skipped view
Load dependencies (amd64, gcc12) / Caching ✅ success view
Load dependencies (amd64, gcc12) / Finalize ✅ success view
Load dependencies (amd64, gcc12) / Metadata ✅ success view
Load dependencies (amd64, llvm) / Caching ✅ success view
Load dependencies (amd64, llvm) / Finalize ✅ success view
Load dependencies (amd64, llvm) / Metadata ✅ success view
Load dependencies (arm64, gcc12) / Caching ✅ success view
Load dependencies (arm64, gcc12) / Finalize ✅ success view
Load dependencies (arm64, gcc12) / Metadata ✅ success view
Load dependencies (arm64, llvm) / Caching ✅ success view
Load dependencies (arm64, llvm) / Finalize ✅ success view
Load dependencies (arm64, llvm) / Metadata ✅ success view
Load source build cache ⏩ skipped view
Load wheel dependencies (amd64, 12.6) / Caching ✅ success view
Load wheel dependencies (amd64, 12.6) / Finalize ✅ success view
Load wheel dependencies (amd64, 12.6) / Metadata ✅ success view
Load wheel dependencies (amd64, 13.0) / Caching ✅ success view
Load wheel dependencies (amd64, 13.0) / Finalize ✅ success view
Load wheel dependencies (amd64, 13.0) / Metadata ✅ success view
Load wheel dependencies (arm64, 12.6) / Caching ✅ success view
Load wheel dependencies (arm64, 12.6) / Finalize ✅ success view
Load wheel dependencies (arm64, 12.6) / Metadata ✅ success view
Load wheel dependencies (arm64, 13.0) / Caching ✅ success view
Load wheel dependencies (arm64, 13.0) / Finalize ✅ success view
Load wheel dependencies (arm64, 13.0) / Metadata ✅ success view
Prepare cache clean-up ❔ in_progress view
Retrieve PR info ✅ success view
✅ Required checks (6/6) — declared in .github/required-checks.yml for push
Required check Status Link
Build and test (amd64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, llvm, openmpi) / Dev environment (Python) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Python) ✅ success view
Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, gcc12, openmpi) / Dev environment (Python) ✅ success view

@1tnguyen 1tnguyen linked an issue Jun 10, 2026 that may be closed by this pull request
@1tnguyen 1tnguyen marked this pull request as ready for review June 10, 2026 01:28
Comment thread realtime/CMakeLists.txt
"-D_AVXNECONVERTINTRIN_H_INCLUDED")
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate (line 77) if loops condition? Can be merged into one.

@sacpis sacpis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Thanks @1tnguyen. Left a few comments.

Comment on lines +47 to +54
constexpr std::uint32_t fnv1aHash(const char *str) {
std::uint32_t hash = 2166136261u;
while (*str) {
hash ^= static_cast<std::uint32_t>(*str++);
hash *= 16777619u;
}
return hash;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the fnv1a_hash from cudaq/realtime/daemon/dispatcher/dispatch_kernel_launch.h" instead?

Comment thread realtime/CMakeLists.txt
Comment on lines +15 to +16
else()
set(CUDAQ_REALTIME_STANDALONE_BUILD FALSE)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: False can be set as a default outside the loop. This can help with getting rid of else.

Comment thread realtime/CMakeLists.txt
Comment on lines +141 to +145
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -shared -std=c++17 ${CUDA_gencode_flags} --compiler-options ${_host_compiler_opts}")

enable_language(CUDA)
set(CUDA_FOUND TRUE)
set(CMAKE_CUDA_STANDARD 17)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the comment above but would like to go with C++20 here. Is it always the case that nvcc's C++20 frontend hit the internal compiler error? Or is there any workaround for the same?

Comment on lines +73 to +76
if ((requestLen > 0 && !request) || !responseLen)
return DeviceCallInvalidArgumentStatus;
if (responseCapacity > 0 && !response)
return DeviceCallInvalidArgumentStatus;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can be put in a validate function.

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.

Add realtime to the CUDAQ_ENABLE_PROJECTS variable

2 participants