Skip to content

Consolidate realtime dependency building. - #794

Open
Renaud-K wants to merge 1 commit into
NVIDIA:mainfrom
Renaud-K:realtime-deps-consolidation
Open

Consolidate realtime dependency building.#794
Renaud-K wants to merge 1 commit into
NVIDIA:mainfrom
Renaud-K:realtime-deps-consolidation

Conversation

@Renaud-K

Copy link
Copy Markdown
Collaborator

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.sh will 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 strike
through and explain.

Before requesting review

  • I reviewed my own full diff in GitHub or my editor.
  • PR is in Draft if it is not yet ready for review.
  • Temporary / debugging changes have been removed.
  • Local test logs reviewed; no unexplained warnings or errors.
  • CI logs reviewed; no unexplained warnings or errors.
  • Full CI has been run.

Scope and size

  • PR is under ~1000 lines, or an exception is justified in the description.
  • Refactoring-only changes are isolated in their own PR(s).
  • No existing tests were disabled or modified just to make this PR pass
    (if so, an issue has been raised).

Tests

  • New functionality has new tests.
  • Tests fail if the new functionality is broken (including crashes), not
    just when it is missing.
  • Negative tests added where exceptions are expected.
  • Truth data added where simple EXPECT_* / assert checks are
    insufficient for algorithmic correctness.
  • CI runtime impact considered; team notified if significant.

Documentation

  • Public-facing APIs have Doxygen docs.
  • User-visible behavior changes have public docs, or a follow-up is
    tracked.

Code style

  • Naming follows the existing convention (snake_case vs camelCase) for
    the area being modified.

Dependencies

  • No new third-party dependencies, or the team has been notified and
    OSRB tickets filed.

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>
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.

1 participant