Closed K20qhuy closed 1 month ago
@jackroos i need your help ASAP.
Thank you.
Updates: i have gcc g++ 7.5 but still fundamentally got the same base errors as above.
Solved: Currently on Ubuntu 20.04, i had to install gcc/g++ 6.5 (lower than the former - 7.5) so that I can succeed building MSDA (sh ./make.sh).
To those who use cuda 10.1, this might helps.
P/S: use the unofficial way to install gcc 6.5, see https://gist.github.com/zuyu/7d5682a5c75282c596449758d21db5ed?permalink_comment_id=3807040#gistcomment-3807040
With Cuda=10.1, pytorch=1.5.1 torchvision=0.6.1 I get this error below after sh make.sh
`(deformable_detr_233) bmvt@thunderbolt:~/Desktop/Huy_SVthayChau/233_DETopK/models/ops$ sh make.sh running build running build_py running build_ext building 'MultiScaleDeformableAttention' extension Emitting ninja build file /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/build/temp.linux-x86_64-cpython-38/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/1] /usr/local/cuda-10.1/bin/nvcc -DWITH_CUDA -I/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include/TH -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-10.1/include -I/home/bmvt/anaconda3/envs/deformable_detr_233/include/python3.8 -c -c /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu -o /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/build/temp.linux-x86_64-cpython-38/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14 FAILED: /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/build/temp.linux-x86_64-cpython-38/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.o /usr/local/cuda-10.1/bin/nvcc -DWITH_CUDA -I/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include/TH -I/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-10.1/include -I/home/bmvt/anaconda3/envs/deformable_detr_233/include/python3.8 -c -c /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu -o /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/build/temp.linux-x86_64-cpython-38/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14 /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(261): warning: variable "q_col" was declared but never referenced detected during instantiation of "void ms_deformable_im2col_cuda(cudaStream_t, const scalar_t , const int64_t , const int64_t , const scalar_t , const scalar_t , int, int, int, int, int, int, int, scalar_t ) [with scalar_t=double]" /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu(64): here
/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(762): warning: variable "q_col" was declared but never referenced detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t , const scalar_t , const int64_t , const int64_t , const scalar_t , const scalar_t , int, int, int, int, int, int, int, scalar_t , scalar_t , scalar_t *) [with scalar_t=double]" /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here
/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(872): warning: variable "q_col" was declared but never referenced detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t , const scalar_t , const int64_t , const int64_t , const scalar_t , const scalar_t , int, int, int, int, int, int, int, scalar_t , scalar_t , scalar_t *) [with scalar_t=double]" /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here
/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(331): warning: variable "q_col" was declared but never referenced detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t , const scalar_t , const int64_t , const int64_t , const scalar_t , const scalar_t , int, int, int, int, int, int, int, scalar_t , scalar_t , scalar_t *) [with scalar_t=double]" /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here
/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(436): warning: variable "q_col" was declared but never referenced detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t , const scalar_t , const int64_t , const int64_t , const scalar_t , const scalar_t , int, int, int, int, int, int, int, scalar_t , scalar_t , scalar_t *) [with scalar_t=double]" /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here
/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(544): warning: variable "q_col" was declared but never referenced detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t , const scalar_t , const int64_t , const int64_t , const scalar_t , const scalar_t , int, int, int, int, int, int, int, scalar_t , scalar_t , scalar_t *) [with scalar_t=double]" /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here
/home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(649): warning: variable "q_col" was declared but never referenced detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t , const scalar_t , const int64_t , const int64_t , const scalar_t , const scalar_t , int, int, int, int, int, int, int, scalar_t , scalar_t , scalar_t *) [with scalar_t=double]" /home/bmvt/Desktop/Huy_SVthayChau/233_DETopK/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here
/usr/include/c++/8/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/8/bits/basic_string.tcc:578:28: required from ‘static _CharT std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t; _CharT = char16_t; _Traits = std::char_traits; _Alloc = std::allocator]’
/usr/include/c++/8/bits/basic_string.h:5052:20: required from ‘static _CharT std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::false_type) [with _InIterator = const char16_t; _CharT = char16_t; _Traits = std::char_traits; _Alloc = std::allocator]’
/usr/include/c++/8/bits/basic_string.h:5073:24: required from ‘static _CharT std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t; _CharT = char16_t; _Traits = std::char_traits; _Alloc = std::allocator]’
/usr/include/c++/8/bits/basic_string.tcc:656:134: required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT , std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/8/bits/basic_string.h:6725:95: required from here
/usr/include/c++/8/bits/basic_string.tcc:1067:1: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits; _Alloc = std::allocator]’ without object
p->_M_set_sharable();
^ ; _Alloc = std::allocator; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/8/bits/basic_string.tcc:578:28: required from ‘static _CharT std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t; _CharT = char32_t; _Traits = std::char_traits; _Alloc = std::allocator]’
/usr/include/c++/8/bits/basic_string.h:5052:20: required from ‘static _CharT std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t; _CharT = char32_t; _Traits = std::char_traits; _Alloc = std::allocator]’
/usr/include/c++/8/bits/basic_string.h:5073:24: required from ‘static _CharT std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t; _CharT = char32_t; _Traits = std::char_traits; _Alloc = std::allocator]’
/usr/include/c++/8/bits/basic_string.tcc:656:134: required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT , std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/8/bits/basic_string.h:6730:95: required from here
/usr/include/c++/8/bits/basic_string.tcc:1067:1: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits; _Alloc = std::allocator]’ without object
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1509, in _run_ninja_build
subprocess.run(
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
~~~~~ /usr/include/c++/8/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traitsDuring handling of the above exception, another exception occurred:
Traceback (most recent call last): File "setup.py", line 62, in
setup(
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/init.py", line 108, in setup
return distutils.core.setup(**attrs)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
self.run_command(cmd)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/dist.py", line 945, in run_command
super().run_command(command)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
cmd_obj.run()
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/dist.py", line 945, in run_command
super().run_command(command)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
cmd_obj.run()
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 93, in run
_build_ext.run(self)
File "/home/bmvt/.local/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
self.build_extensions()
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 649, in build_extensions
build_ext.build_extensions(self)
File "/home/bmvt/.local/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
self._build_extensions_serial()
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
self.build_extension(ext)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 254, in build_extension
_build_ext.build_extension(self, ext)
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 560, in build_extension
objects = self.compiler.compile(
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 469, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1228, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/bmvt/anaconda3/envs/deformable_detr_233/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1529, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error compiling objects for extension`