{{ message }}
Force nonnegative scale for Sim(3) - #997
Merged
Merged
Conversation
leolrg
added a commit
to leolrg/cu-gtsam
that referenced
this pull request
Aug 20, 2026
CMake searches PATH for nvcc, so a machine with several toolkits installed can pick one too old for the GPU it has: CUDA 12.0 rejects compute_120 even where the driver supports Blackwell, and the mismatch only surfaces partway through the build. Choose the compiler before enable_language(CUDA) when the user has not: try CUDAToolkit_ROOT, CUDA_HOME, CUDA_PATH, /usr/local/cuda, PATH, then the newest /usr/local/cuda-*, and take the first nvcc that compiles for the requested architectures. "native" is resolved from nvidia-smi so it can be tested, and the chosen toolkit becomes CUDAToolkit_ROOT so its libraries cannot come from a different install. A compiler that cannot target the architectures fails during configuration, naming the alternatives that were tried, rather than after a long build. Also quiet the nvcc diagnostics that repeat in every CUDA translation unit: --expt-relaxed-constexpr for Eigen's device code, and borglab#611-D and borglab#997-D, which report long-standing overload sets in NoiseModel.h and BatchFactor.h that neither GCC nor Clang report. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.

As discussed in #995, for certain inputs,
Similarity3.Align()returns an object with negative scale.According to my derivation here, based on Zinnser05prip, the correct scale should not need an absolute value cast.
However, this PR adds an absolute value cast on the scale, and we can likely blame numerical instabilities as a reasonable motivation (the negative values I saw were relatively close to zero).