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

Installation error on Ubuntu 18.04 with PyTorch 0.4.1, CUDA 9.1, GCC 7.3.0 #28

Closed
jbohnslav opened this issue Oct 10, 2018 · 1 comment

Comments

@jbohnslav
Copy link

I have PyTorch installed already.

python --version: Python 3.7.0
nvcc --version: release 9.1, V9.1.85
gcc --version: 7.3.0

There are pages and pages of errors, but here is the beginning of the output:

running install
running bdist_egg
running egg_info
writing neural_renderer.egg-info/PKG-INFO
writing dependency_links to neural_renderer.egg-info/dependency_links.txt
writing requirements to neural_renderer.egg-info/requires.txt
writing top-level names to neural_renderer.egg-info/top_level.txt
reading manifest file 'neural_renderer.egg-info/SOURCES.txt'
writing manifest file 'neural_renderer.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'neural_renderer.cuda.load_textures' extension
gcc -pthread -B /home/jim/anaconda3/envs/pytorch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include -I/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/TH -I/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/include -I/home/jim/anaconda3/envs/pytorch/include/python3.7m -c neural_renderer/cuda/load_textures_cuda.cpp -o build/temp.linux-x86_64-3.7/neural_renderer/cuda/load_textures_cuda.o -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/pybind11/cast.h:16:0,
                 from /home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/pybind11/attr.h:13,
                 from /home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/pybind11/pybind11.h:43,
                 from /home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/torch/torch.h:5,
                 from neural_renderer/cuda/load_textures_cuda.cpp:1:
/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/pybind11/detail/internals.h:82:34: warning: ‘int PyThread_create_key()’ is deprecated [-Wdeprecated-declarations]
     decltype(PyThread_create_key()) tstate = 0; // Usually an int but a long on Cygwin64 with Python 3.x

There are a bunch of warnings that int PyThread_create_key() is deprecated, then...

/usr/bin/nvcc -I/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include -I/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/TH -I/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/include -I/home/jim/anaconda3/envs/pytorch/include/python3.7m -c neural_renderer/cuda/load_textures_cuda_kernel.cu -o build/temp.linux-x86_64-3.7/neural_renderer/cuda/load_textures_cuda_kernel.o -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' -std=c++11
/usr/include/c++/6/tuple: In instantiation of ‘static constexpr bool std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = {std::tuple<at::Tensor, at::Tensor, at::Tensor>}; bool <anonymous> = true; _Elements = {at::Tensor, at::Tensor, at::Tensor}]’:
/usr/include/c++/6/tuple:626:248:   required by substitution of ‘template<class ... _UElements, typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), at::Tensor, at::Tensor, at::Tensor>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (3ul >= 1)), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {std::tuple<at::Tensor, at::Tensor, at::Tensor>}; typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), at::Tensor, at::Tensor, at::Tensor>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (3ul >= 1)), bool>::type <anonymous> = <missing>]’
/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/ATen/TensorMethods.h:646:36:   required from here
/usr/include/c++/6/tuple:483:67: error: mismatched argument pack lengths while expanding ‘std::is_constructible<_Elements, _UElements&&>’
       return __and_<is_constructible<_Elements, _UElements&&>...>::value;
                                                                   ^~~~~
/usr/include/c++/6/tuple:484:1: error: body of constexpr function ‘static constexpr bool std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = {std::tuple<at::Tensor, at::Tensor, at::Tensor>}; bool <anonymous> = true; _Elements = {at::Tensor, at::Tensor, at::Tensor}]’ not a return-statement
     }
 ^
/usr/include/c++/6/tuple: In instantiation of ‘static constexpr bool std::_TC<<anonymous>, _Elements>::_ImplicitlyMoveConvertibleTuple() [with _UElements = {std::tuple<at::Tensor, at::Tensor, at::Tensor>}; bool <anonymous> = true; _Elements = {at::Tensor, at::Tensor, at::Tensor}]’:
/usr/include/c++/6/tuple:626:362:   required by substitution of ‘template<class ... _UElements, typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), at::Tensor, at::Tensor, at::Tensor>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (3ul >= 1)), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {std::tuple<at::Tensor, at::Tensor, at::Tensor>}; typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), at::Tensor, at::Tensor, at::Tensor>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), at::Tensor, at::Tensor, at::Tensor>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (3ul >= 1)), bool>::type <anonymous> = <missing>]’
/home/jim/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/include/ATen/TensorMethods.h:646:36:   required from here
/usr/include/c++/6/tuple:489:65: error: mismatched argument pack lengths while expanding ‘std::is_convertible<_UElements&&, _Elements>’
       return __and_<is_convertible<_UElements&&, _Elements>...>::value;
                                                                 ^~~~~

There are many pages of similar errors, which I've omitted here for length.

Does anyone know how to fix these errors? I assume it's some versioning problem with CUDA, GCC, etc.

@jbohnslav
Copy link
Author

I fixed it. To those who have similar bugs: the problem was my CUDA 9.1 installation. Apparently this is a CUDA bug, fixed in 9.2. To install CUDA 9.2 on a Ubuntu machine, here is one useful guide and here is another

@nkolot nkolot closed this as completed Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants