Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ pybind_build/
results/
venv_gluemap/

*.pyc
*.pyc
.pixi/*
!.pixi/config.toml
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@
[submodule "thirdparty/mapanything"]
path = thirdparty/mapanything
url = https://github.com/facebookresearch/map-anything.git
[submodule "thirdparty/ceres-solver"]
path = thirdparty/ceres-solver
url = https://ceres-solver.googlesource.com/ceres-solver
[submodule "thirdparty/pyceres"]
path = thirdparty/pyceres
url = https://github.com/cvg/pyceres.git
[submodule "thirdparty/colmap"]
path = thirdparty/colmap
url = https://github.com/colmap/colmap.git
10 changes: 10 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ default conda-forge `ceres-solver` is CPU-only — for the CUDA path,
build Ceres from source against your CUDA toolkit and point
`CMAKE_PREFIX_PATH` at it.

### Option C — Pixi package manager

As an alternative, Pixi package manager https://github.com/prefix-dev/pixi could be used to create an environment with all required dependencies. This environment is configured to have torch that supports Blackwell (sm_120) gpus. Also, ceres-solver will be built with support for cuDSS sparse linear solver.
```
pixi install --locked
pixi run install-gluemap
pixi shell
```
After populating and activating the environment, go to step 4.

## 3. Install GLUEMAP

From the repo root, in your active Python ≥ 3.10 environment:
Expand Down
4 changes: 3 additions & 1 deletion gluemap/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ target_include_directories(pygluemap PRIVATE
)
target_link_libraries(pygluemap PRIVATE pybind11::module Eigen3::Eigen ${CERES_LIBRARIES} Boost::headers)
target_compile_definitions(pygluemap PRIVATE cxx_std_17)
if (TARGET Ceres::ceres_cuda_kernels)
get_target_property(CERES_INTERFACE_LINK_LIBRARIES Ceres::ceres INTERFACE_LINK_LIBRARIES)
string(FIND "${CERES_INTERFACE_LINK_LIBRARIES}" "cudss" CERES_HAS_CUDA)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ceres-solver can be compiled with support for cuda implementation of dense linear solvers (this would imply Ceres::ceres_cuda_kernels), but enabling cuda implementation of sparse linear solvers requires cuDSS (thus, checking for Ceres::ceres_cuda_kernels is not enough).

if (${CERES_HAS_CUDA} GREATER 0)
set(CERES_HAS_CUDA TRUE)
else()
set(CERES_HAS_CUDA FALSE)
Expand Down
5,832 changes: 5,832 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[workspace]
preview = ["pixi-build"]
channels = ["conda-forge"]
name = "gluemap"
platforms = ["linux-64"]
version = "0.1.0"

[system-requirements]
cuda = "12"

[dependencies]
pytorch-gpu = ">=2.10.0,<3"
torchvision = ">=0.26.0,<0.27"
compilers = ">=1.11.0,<2"
libcudss = ">=0.7.1.4,<0.8"
metis = "5.1.0.*"
eigen = ">=5.0.1,<6"
cuda-nvcc = "12.9.*"
libcudss-dev = ">=0.7.1.4,<0.8"
libcublas-dev = ">=12.9.2.10,<13"
libcusolver-dev = ">=11.7.5.82,<12"
libcusparse-dev = ">=12.5.10.65,<13"
pip = ">=26.1.1,<27"
suitesparse = ">=7.10.1,<8"
glog = ">=0.7.1,<0.8"
curl = ">=8.20.0,<9"
openimageio = ">=3.1.13.1,<4"
libboost = ">=1.91.0,<2"
libboost-devel = ">=1.91.0,<2"
glew = ">=2.3.0,<3"
libgl = ">=1.7.0,<2"
libgl-devel = ">=1.7.0,<2"
libcurand = ">=10.3.10.19,<11"
libcurand-dev = ">=10.3.10.19,<11"

[pypi-dependencies]
scipy = "==1.17.1"
h5py = "==3.16.0"
networkx = "==3.6.1"
pillow = "==12.2.0"
tqdm = "==4.67.3"
einops = "==0.8.2"
imagesize = "==2.0.0"
safetensors = "==0.7.0"
pyyaml = "==6.0.3"
faiss-cpu = "==1.13.2"
hydra-core = "==1.3.2"
omegaconf = "==2.3.0"
huggingface-hub = "==1.12.0"
plyfile = "==1.1.3"
scikit-learn = "==1.8.0"
uniception = "==0.1.7"
pytorch-lightning = "==2.6.1"
pytorch-metric-learning = "==2.9.0"
lightglue = { git = "https://github.com/cvg/LightGlue.git", rev = "eb42fee2d71449efb0aa5c10549752b5d75384d8" }
opencv-python = ">=4.13.0.92, <5"
click = ">=8.4.1, <9"

[activation]
# Otherwise we will get following error (it might be worth to trace and fix upstream where this dependency got lost):
# ImportError: libmkl_intel_thread.so.3: undefined symbol: __atomic_compare_exchange
env = { LD_PRELOAD = "$CONDA_PREFIX/lib/libatomic.so" }

[tasks]
fetch-thirdparties = "git submodule update --init --recursive"

configure-ceres-solver = {cwd = "thirdparty/ceres-solver", cmd = "cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_TESTING=OFF", depends-on = ["fetch-thirdparties"]}
build-ceres-solver = { cwd = "thirdparty/ceres-solver", cmd = "cmake --build build", depends-on = ["configure-ceres-solver"]}
install-ceres-solver = {cwd = "thirdparty/ceres-solver", cmd = "cmake --install build", depends-on = ["build-ceres-solver"]}
install-pyceres = {cwd = "thirdparty/pyceres", cmd = "pip3 install -e .", depends-on = ["install-ceres-solver"]}

configure-colmap = {cwd = "thirdparty/colmap", cmd = "cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DGUI_ENABLED=OFF -DOPENGL_ENABLED=OFF -DCGAL_ENABLED=OFF -DLSD_ENABLED=OFF", depends-on = ["install-pyceres"]}
build-colmap = { cwd = "thirdparty/colmap", cmd = "cmake --build build", depends-on = ["configure-colmap"]}
install-colmap = {cwd = "thirdparty/colmap", cmd = "cmake --install build", depends-on = ["build-colmap"]}
install-pycolmap = {cwd = "thirdparty/colmap", cmd = "pip3 install -e .", depends-on = ["install-colmap"]}

fix-mast3r-for-new-pytorch = {cmd = "sed -i -e \"s/model_path, map_location='cpu'/model_path, map_location='cpu', weights_only=False/g\" thirdparty/doppelgangers-plusplus/mast3r/model.py", depends-on = ["fetch-thirdparties"]}
install-gluemap = {cmd = "pip3 install --no-deps -e .", depends-on = ["fix-mast3r-for-new-pytorch", "install-pycolmap"]}
check-gluemap = {cmd = "python -c \"import gluemap; import pygluemap; print(pygluemap.__file__)\""}
1 change: 1 addition & 0 deletions thirdparty/ceres-solver
Submodule ceres-solver added at 0ba987
1 change: 1 addition & 0 deletions thirdparty/colmap
Submodule colmap added at 9c23f6
1 change: 1 addition & 0 deletions thirdparty/pyceres
Submodule pyceres added at 7339d7
2 changes: 1 addition & 1 deletion thirdparty/vggsfm/track_modules/track_refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def compute_score_fn(
"""

from kornia.geometry.subpix import dsnt
from kornia.utils.grid import create_meshgrid
from kornia.geometry.grid import create_meshgrid

# query_point_feat initial shape: B x N x C_out,
# query_point_feat indicates the feat at the coorponsing query points
Expand Down