Repository navigation
feat(docker): add core CUDA images - #7383
Merged
Merged
Conversation
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>
Contributor
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
xmfcx
commented
Nov 1, 2026
xmfcx
commented
Nov 1, 2026
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>
xmfcx
commented
Nov 1, 2026
xmfcx
marked this pull request as ready for review
November 1, 2026 18:05
xmfcx
requested review from
isamu-takagi,
mitsudome-r,
oguzkaganozt and
youtalk
as code owners
November 1, 2026 18:05
13 of 17 tasks
mitsudome-r
approved these changes
Nov 2, 2026
This was referenced Nov 2, 2026
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 adds three images that hold the CUDA layer of Core (
src/core/cuda). They are the core images built on the CUDA base images:core-dependencies-cudabase-cuda-develcore-dependencies, plusnegotiatedbuilt from source. It does not holdautoware_cudaandcuda_blackboard, and rosdep does not install their dependencies.core-dependenciestreatsautoware_corethe same way.core-devel-cudacore-dependencies-cudacore-cudabase-cuda-runtimecore-devel-cudaNo image uses them yet. The next PR builds the universe CUDA images on top of them.
The changes:
docker/core.Dockerfiletakes two new arguments.WITH_CUDAkeepssrc/core/cudain the build.RUNTIME_BASE_IMAGEsets the base of the runtime stage. The CPU targets passbasefor both bases and leaveWITH_CUDAatfalse, so they build as before.autoware_cudaandcuda_blackboardare top repositories, likeautoware_core,autoware_rviz_pluginsandautoware_simple_planning_simulator.core-dependencies*installs the dependencies of the other packages only, andcore-devel*builds the top repositories.core-develnow copies allpackage.xmlfiles ofsrc/coreand binds all ofsrc/core. Before, it listed the three top repositories one by one.negotiatedmoves fromuniverse/external/negotiatedtocore/cuda/negotiatedinautoware.repos.cuda_blackboarddepends on it, and it is the only user.negotiatedhas no ROS release and no rosdep rule, so a core image must build it fromsrc/core.CMAKE_CUDA_ARCHITECTURESmoves fromuniverse-cuda.Dockerfiletobase-cuda-runtime. Every CUDA image starts frombase-cuda-runtimeorbase-cuda-devel, so this one line now sets it for the core and the universe CUDA images. The next PR deletesuniverse-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 publishedbase-cuda-*images now carry the variable too.docker-bake.hcl: the three core targets share a new_core-basetarget, and the CUDA targets inherit it through_core-cuda-base. A newci-core-cudagroup holds the CUDA targets, and thedefaultgroup lists them, sodocker-manifest.yamlmakes their multi-arch tags with no change.docker-build-pipeline.yamlgets abuild-core-cudajob afterbuild-base-cuda.keep-build-cache-small.yamlgets theci-core-cudacache tags, with the same limits as the other CUDA groups.docker/README.mdlists the new images.Related links
Parent Issue:
Other links:
negotiatedpath inbuild_depends_stable.repos)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 importdoes 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-cudajob has not finished a CI run yet.Verification: A local
docker buildx bakeofcore-devel,coreand the three new CUDA targets passed for Jazzy on amd64. The CPU stages build the same package counts as onmain(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.
srccame fromvcs import --shallowof theautoware.reposof this branch.baseandbase-cuda-*were built locally, not pulled, becausebase-cuda-runtimechanges in this PR.docker buildx bake -f docker/docker-bake.hcl core-devel core core-dependencies-cuda core-devel-cuda core-cudaexited 0 after 45 min.50 packages finishedand84 packages finishedfor the CPUcore-dependenciesandcore-develstages. Theci-corejobs of run 41254765545 atdd830a451, the base of this PR, show the same counts for Jazzy and Humble on amd64.53 packages finishedand88 packages finishedfor the CUDA stages. The 3 extra packages arenegotiated,negotiated_interfacesandnegotiated_examples. The 4 extra packages areautoware_cuda_dependency_meta,autoware_cuda_utils,autoware_tensorrt_commonandcuda_blackboard.core.Dockerfile: a# hadolint ignore=SC2086line, and a switch to a bash array that I reverted. A second bake on the committed files took 3 s, and all 42 steps wereCACHED.Image contents
/opt/autowareholds 134 packages incore-develandcore, and none ofautoware_cuda_dependency_meta,autoware_cuda_utils,autoware_tensorrt_common,cuda_blackboardornegotiated.core-dependencies-cudaholds 53 packages:negotiated,negotiated_interfacesandnegotiated_examplesare in it, the four CUDA layer packages are not.core-devel-cudaandcore-cudahold 141 packages, all six of the packages above included.CMAKE_CUDA_ARCHITECTURESis86;87;89;90;110in the three CUDA images and unset in the CPU images.core-cuda, with the ROS and Autoware setup sourced,lddreports0 not foundforlibautoware_tensorrt_common.soandlibcuda_blackboard.so. The first resolveslibcudart.so.13andlibnvinfer.so.10. The second resolveslibnegotiated.sofrom/opt/autoware/negotiated.ros2 pkg prefixfindscuda_blackboard,autoware_tensorrt_commonandautoware_cuda_utilsincore-cuda.cuobjdump --list-elffinds no device code in these libraries, so the GPU architecture list does not change their binaries.Bake configuration
docker buildx bake --printshowscore-devel-cudaandcore-cudawith the contextstarget:base-cuda-develandtarget:base-cuda-runtimeandWITH_CUDAtrue. The CPU targets havetarget:basefor both contexts and noWITH_CUDA.USE_REGISTRY_CONTEXTS=true, theci-core-cudatargets readdocker-image://ghcr.io/autowarefoundation/autoware:base-cuda-devel-jazzy-amd64and the matchingbase-cuda-runtimeimage.defaultgroup lists the three new targets, sodocker-manifest.yamlfinds them.pre-commit
pre-commit run --fileson the 8 changed files passed, Hadolint, markdownlint and prettier included.SC2086for the unquoted${cuda_paths}, which must split into two paths. A bash array then gaveSC3054, because Hadolint does not see the inherited bash shell. The fix is the string and a# hadolint ignore=SC2086line.Review fix
core-dependencies-cuda. The row indocker/README.mdwas unclear in the same way. The second commit fixes that row and shortens the three new rows, so that prettier keeps the column widths ofmain.pre-commit run --files docker/README.mdpassed.Not run
USE_LOCKFILE=true) for the three new targets. For this reason, the locked mode paragraph indocker/README.mddoes not name them.docker-build-and-pushwith the newbuild-core-cudajob. Only a run onmainor aworkflow_dispatchon this branch runs it.health-checkjobs of this PR builduniverse-develfor Humble and Jazzy on amd64, so they cover the CPU path. They were still running when I wrote this.