Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build Pytorch3d from source code (error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1) #1009

Closed
yangsenius opened this issue Dec 28, 2021 · 2 comments
Assignees
Labels
installation Installation questions or issues

Comments

@yangsenius
Copy link

🐛 Bugs / Unexpected behaviors

/opt/rh/devtoolset-7/root/usr/include/c++/7/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_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/opt/rh/devtoolset-7/root/usr/include/c++/7/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<char32_t>; _Alloc = std::allocator<char32_t>]’
/opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.h:5033: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<char32_t>; _Alloc = std::allocator<char32_t>]’
/opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.h:5054: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<char32_t>; _Alloc = std::allocator<char32_t>]’
/opt/rh/devtoolset-7/root/usr/include/c++/7/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<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.h:6681:95: required from here
/opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

Instructions To Reproduce the Issue:

I git clone the latest PyTorch3d lib (2021.12.28).

and run the command

CUDA_HOME=/usr/local/cuda CUB_HOME=/tmp/software/cub-1.10.0 FORCE_CUDA=1 PYTORCH3D_NO_NINJA=1 pip install -e .

My Environments are:

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
nvcc --version Cuda compilation tools, release 10.1, V10.1.105
Python 3.6.8
PyTorch 1.7.1_cu10.1

How can I solve this issue?

@bottler
Copy link
Contributor

bottler commented Dec 28, 2021

This error seems to be specific to CUDA 10.1, certain versions of nvcc and certain gcc/library versions. Specifically the compiler cannot cope with the standard library. See e.g. pytorch/vision#1893 and traveller59/spconv#42 which have some suggestions including just changing versions.

@bottler bottler self-assigned this Dec 28, 2021
@bottler bottler added the installation Installation questions or issues label Dec 28, 2021
@yangsenius
Copy link
Author

@bottler Thank you very much! I tried this suggestion with only changing one line of the code and I Successfully installed pytorch3d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Installation questions or issues
Projects
None yet
Development

No branches or pull requests

2 participants