MrNeRF / gaussian-splatting-cuda

3D Gaussian Splatting, reimagined: Unleashing unmatched speed with C++ and CUDA from the ground up!
Other
909 stars 74 forks source link

build error! #34

Closed kenculate closed 1 year ago

kenculate commented 1 year ago

cmake -B build -DCMAKE_BUILD_TYPE=Release -- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22621. -- The CUDA compiler identification is NVIDIA 12.1.66 -- The CXX compiler identification is MSVC 19.30.30706.0 -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building with 14 out of 16 available cores -- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1 (found version "12.1") -- Caffe2: CUDA detected: 12.1 -- Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe -- Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1 -- Caffe2: Header version is: 12.1 -- C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/lib/x64/nvrtc.lib shorthash is bac8224f -- USE_CUDNN is set to 0. Compiling without cuDNN support -- Autodetected CUDA architecture(s): 8.6 -- Added CUDA NVCC flags for: -gencode;arch=compute_86,code=sm_86 CMake Warning at external/libtorch/share/cmake/Torch/TorchConfig.cmake:22 (message): static library c10_LIBRARY-NOTFOUND not found. Call Stack (most recent call first): external/libtorch/share/cmake/Torch/TorchConfig.cmake:70 (append_torchlib_if_found) CMakeLists.txt:100 (find_package)

CMake Warning at external/libtorch/share/cmake/Torch/TorchConfig.cmake:22 (message): static library kineto_LIBRARY-NOTFOUND not found. Call Stack (most recent call first): external/libtorch/share/cmake/Torch/TorchConfig.cmake:127 (append_torchlib_if_found) CMakeLists.txt:100 (find_package)

CMake Error at external/libtorch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Torch (missing: TORCH_LIBRARY) Call Stack (most recent call first): external/libtorch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) external/libtorch/share/cmake/Torch/TorchConfig.cmake:190 (find_package_handle_standard_args) CMakeLists.txt:100 (find_package)

-- Configuring incomplete, errors occurred!

MrNeRF commented 1 year ago

Hey, it seems that you are building on Windows. This is currently not supported (only linux). However, you can try if this helps: https://github.com/MrNeRF/gaussian-splatting-cuda/issues/4

Other have reported to run it under WSL. Hope this helps!

MrNeRF commented 1 year ago

Solved for you?

kenculate commented 1 year ago

I will test on wsl and comment here the result

kenculate commented 1 year ago

I spent a few hours trying to install cuda toolkit 11.8 or higher, it is installed now but still there is error

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Aug_15_22:02:13_PDT_2023
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.33191640_0
cmake -B build -DCMAKE_BUILD_TYPE=Release
-- The CUDA compiler identification is NVIDIA 11.5.119
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Building with 14 out of 16 available cores
-- Caffe2: CUDA detected: 11.5
-- Caffe2: CUDA nvcc is: /usr/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr
-- Caffe2: Header version is: 11.5
-- /usr/lib/x86_64-linux-gnu/libnvrtc.so shorthash is 65f2c18b
-- USE_CUDNN is set to 0. Compiling without cuDNN support
-- Autodetected CUDA architecture(s):  8.6
-- Added CUDA NVCC flags for: -gencode;arch=compute_86,code=sm_86
CMake Error at CMakeLists.txt:123 (message):
  This project requires CUDA 11.7 or higher
MrNeRF commented 1 year ago

The error says that it only finds cuda 11.5. So you either have to update the LD_LIBRARY_PATH properly (assuming that your installation is correct) or you can try to edit the CMakeLists.txt and set the requirement to 11.5 (untested). For the first option please follow the cuda Installation guide that NVIDIA provides. It is straight forward but you may not leave any steps out!

kenculate commented 1 year ago

I have completely removed all cuda, and installed using this link

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#installing-cuda-using-conda

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Aug_15_22:02:13_PDT_2023
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.33191640_0
which nvcc
/home/saeid/anaconda3/bin/nvcc
cmake -B build -DCMAKE_BUILD_TYPE=Release
-- The CUDA compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_CUDA_COMPILER:

    /usr/bin/nvcc

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
kenculate commented 1 year ago

UPDATE: after passing the parameter to cmake in command line it changed to this error

cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_COMPILER=/home/saeid/anaconda3/bin/nvcc -DCUDA_INCLUDE_DIRS=/usr/local/cuda-11.7/include -DCUDA_CUDART_LIBRARY=/usr/local/cuda-11.7/lib64
-- Building with 14 out of 16 available cores
-- Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (found version "11.5")
CMake Warning at external/libtorch/share/cmake/Caffe2/public/cuda.cmake:31 (message):
  Caffe2: CUDA cannot be found.  Depending on whether you are building Caffe2
  or a Caffe2 dependent library, the next warning / error will give you more
  info.
Call Stack (most recent call first):
  external/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
  external/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
  CMakeLists.txt:100 (find_package)

CMake Error at external/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:90 (message):
  Your installed Caffe2 version uses CUDA but I cannot find the CUDA
  libraries.  Please set the proper CUDA prefixes and / or install CUDA.
Call Stack (most recent call first):
  external/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
  CMakeLists.txt:100 (find_package)

-- Configuring incomplete, errors occurred!
MrNeRF commented 1 year ago

-- Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (found version "11.5")

Here you go. It clearly states what is going on . Something seems wrong with your CUDA installation. It is akward that it is located within a anaconda path. I would change those lines to 11.5 and see what happens: https://github.com/MrNeRF/gaussian-splatting-cuda/blob/master/CMakeLists.txt#L122-L124

kenculate commented 1 year ago

well I start a fresh wsl, and start installing from scratch, after installing bunch of missing dependencies, I got this error

cmake --build build -- -j [ 6%] Building CXX object external/tinyply/CMakeFiles/tinyply.dir/source/tinyply.cpp.o [ 6%] Building CUDA object external/CMakeFiles/simple-knn.dir/simple-knn/simple_knn.cu.o [ 12%] Building CXX object external/args/CMakeFiles/completion.dir/examples/completion.cxx.o [ 12%] Building CUDA object external/CMakeFiles/simple-knn.dir/simple-knn/spatial.cu.o [ 15%] Building CXX object external/args/CMakeFiles/gitlike.dir/examples/gitlike.cxx.o [ 21%] Building CXX object external/args/CMakeFiles/argstest-windows-h.dir/test/windows_h.cxx.o [ 24%] Building CXX object external/args/CMakeFiles/argstest-multiple-inclusion.dir/test/multiple_inclusion_2.cxx.o [ 24%] Building CXX object external/args/CMakeFiles/argstest-multiple-inclusion.dir/test/multiple_inclusion_1.cxx.o [ 27%] Building CXX object external/args/CMakeFiles/argstest.dir/test.cxx.o [ 30%] Linking CXX executable argstest-multiple-inclusion /home/saeid/gaussian-splatting-cuda/external/simple-knn/simple_knn.cu:23: warning: "CUDACC" redefined 23 #define CUDACC
: note: this is the location of the previous definition [ 30%] Built target argstest-multiple-inclusion /home/saeid/gaussian-splatting-cuda/external/simple-knn/simple_knn.cu:23: warning: "__CUDACC__" redefined 23 | #define __CUDACC__ | : note: this is the location of the previous definition [ 33%] Linking CXX static library libtinyply.a [ 33%] Built target tinyply [ 36%] Building CXX object external/tinyply/CMakeFiles/example.dir/source/example.cpp.o [ 39%] Linking CXX executable argstest-windows-h [ 42%] Linking CXX executable completion [ 42%] Built target argstest-windows-h [ 42%] Built target completion [ 45%] Linking CXX executable example [ 48%] Linking CXX executable gitlike [ 48%] Built target example [ 48%] Built target gitlike [ 51%] Linking CXX executable argstest [ 51%] Built target argstest /home/saeid/gaussian-splatting-cuda/external/simple-knn/spatial.cu: In function ‘at::Tensor distCUDA2(const at::Tensor&)’: /home/saeid/gaussian-splatting-cuda/external/simple-knn/spatial.cu:23:65: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations] 23 | SimpleKNN::knn(P, (float3*)points.contiguous().data(), means.contiguous().data()); | ^ /home/saeid/gaussian-splatting-cuda/external/libtorch/include/ATen/core/TensorBody.h:244:1: note: declared here 244 | T * data() const { | ^ ~~ /home/saeid/gaussian-splatting-cuda/external/simple-knn/spatial.cu:23:103: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations] 23 | SimpleKNN::knn(P, (float3*)points.contiguous().data(), means.contiguous().data()); | ^ /home/saeid/gaussian-splatting-cuda/external/libtorch/include/ATen/core/TensorBody.h:244:1: note: declared here 244 | T * data() const { | ^ ~~ [ 54%] Linking CUDA static library libsimple-knn.a [ 54%] Built target simple-knn [ 57%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/main.cu.o [ 60%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/read_utils.cu.o [ 63%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/camera.cu.o [ 66%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/gaussian.cu.o [ 69%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/loss_monitor.cu.o [ 72%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/image.cu.o [ 75%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/scene.cu.o [ 78%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/camera_utils.cu.o [ 81%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/general_utils.cu.o [ 84%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/rasterizer.cu.o [ 87%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/src/rasterize_points.cu.o [ 90%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/cuda_rasterizer/forward.cu.o [ 96%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/cuda_rasterizer/rasterizer_impl.cu.o [ 96%] Building CUDA object CMakeFiles/gaussian_splatting_cuda.dir/cuda_rasterizer/backward.cu.o Killed make[2]: *** [CMakeFiles/gaussian_splatting_cuda.dir/build.make:167: CMakeFiles/gaussian_splatting_cuda.dir/src/scene.cu.o] Error 137 make[2]: *** Waiting for unfinished jobs.... Killed make[2]: *** [CMakeFiles/gaussian_splatting_cuda.dir/build.make:77: CMakeFiles/gaussian_splatting_cuda.dir/src/main.cu.o] Error 137 make[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/gaussian_splatting_cuda.dir/all] Error 2 make: *** [Makefile:156: all] Error 2
MrNeRF commented 1 year ago

Looks good to me. Its killed. You should maybe build with fewer cpus

kenculate commented 1 year ago

there is 2 error at the end and this file is not being generated $ ./build/gaussian_splatting_cuda -d /path/to/data -o /path/to/output -i 1000

MrNeRF commented 1 year ago

What hardware (gpu) do you use? Compute capability 86 -> 3080, 3090? Not sure, what the problem is as I cannot investigate it myself.

kenculate commented 1 year ago

Processor AMD Ryzen 7 5800X GPU NVIDIA GeForce RTX 3090

MrNeRF commented 1 year ago

In theory it should work and there are people who have made it work. However, as I don't support windows for now and I do not have a win installation on my computer, there is little I can do about it. That might change in the future. I'll close this issue since I won't investigate it further. If you figured it out, you are invited to post a installation guide.

molegod commented 4 months ago

@kenculate Did you ever get this working?

saeid-gholizade-pxo commented 4 months ago

I can't remember, but probably stopped trying!