ubuntu安装colmap
为防止安装colmap时,在编译过程中存在路径冲突,因此将anaconda文件名暂时更改为其他名称
安装Ceres
官网链接官方链接是这个我下载失败了
git clone https://ceres-solver.googlesource.com/ceres-solver
找了一个非官方的,自行下载,我下载的是2.2.0版本
Index of /ceres-solverhttps://distfiles.macports.org/ceres-solver/
tar -zxvf ceres-solver-2.0.0.tar.gz
cd ceres-solver-2.0.0/
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
此时文件夹是3d/ceres-solver-2.0.0/build,重新打开3d文件夹环境
安装colmap
安装 — COLMAP 3.12.0.dev0 文档官方链接
-DCMAKE_CUDA_ARCHITECTURES=61 是GPU型号确定的,详见https://blog.csdn.net/Stay_Foo_lish/article/details/134318450
git clone https://github.com/colmap/colmap.git
cd colmap
mkdir build
cd build
# 指定gpu的架构,这个61是我显卡的架构,具体需要根据自己的显卡来确定。
cmake -DCMAKE_CUDA_ARCHITECTURES=61 ..
make -j$(nproc)
sudo make install
在camake这一步一直出现
CMake Error at /home/amx/.local/lib/python3.9/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:753 (message):
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.Compiler: /usr/bin/nvcc
Build flags:
Id flags: --keep;--keep-dir;tmp -v
The output was:
255
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=/usr/lib/nvidia-cuda-toolkit/bin
#$ _THERE_=/usr/lib/nvidia-cuda-toolkit/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_SIZE_=64
#$ NVVMIR_LIBRARY_DIR=/usr/lib/nvidia-cuda-toolkit/libdevice
#$
PATH=/usr/lib/nvidia-cuda-toolkit/bin:/home/amx/anaconda3/bin:/usr/local/cuda-11.3/bin:/home/amx/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/amx/anaconda3/envs
#$ LIBRARIES= -L/usr/lib/x86_64-linux-gnu/stubs -L/usr/lib/x86_64-linux-gnu#$ rm tmp/a_dlink.reg.c
#$ gcc -D__CUDA_ARCH__=300 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS
-D__CUDACC__ -D__NVCC__ -D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=1
-D__CUDACC_VER_BUILD__=243 -include "cuda_runtime.h" -m64
"CMakeCUDACompilerId.cu" > "tmp/CMakeCUDACompilerId.cpp1.ii"#$ cicc --c++14 --gnu_version=90400 --allow_managed -arch compute_30 -m64
-ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name
"CMakeCUDACompilerId.fatbin.c" -tused -nvvmir-library
"/usr/lib/nvidia-cuda-toolkit/libdevice/libdevice.10.bc"
--gen_module_id_file --module_id_file_name
"tmp/CMakeCUDACompilerId.module_id" --orig_src_file_name
"CMakeCUDACompilerId.cu" --gen_c_file_name
"tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name
"tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name
"tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o
"tmp/CMakeCUDACompilerId.ptx"#$ ptxas -arch=sm_30 -m64 "tmp/CMakeCUDACompilerId.ptx" -o
"tmp/CMakeCUDACompilerId.sm_30.cubin"ptxas fatal : Value 'sm_30' is not defined for option 'gpu-name'
# --error 0xff --
Call Stack (most recent call first):
/home/amx/.local/lib/python3.9/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/home/amx/.local/lib/python3.9/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
/home/amx/.local/lib/python3.9/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID)
cmake/FindDependencies.cmake:167 (enable_language)
CMakeLists.txt:116 (include)
先删除colmap下的build文件夹,依次运行
apt-cache policy nvidia-cuda-toolkit
sudo apt remove nvidia-cuda-toolkit
重新运行
cd colmap
mkdir build
cd build
# 指定gpu的架构,这个61是我显卡的架构,具体需要根据自己的显卡来确定。
cmake -DCMAKE_CUDA_ARCHITECTURES=61 ..
make -j$(nproc)
sudo make install
一直到100%,成功
启动
colmap gui
别忘了anaconda文件名改回去