解决方式
找到:
/usr/include/c++/8/bits/basic_string.tcc:1067 :
找到:__p->_M_set_sharable()
改为:(*__p)._M_set_sharable()
cuda部分报错如下:
fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include/TH -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /root/miniconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_75,code=sm_75 --compiler-options '-fPIC' -std=c++14 -c xx/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
/usr/include/c++/7/bits/basic_string.tcc(1067): error: expression must have pointer type
detected during:
instantiation of "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<char16_t>, _Alloc=std::allocator<char16_t>]"
(578): here
instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_FwdIterator, _FwdIterator, const _Alloc &, std::forward_iterator_tag) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>, _FwdIterator=const char16_t *]"
/usr/include/c++/7/bits/basic_string.h(5042): here
instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc &, std::__false_type) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>, _InIterator=const char16_t *]"
/usr/include/c++/7/bits/basic_string.h(5063): here
instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc &) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>, _InIterator=const char16_t *]"
(657): here
instantiation of "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<char16_t>, _Alloc=std::allocator<char16_t>]"
/usr/include/c++/7/bits/basic_string.h(6688): here
/usr/include/c++/7/bits/basic_string.tcc(1067): error: expression must have pointer type
detected during:
instantiation of "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_traits<char32_t>, _Alloc=std::allocator<char32_t>]"
(578): here
instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_FwdIterator, _FwdIterator, const _Alloc &, std::forward_iterator_tag) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>, _FwdIterator=const char32_t *]"
/usr/include/c++/7/bits/basic_string.h(5042): here
instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc &, std::__false_type) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>, _InIterator=const char32_t *]"
/usr/include/c++/7/bits/basic_string.h(5063): here
instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc &) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>, _InIterator=const char32_t *]"
(657): here
instantiation of "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<char32_t>, _Alloc=std::allocator<char32_t>]"
/usr/include/c++/7/bits/basic_string.h(6693): here
2 errors detected in the compilation of "/tmp/tmpxft_00000e6a_00000000-6_fused_bias_act_kernel.cpp1.ii".
ninja: build stopped: subcommand failed
参考资料:
Error: Cannot call member function without object. · Issue #42 · traveller59/spconv · GitHub