Skip to content

feat(docker): add core CUDA images - #7383

Merged
xmfcx merged 2 commits into
mainfrom
feat/core-cuda-images
Nov 2, 2026
Merged

xmfcx merged 2 commits into
mainfrom
feat/core-cuda-images

Conversation

@xmfcx

@xmfcx xmfcx commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds three images that hold the CUDA layer of Core (src/core/cuda). They are the core images built on the CUDA base images:

Image Built from Holds
core-dependencies-cuda base-cuda-devel Everything in core-dependencies, plus negotiated built from source. It does not hold autoware_cuda and cuda_blackboard, and rosdep does not install their dependencies. core-dependencies treats autoware_core the same way.
core-devel-cuda core-dependencies-cuda All of Core and the CUDA layer, built with CUDA
core-cuda base-cuda-runtime The runtime part of core-devel-cuda

No image uses them yet. The next PR builds the universe CUDA images on top of them.

The changes:

  • docker/core.Dockerfile takes two new arguments. WITH_CUDA keeps src/core/cuda in the build. RUNTIME_BASE_IMAGE sets the base of the runtime stage. The CPU targets pass base for both bases and leave WITH_CUDA at false, so they build as before.
  • autoware_cuda and cuda_blackboard are top repositories, like autoware_core, autoware_rviz_plugins and autoware_simple_planning_simulator. core-dependencies* installs the dependencies of the other packages only, and core-devel* builds the top repositories. core-devel now copies all package.xml files of src/core and binds all of src/core. Before, it listed the three top repositories one by one.
  • negotiated moves from universe/external/negotiated to core/cuda/negotiated in autoware.repos. cuda_blackboard depends on it, and it is the only user. negotiated has no ROS release and no rosdep rule, so a core image must build it from src/core.
  • CMAKE_CUDA_ARCHITECTURES moves from universe-cuda.Dockerfile to base-cuda-runtime. Every CUDA image starts from base-cuda-runtime or base-cuda-devel, so this one line now sets it for the core and the universe CUDA images. The next PR deletes universe-cuda.Dockerfile, and the value must be in the base then. The value does not change. The installed libraries of the core CUDA packages hold no GPU code, so the value does not change them today. The published base-cuda-* images now carry the variable too.
  • docker-bake.hcl: the three core targets share a new _core-base target, and the CUDA targets inherit it through _core-cuda-base. A new ci-core-cuda group holds the CUDA targets, and the default group lists them, so docker-manifest.yaml makes their multi-arch tags with no change.
  • docker-build-pipeline.yaml gets a build-core-cuda job after build-base-cuda.
  • keep-build-cache-small.yaml gets the ci-core-cuda cache tags, with the same limits as the other CUDA groups.
  • docker/README.md lists the new images.

Related links

Parent Issue:

Other links:

Effects on existing workspaces

After vcs import, a workspace that was built before needs two manual steps:

rm -rf src/universe/external/negotiated
rm -rf {build,install}/{negotiated,negotiated_interfaces,negotiated_examples}

vcs import does not delete the old copy, and colcon stops when it finds two packages with the same name. The second command removes the CMake caches that point to the old source path.

How was this PR tested?

See the verification block below.

AI usage

AI usage: Claude Code made the change from the plan in the parent issue, ran the checks below, and wrote this description.

Self-review: A clean context agent reviewed this PR in two rounds, and the description and README fixes from round 1 are in. Three small style points stay as they are, because they follow the existing pattern. The new build-core-cuda job has not finished a CI run yet.

Verification: A local docker buildx bake of core-devel, core and the three new CUDA targets passed for Jazzy on amd64. The CPU stages build the same package counts as on main (50 and 84), and the CUDA images hold 141 packages. Humble, arm64 and the CI pipeline did not run.

Local bake, Jazzy, amd64

Ubuntu 24.04 host, 24 cores, Docker Buildx v0.38.0. src came from vcs import --shallow of the autoware.repos of this branch. base and base-cuda-* were built locally, not pulled, because base-cuda-runtime changes in this PR.

  • docker buildx bake -f docker/docker-bake.hcl core-devel core core-dependencies-cuda core-devel-cuda core-cuda exited 0 after 45 min.
  • colcon summaries: 50 packages finished and 84 packages finished for the CPU core-dependencies and core-devel stages. The ci-core jobs of run 41254765545 at dd830a451, the base of this PR, show the same counts for Jazzy and Humble on amd64.
  • colcon summaries: 53 packages finished and 88 packages finished for the CUDA stages. The 3 extra packages are negotiated, negotiated_interfaces and negotiated_examples. The 4 extra packages are autoware_cuda_dependency_meta, autoware_cuda_utils, autoware_tensorrt_common and cuda_blackboard.
  • The build started before two edits to core.Dockerfile: a # hadolint ignore=SC2086 line, and a switch to a bash array that I reverted. A second bake on the committed files took 3 s, and all 42 steps were CACHED.

Image contents

  • /opt/autoware holds 134 packages in core-devel and core, and none of autoware_cuda_dependency_meta, autoware_cuda_utils, autoware_tensorrt_common, cuda_blackboard or negotiated.
  • core-dependencies-cuda holds 53 packages: negotiated, negotiated_interfaces and negotiated_examples are in it, the four CUDA layer packages are not.
  • core-devel-cuda and core-cuda hold 141 packages, all six of the packages above included.
  • CMAKE_CUDA_ARCHITECTURES is 86;87;89;90;110 in the three CUDA images and unset in the CPU images.
  • In core-cuda, with the ROS and Autoware setup sourced, ldd reports 0 not found for libautoware_tensorrt_common.so and libcuda_blackboard.so. The first resolves libcudart.so.13 and libnvinfer.so.10. The second resolves libnegotiated.so from /opt/autoware/negotiated.
  • ros2 pkg prefix finds cuda_blackboard, autoware_tensorrt_common and autoware_cuda_utils in core-cuda.
  • Not run: a GPU test in the images. cuobjdump --list-elf finds no device code in these libraries, so the GPU architecture list does not change their binaries.

Bake configuration

  • docker buildx bake --print shows core-devel-cuda and core-cuda with the contexts target:base-cuda-devel and target:base-cuda-runtime and WITH_CUDA true. The CPU targets have target:base for both contexts and no WITH_CUDA.
  • With USE_REGISTRY_CONTEXTS=true, the ci-core-cuda targets read docker-image://ghcr.io/autowarefoundation/autoware:base-cuda-devel-jazzy-amd64 and the matching base-cuda-runtime image.
  • The default group lists the three new targets, so docker-manifest.yaml finds them.

pre-commit

  • pre-commit run --files on the 8 changed files passed, Hadolint, markdownlint and prettier included.
  • Hadolint first reported SC2086 for the unquoted ${cuda_paths}, which must split into two paths. A bash array then gave SC3054, because Hadolint does not see the inherited bash shell. The fix is the string and a # hadolint ignore=SC2086 line.

Review fix

  • A clean context review found that the description claimed the build dependencies of the CUDA layer for core-dependencies-cuda. The row in docker/README.md was unclear in the same way. The second commit fixes that row and shortens the three new rows, so that prettier keeps the column widths of main.
  • pre-commit run --files docker/README.md passed.

Not run

  • Humble, and arm64.
  • Locked mode (USE_LOCKFILE=true) for the three new targets. For this reason, the locked mode paragraph in docker/README.md does not name them.
  • docker-build-and-push with the new build-core-cuda job. Only a run on main or a workflow_dispatch on this branch runs it.
  • The health-check jobs of this PR build universe-devel for Humble and Jazzy on amd64, so they cover the CPU path. They were still running when I wrote this.
  • The CI of other repositories. No image uses the new images yet.

Add core-dependencies-cuda, core-devel-cuda and core-cuda. They are
the core images built on base-cuda-devel and base-cuda-runtime, with
the CUDA layer of Core (src/core/cuda) included.

- core.Dockerfile takes WITH_CUDA and RUNTIME_BASE_IMAGE. Without
  them, the CPU images build as before.
- autoware_cuda and cuda_blackboard are top repositories like
  autoware_core. core-dependencies-cuda holds their dependencies, and
  core-devel-cuda builds them.
- negotiated moves to core/cuda/negotiated, because cuda_blackboard
  is its only user and a core image builds only from src/core.
- CMAKE_CUDA_ARCHITECTURES moves to base-cuda-runtime, because
  core-devel-cuda now compiles CUDA code.
- docker-build-pipeline gets a build-core-cuda job after
  build-base-cuda. No image uses the new images yet.

Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
@xmfcx xmfcx added type:build Tooling and infrastructure around building the Autoware. type:containers Docker containers, containerization of components, or container orchestration. labels Nov 1, 2026
@xmfcx xmfcx self-assigned this Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

Comment thread docker/base-cuda.Dockerfile Resolved
Comment thread docker/universe-cuda.Dockerfile Resolved
The row for core-dependencies-cuda read as if the image holds the dependencies of all of src/core/cuda. It holds negotiated and its dependencies only. rosdep does not install the dependencies of autoware_cuda and cuda_blackboard there.

The three new rows are now short enough that prettier keeps the column widths of main, so the diff adds only these rows.

Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
Comment thread docker/core.Dockerfile Resolved
@xmfcx
xmfcx marked this pull request as ready for review November 1, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run:health-check Run health-check type:build Tooling and infrastructure around building the Autoware. type:containers Docker containers, containerization of components, or container orchestration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants