pierotofy / OpenSplat

Production-grade 3D gaussian splatting with CPU/GPU support for Windows, Mac and Linux 🚀
https://antimatter15.com/splat/?url=https://splat.uav4geo.com/banana.splat
GNU Affero General Public License v3.0
933 stars 87 forks source link

Build Failed #112

Closed bzy-080408 closed 4 months ago

bzy-080408 commented 4 months ago

log: [100%] Linking CXX executable opensplat /usr/bin/ld: CMakeFiles/opensplat.dir/opensplat.cpp.o: in function main': opensplat.cpp:(.text.startup+0x3d76): undefined reference tocv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)' /usr/bin/ld: CMakeFiles/opensplat.dir/cv_utils.cpp.o: in function imreadRGB(std::string const&)': cv_utils.cpp:(.text+0x1f4): undefined reference tocv::imread(std::string const&, int)' /usr/bin/ld: CMakeFiles/opensplat.dir/cv_utils.cpp.o: in function imwriteRGB(std::string const&, cv::Mat const&)': cv_utils.cpp:(.text+0x31f): undefined reference tocv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/opensplat.dir/build.make:357:opensplat] 错误 1 make[1]: [CMakeFiles/Makefile2:241:CMakeFiles/opensplat.dir/all] 错误 2 make: *** [Makefile:136:all] 错误 2

system ubuntu 22.04 cu121 and ubuntu 22.04 cu118 same image image

pfxuan commented 4 months ago

What's your cmake log? It seems like you are missing opencv dep. Try this:

sudo apt install libopencv-dev
bzy-080408 commented 4 months ago

What's your cmake log? It seems like you are missing opencv dep. Try this:

sudo apt install libopencv-dev

No help
log:
root@dsw-402275-cc8b59c7c-gl6sm:/mnt/workspace/OpenSplat/build# cmake -DCMAKE_PREFIX_PATH=/mnt/workspace/libtorch .. && make -j16 OpenSplat Version: 1.1.3 (git commit 7c9a9cc) -- Using the multi-header code from /mnt/workspace/OpenSplat/build/_deps/nlohmann_json-src/include/ -- nanoflann version: 1.5.5 -- GLM: Version 1.0.1 -- GLM: Build with C++ features auto detection -- Updated TORCH_CUDA_ARCH_LIST to 7.0 7.5 8.0 -- Found CUDA: /usr/local/cuda (found version "12.1") -- Found CUDAToolkit: /usr/local/cuda/include (found version "12.1.105") -- Caffe2: CUDA detected: 12.1 -- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc -- Caffe2: CUDA toolkit directory: /usr/local/cuda -- Caffe2: Header version is: 12.1 CMake Warning at /mnt/workspace/libtorch/share/cmake/Caffe2/public/cuda.cmake:143 (message): Failed to compute shorthash for libnvrtc.so Call Stack (most recent call first): /mnt/workspace/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:86 (include) /mnt/workspace/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package) CMakeLists.txt:164 (find_package)

-- USE_CUDNN is set to 0. Compiling without cuDNN support -- USE_CUSPARSELT is set to 0. Compiling without cuSPARSELt support -- Added CUDA NVCC flags for: -gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80 -- Found Torch: /mnt/workspace/libtorch/lib/libtorch.so -- Found OpenCV: /usr (found version "4.5.4") -- Configuring done (0.3s) -- Generating done (0.0s) -- Build files have been written to: /mnt/workspace/OpenSplat/build [ 4%] Building CXX object CMakeFiles/gsplat_cpu.dir/rasterizer/gsplat-cpu/gsplat_cpu.cpp.o [ 8%] Building CUDA object CMakeFiles/gsplat.dir/rasterizer/gsplat/forward.cu.o [ 12%] Building CUDA object CMakeFiles/gsplat.dir/rasterizer/gsplat/backward.cu.o [ 16%] Building CUDA object CMakeFiles/gsplat.dir/rasterizer/gsplat/bindings.cu.o [ 20%] Building CXX object _deps/glm-build/glm/CMakeFiles/glm.dir/detail/glm.cpp.o /mnt/workspace/OpenSplat/rasterizer/gsplat/backward.cu(386): warning #177-D: variable "cx" was declared but never referenced float cx = intrins.z; ^

Remark: The warnings can be suppressed with "-diag-suppress "

/mnt/workspace/OpenSplat/rasterizer/gsplat/backward.cu(387): warning #177-D: variable "cy" was declared but never referenced float cy = intrins.w; ^

[ 24%] Linking CXX static library libglm.a [ 24%] Built target glm /mnt/workspace/OpenSplat/rasterizer/gsplat/backward.cu(386): warning #177-D: variable "cx" was declared but never referenced float cx = intrins.z; ^

Remark: The warnings can be suppressed with "-diag-suppress "

/mnt/workspace/OpenSplat/rasterizer/gsplat/backward.cu(387): warning #177-D: variable "cy" was declared but never referenced float cy = intrins.w; ^

/mnt/workspace/OpenSplat/rasterizer/gsplat/backward.cu(386): warning #177-D: variable "cx" was declared but never referenced float cx = intrins.z; ^

Remark: The warnings can be suppressed with "-diag-suppress "

/mnt/workspace/OpenSplat/rasterizer/gsplat/backward.cu(387): warning #177-D: variable "cy" was declared but never referenced float cy = intrins.w; ^

[ 28%] Linking CXX static library libgsplat_cpu.a [ 28%] Built target gsplat_cpu /mnt/workspace/OpenSplat/rasterizer/gsplat/bindings.cu(236): warning #177-D: variable "num_cov3d" was declared but never referenced const auto num_cov3d = num_points * 6; ^

Remark: The warnings can be suppressed with "-diag-suppress "

/mnt/workspace/OpenSplat/rasterizer/gsplat/bindings.cu(236): warning #177-D: variable "num_cov3d" was declared but never referenced const auto num_cov3d = num_points * 6; ^

Remark: The warnings can be suppressed with "-diag-suppress "

/mnt/workspace/OpenSplat/rasterizer/gsplat/bindings.cu(236): warning #177-D: variable "num_cov3d" was declared but never referenced const auto num_cov3d = num_points * 6; ^

Remark: The warnings can be suppressed with "-diag-suppress "

[ 32%] Linking CXX static library libgsplat.a [ 32%] Built target gsplat [ 36%] Building CXX object CMakeFiles/opensplat.dir/opensplat.cpp.o [ 40%] Building CXX object CMakeFiles/opensplat.dir/model.cpp.o [ 44%] Building CXX object CMakeFiles/opensplat.dir/cv_utils.cpp.o [ 52%] Building CXX object CMakeFiles/opensplat.dir/project_gaussians.cpp.o [ 52%] Building CXX object CMakeFiles/opensplat.dir/rasterize_gaussians.cpp.o [ 56%] Building CXX object CMakeFiles/opensplat.dir/nerfstudio.cpp.o [ 60%] Building CXX object CMakeFiles/opensplat.dir/utils.cpp.o [ 64%] Building CXX object CMakeFiles/opensplat.dir/ssim.cpp.o [ 68%] Building CXX object CMakeFiles/opensplat.dir/spherical_harmonics.cpp.o [ 72%] Building CXX object CMakeFiles/opensplat.dir/kdtree_tensor.cpp.o [ 76%] Building CXX object CMakeFiles/opensplat.dir/point_io.cpp.o [ 80%] Building CXX object CMakeFiles/opensplat.dir/optim_scheduler.cpp.o [ 84%] Building CXX object CMakeFiles/opensplat.dir/input_data.cpp.o [ 88%] Building CXX object CMakeFiles/opensplat.dir/colmap.cpp.o [ 92%] Building CXX object CMakeFiles/opensplat.dir/opensfm.cpp.o [ 96%] Building CXX object CMakeFiles/opensplat.dir/tensor_math.cpp.o [100%] Linking CXX executable opensplat /usr/bin/ld: CMakeFiles/opensplat.dir/opensplat.cpp.o: in function main': opensplat.cpp:(.text.startup+0x3d76): undefined reference tocv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)' /usr/bin/ld: CMakeFiles/opensplat.dir/cv_utils.cpp.o: in function imreadRGB(std::string const&)': cv_utils.cpp:(.text+0x1f4): undefined reference tocv::imread(std::string const&, int)' /usr/bin/ld: CMakeFiles/opensplat.dir/cv_utils.cpp.o: in function imwriteRGB(std::string const&, cv::Mat const&)': cv_utils.cpp:(.text+0x31f): undefined reference tocv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/opensplat.dir/build.make:357:opensplat] 错误 1 make[1]: [CMakeFiles/Makefile2:241:CMakeFiles/opensplat.dir/all] 错误 2 make: *** [Makefile:136:all] 错误 2 root@dsw-402275-cc8b59c7c-gl6sm:/mnt/workspace/OpenSplat/build#

bzy-080408 commented 4 months ago

fixed should use this libtorch version: libtorch-cxx11-abi-shared-with-deps-2.2.1+cu121

bzy-080408 commented 4 months ago

but why it used so many memory but VRAM used so low? image

pfxuan commented 4 months ago

The footprint of CPU RAM seems a bit high to me as well. What does your input look like?

bzy-080408 commented 4 months ago

The footprint of CPU RAM seems a bit high to me as well. What does your input look like?

Chapter 168 Skew Photography, School Canteen

pfxuan commented 4 months ago

What is the image size? For reference, in my latest test with 152 images at 1920x1440 resolution, the CPU memory footprint stabilized around 10 GB.

bzy-080408 commented 4 months ago

What is the image size? For reference, in my latest test with 152 images at 1920x1440 resolution, the CPU memory footprint stabilized around 10 GB.

5472x3648

pfxuan commented 4 months ago

The image size you are using is quite large. 27.5 GB CPU memory footprint you got is likely correct. To make the entire training process fit your machine, you can try using --downscale-factor option to reduce the input image size.