Skip to content

build(ceres): respect CMAKE_CUDA_ARCHITECTURES, carry the fixes as a patch file - #73

Merged
ajakhotia merged 1 commit into
mainfrom
ajakhotia/ceres-cuda-arch
Aug 25, 2026
Merged

ajakhotia merged 1 commit into
mainfrom
ajakhotia/ceres-cuda-arch

Conversation

@ajakhotia

Copy link
Copy Markdown
Owner

Ceres overwrites CMAKE_CUDA_ARCHITECTURES with its own GPU-generation table after enable_language(CUDA), discarding whatever the toolchain supplied, so the fat CI list and a local native both produced 75;80;90. The patch keeps the table strictly as a default (if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES)) and moves it before enable_language(CUDA), where CMake actually consumes the variable. enable_language itself stays deferred because Ceres's CUDA is optional.

Verified through robotFarm's own Ceres target on a fresh clone: both hunks apply, native reaches nvcc as -arch=native, and the installed libceres.so carries a single sm_75 image. On the CI toolchains this lane should now yield the full twelve-architecture library.

The existing sed for the static companion's rejected generator expression folds into the same patches/ceresSolver.patch, so Ceres carries one patch mechanism. Both defects are proposed upstream; the patch retires when a release carries them.

…patch file

Ceres overwrites CMAKE_CUDA_ARCHITECTURES with its own generation table after enabling
CUDA, discarding the toolchain's value, so the fat CI list and a local native both came out
as 75;80;90. The patch makes the table the default only when none was supplied and moves it
before enable_language(CUDA), where CMake consumes it; native now reaches nvcc as
-arch=native and the installed library carries a single sm_75 image. The existing sed for
the static companion's rejected generator expression folds into the same
patches/ceresSolver.patch, so Ceres carries one patch mechanism. Both defects are proposed
upstream; drop the patch when a release carries them.
@ajakhotia
ajakhotia merged commit bc0f498 into main Aug 25, 2026
43 checks passed
@ajakhotia
ajakhotia deleted the ajakhotia/ceres-cuda-arch branch August 25, 2026 21:28
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