Gaussian Splating 需要安装 Colmap 执行 SFM,本文记录安装方法,填几个坑。
简介
COLMAP 是一个通用的运动结构 (SfM) 和多视图立体 (MVS) 管道,具有图形和命令行界面。它为重建有序和无序图像集合提供了广泛的功能。
编译安装
操作系统 Ubuntu 22.04
官方文档:https://colmap.github.io/install.html
安装依赖
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| sudo apt-get install \ git \ cmake \ ninja-build \ build-essential \ libboost-program-options-dev \ libboost-graph-dev \ libboost-system-dev \ libeigen3-dev \ libflann-dev \ libfreeimage-dev \ libmetis-dev \ libgoogle-glog-dev \ libgtest-dev \ libgmock-dev \ libsqlite3-dev \ libglew-dev \ qtbase5-dev \ libqt5opengl5-dev \ libcgal-dev \ libceres-dev
|
源码下载
1 2 3 4
| git clone https://github.com/colmap/colmap.git cd colmap mkdir build cd build
|
编译安装
接下来需要进行 cmake,注意显卡算力是否和cuda 匹配,我的 3060 显卡就报错
1
| nvcc fatal : Unsupported gpu architecture 'compute_native'
|
-
查看当前显卡算力:
1 2 3 4
| cd /usr/local/cuda/extras/demo_suite ./deviceQuery | grep "CUDA Capability Major/Minor version number"--> CUDA Capability Major/Minor version number: 8.6
|
或
1 2 3 4 5
| nvidia-smi --query-gpu=compute_cap --format=csv--> compute_cap 8.6
|
表示我的显卡算力 8.6
-
执行 CMake 命令
1
| cmake .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=86
|
-
安装了 anaconda 的注意了,如果看到这步有 warning:
1
| runtime library [libGLU.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /home/vvd/anaconda3/lib
|
那么接下来会报错:
1
| /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldTag@LIBTIFF_4.0'
|
解决方案 为暂时关掉 anaconda 的 bin Path, 即全部注释掉
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! #__conda_setup="$('/home/vvd/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" #if [ $? -eq 0 ]; then # eval "$__conda_setup" #else # if [ -f "/home/vvd/anaconda3/etc/profile.d/conda.sh" ]; then # . "/home/vvd/anaconda3/etc/profile.d/conda.sh" # else # export PATH="/home/vvd/anaconda3/bin:$PATH" # fi #fi #unset __conda_setup # <<< conda initialize <<<
|
之后换一个终端,确定 echo $PATH 里没有 anaconda 的 bin 后重新执行 cmake 命令
-
编译安装:
1 2
| ninja sudo ninja install
|
运行测试

参考资料
文章链接:
https://www.zywvvd.com/notes/3d/colmap-install/colmap-install/