cvg / nicer-slam

[3DV'24 Best Paper Honorable Mention] NICER-SLAM: Neural Implicit Scene Encoding for RGB SLAM
https://nicer-slam.github.io
Apache License 2.0
155 stars 14 forks source link

Error with rtx 2060 #12

Closed YerldSHO closed 4 months ago

YerldSHO commented 4 months ago

/usr/include/c++/11/type_traits(1406): error: type name is not allowed detected during: instantiation of class "std::is_same<_Tp, _Up> [with _Tp=at::TensorList, _Up=c10::nullopt_t]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/c10/util/Optional.h(567): here instantiation of class "c10::optional [with T=at::TensorList]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h(424): here

/usr/include/c++/11/type_traits(1406): error: type name is not allowed detected during: instantiation of class "std::is_same<_Tp, _Up> [with _Tp=at::TensorList, _Up=c10::nullopt_t]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/c10/util/Optional.h(567): here instantiation of class "c10::optional [with T=at::TensorList]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h(424): here

/usr/include/c++/11/type_traits(1406): error: type name is not allowed detected during: instantiation of class "std::is_same<_Tp, _Up> [with _Tp=at::TensorList, _Up=c10::in_place_t]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/c10/util/Optional.h(570): here instantiation of class "c10::optional [with T=at::TensorList]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h(424): here

/usr/include/c++/11/type_traits(1406): error: type name is not allowed detected during: instantiation of class "std::is_same<_Tp, _Up> [with _Tp=at::TensorList, _Up=c10::in_place_t]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/c10/util/Optional.h(570): here instantiation of class "c10::optional [with T=at::TensorList]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h(424): here

/usr/include/c++/11/type_traits(1406): error: type name is not allowed detected during instantiation of class "std::is_same<_Tp, _Up> [with _Tp=c10::nullopt_t, _Up=c10::optional]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h(424): here

/usr/include/c++/11/type_traits(1406): error: type name is not allowed detected during instantiation of class "std::is_same<_Tp, _Up> [with _Tp=c10::nullopt_t, _Up=c10::optional]" /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h(424): here

Error limit reached. 100 errors detected in the compilation of "/home/alex/projects/nicer-slam/code/hashencoder/src/hashencoder.cu". Compilation terminated. [2/3] c++ -MMD -MF bindings.o.d -DTORCH_EXTENSION_NAME=_hash_encoder_2060 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include -isystem /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/TH -isystem /home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/include/THC -isystem /home/alex/miniconda3/envs/nicer-slam/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -O3 -std=c++17 -c /home/alex/projects/nicer-slam/code/hashencoder/src/bindings.cpp -o bindings.o ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1808, in _run_ninja_build subprocess.run( File "/home/alex/miniconda3/envs/nicer-slam/lib/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "training/exp_runner.py", line 43, in trainrunner = SLAMRunner( File "/home/alex/projects/nicer-slam/code/../code/training/volsdf_train.py", line 109, in init self.model = utils.get_class(self.conf.get_string("train.model_class"))( File "/home/alex/projects/nicer-slam/code/../code/utils/general.py", line 156, in get_class m = import(module) File "/home/alex/projects/nicer-slam/code/../code/model/network.py", line 11, in from model.base_networks import ImplicitNetworkGrid_COMBINE, RenderingNetwork File "/home/alex/projects/nicer-slam/code/../code/model/base_networks.py", line 3, in from hashencoder.hashgrid import HashEncoder File "/home/alex/projects/nicer-slam/code/../code/hashencoder/init.py", line 1, in from .hashgrid import HashEncoder File "/home/alex/projects/nicer-slam/code/../code/hashencoder/hashgrid.py", line 11, in from .backend import _backend File "/home/alex/projects/nicer-slam/code/../code/hashencoder/backend.py", line 32, in _backend = load(name=f'_hashencoder{device}', File "/home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1202, in load return _jit_compile( File "/home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1425, in _jit_compile _write_ninja_file_and_build_library( File "/home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1537, in _write_ninja_file_and_build_library _run_ninja_build( File "/home/alex/miniconda3/envs/nicer-slam/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1824, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension '_hash_encoder_2060'

I am using a rtx 2060 6GB video card. I encountered such a problem, the visualizer works fine, but training the model gives errors, first that there is no 2060 in the config, which I solved, and now this, does anyone know the solution? I also tried on colab but the program just went into waiting mode

OnHaDe commented 4 months ago

Are you on Ubuntu 22.04? Try using gcc-10

sudo apt-get install -y gcc-10 g++-10
export CC=/usr/bin/gcc-10
export CXX=/usr/bin/g++-10
export CUDAHOSTCXX=/usr/bin/g++-10
Zzh2000 commented 4 months ago

There seems to be some problem with the compilation of the hashencoder on 2060. The hashencoder module is adapted from torch ngp repo. By the way, I would not recommend using 2060 since the GPU memory is too limited.