Consolidate realtime dependency building. - #794
Open
Renaud-K wants to merge 1 commit into
Open
Conversation
Signed-off-by: Renaud Kauffmann <rkauffmann@nvidia.com>
schweitzpgi
pushed a commit
to schweitzpgi/cuda-quantum
that referenced
this pull request
Aug 25, 2026
## Summary The DOCA + Holoscan SDK + Holoscan Sensor Bridge (HSB) install-and-build sequence had been copied into four places, each with its own pinned versions and its own subtly different cmake invocation. This PR extracts the shared logic into `realtime/scripts/deps_common.sh` and reduces the callers to thin entry points. ## Where the duplication was 1. **`realtime/scripts/install_dev_prerequisites.sh`** — the apt path: DOCA repo setup, `doca-all`, `holoscan-cuda-$CUDA_MAJOR`. It stopped short of HSB, so every caller had to build HSB itself. 2. **`.github/workflows/realtime_ci.yml`**, [lines 169-180](https://github.com/Renaud-K/cuda-quantum/blob/main/.github/workflows/realtime_ci.yml#L169-L180) — the `CUDA_NATIVE_ARCH` matrix expression, the HSB clone at `2.6.0-EA2`, and a seven-flag cmake configure plus three-target build, all inline in YAML where nothing can lint or reuse it. 3. **cudaqx `.github/actions/build-lib/build_qec.sh`** — roughly 65 lines repeating the same sequence, except that the cudaqx CI container ships Mellanox OFED, so `doca-all` conflicts and it installs only `libdoca-sdk-gpunetio-dev`, pins `cuda-nvrtc-dev` to the toolkit version, and force-installs Holoscan with `dpkg --force-depends`. 4. **`realtime/docker/assets.Dockerfile`** — the rpm/UBI DOCA install, plus yet another copy of the HSB clone/configure/build with its own `hsb_version` and `cuda_native_arg` defaults. The practical cost was that DOCA 3.3.0, the HSB ref `2.6.0-EA2`, the architecture lists and the HSB cmake flags each had to be bumped in several unrelated files, and they had already drifted: `build_qec.sh` built only two of the three HSB targets and hard-coded `CUDA_NATIVE_ARCH=80`, while CI passed a full architecture list per CUDA version. ## What changed - **New `realtime/scripts/deps_common.sh`** holds the version pins (`CUDAQ_REALTIME_DOCA_VERSION`, HSB repo and ref) and the shared helpers: CUDA version detection, `CUDA_NATIVE_ARCH` derivation, DOCA repo registration, Holoscan install, an SDK sanity check, and the HSB clone/configure/build. It is meant to be sourced rather than executed. - **`install_dev_prerequisites.sh`** keeps the standard `doca-all` path but now also builds HSB, so callers no longer have to. It runs under `set -e`, `HSB_ROOT` selects where the tree lands, and `CUDAQ_REALTIME_SKIP_HSB=1` installs the SDKs only. - **New `install_devdeps.sh`** is the entry point for containers that already ship Mellanox OFED, where `doca-all` cannot be installed. It is the consolidation target for the cudaqx logic above: minimal DOCA, `cuda-nvrtc-dev` pinned to the exact toolkit version, the dependency-forced Holoscan fallback, and HSB built with the unused operators stripped. - **`realtime_ci.yml`** loses the twelve inline lines in favor of exporting `HSB_ROOT` and calling the script. The architecture list is now derived from `nvcc` instead of a matrix expression, which is what lets the same script serve CI, the cudaqx action and local development. Both entry points always build all three HSB targets (`roce_receiver`, `gpu_roce_transceiver`, `hololink_core`), removing another way for callers to diverge. ## Architecture derivation CUDA 12 gets `80-real;90` and anything newer gets `80-real;90-real;100f-real;110-real;120-real;100-virtual`, the same values the CI matrix expression produced. A `CUDA_NATIVE_ARCH` set by the caller always wins, so pinning a single architecture for a faster build still works. ## Testing Ran the consolidated scripts end to end in containers based on `cuda-quantum-devcontainer:amd64-cu12.6-gcc12-main` and `amd64-cu13.0-gcc12-main`. On CUDA 13 this installs DOCA 3.3.0 and `holoscan-cuda-13` 4.5.0.0, produces all six HSB static libraries, and the compiled kernel object carries cubins for sm_80, sm_90, sm_100, sm_110 and sm_120, confirming the derived architecture list reaches nvcc. `apt-get check` and `dpkg -C` are clean afterwards, so the forced Holoscan path leaves no broken dependencies. The dependency step takes about 72 seconds and adds roughly 700 MB. ## Follow-ups After these changes are pushed, cudaqx PR NVIDIA/cudaqx#794 can proceed to using the consolidated scripts. Signed-off-by: Renaud Kauffmann <rkauffmann@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR will follow NVIDIA/cuda-quantum#5227, whereby the scripts responsible for building the realtime dependencies are consolidated.
With this change
buid_qec.shwill be using a script provided by the realtime, to build the realtime dependencies.Runtime / performance impact
"N/A"
Self-review checklist
Please confirm each item before requesting review. Check
[x]or strikethrough and explain.
Before requesting review
Scope and size
(if so, an issue has been raised).
Tests
just when it is missing.
EXPECT_*/assertchecks areinsufficient for algorithmic correctness.
Documentation
tracked.
Code style
snake_casevscamelCase) forthe area being modified.
Dependencies
OSRB tickets filed.