Force nonnegative scale for Sim(3) by johnwlambert · Pull Request #997 · borglab/gtsam · GitHub
Skip to content

Force nonnegative scale for Sim(3) - #997

Merged
johnwlambert merged 1 commit into
developfrom
force-nonnegative-scale-Sim3
Dec 30, 2021
Merged

Force nonnegative scale for Sim(3)#997
johnwlambert merged 1 commit into
developfrom
force-nonnegative-scale-Sim3

Conversation

@johnwlambert

Copy link
Copy Markdown
Contributor

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

@dellaert dellaert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thanks John!

@johnwlambert
johnwlambert merged commit 0ba1d3b into develop Dec 30, 2021
@johnwlambert
johnwlambert deleted the force-nonnegative-scale-Sim3 branch December 30, 2021 21:08
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>
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.

Similarity(3) estimation returns a negative scale for some poorly aligned pose graphs

2 participants