#1059953 libceres3: ceres-solver built without CUDA support

Package:
libceres3
Source:
libceres3
Description:
nonlinear least squares minimizer (shared library)
Submitter:
Kip Warner
Date:
2024-01-05 08:36:03 UTC
Severity:
normal
#1059953#5
Date:
2024-01-04 01:45:55 UTC
From:
To:
Dear Maintainer,

The current ceres-solver source package may not always build with CUDA support,
even though it is enabled by default. In upstream's CMakeLists.txt CUDA is
enabled by default, but if it is not found it will silently continue building
with CUDA disabled.

The CUDA headers and libraries are not in the package's list of build
dependencies. It might be present anyways by accident on the system because
something else pulled it.

I think the solution is to simply explicitly add nvidia-cuda-dev to the Build-
Depends stanza of of the ceres-solver source package in debian/control.

#1059953#10
Date:
2024-01-04 15:17:19 UTC
From:
To:
Hi Kip,

The nvidia-cuda-dev package is part of the non-free area in the Debian archive
[1] because if does not comply with the DFSG [2].
If we set it as a build dependency of ceres-solver (and also the nvidia runtime
as a package dependency), it would move ceres-solver from the "main" area to the
"contrib" area of the Debian archive [3] which is likely unwanted.

For GPU acceleration in Debian, you may ask Ceres developers to support free
alternatives like ROCm/HIP, OpenCL or SYCL. Otherwise, you would have to build
the ceres-solver package yourself using the CMake CUDA flag.

Best,
François

[1] https://tracker.debian.org/pkg/nvidia-cuda-toolkit
[2] https://wiki.debian.org/DebianFreeSoftwareGuidelines
[3] https://www.debian.org/doc/debian-policy/ch-archive.html#archive-areas

#1059953#15
Date:
2024-01-04 19:06:03 UTC
From:
To:
Perhaps another option is having a libceres-cuda-dev / libceres3-cuda
packages that are built with CUDA?

#1059953#20
Date:
2024-01-05 08:32:29 UTC
From:
To:
Hi Kip,

Makes sense! However, it requires a brand new source package ceres-solver-cuda
to generate these CUDA specific binary packages which will be in the "contrib"
area. This would be similar to pytorch [1] and the pytorch-cuda dedicated
package [2].

If this matter to you and you want to push it forward, feel free to open an RFP
or ITP bug [3]. You may also contact the Debian AI Team because they have some
experience with such CPU/GPU package variants.

Best,
François

[1] https://tracker.debian.org/pkg/pytorch
[2] https://tracker.debian.org/pkg/pytorch-cuda
[3] https://wiki.debian.org/RFP