Torch7: UBUNTU 16.04 ./install.sh failed : /usr/local/cuda/include/thrust/detail/reference.inl(127): error: no default constructor exists for class

Created on 20 Jan 2017  路  3Comments  路  Source: torch/torch7

hi all ,
I met this error when i install torch :

[ 6%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathScan.cu.o
/usr/local/cuda/include/thrust/detail/reference.inl(127): error: no default constructor exists for class "thrust::detail::execute_with_allocator"
detected during:
instantiation of "void thrust::reference::assign_from(OtherPointer) [with Element=signed long, Pointer=thrust::pointer, thrust::use_default, thrust::use_default>, Derived=thrust::use_default, OtherPointer=const signed long *]"
(65): here
instantiation of "thrust::reference::derived_type &thrust::reference::operator=(const thrust::reference::value_type &) [with Element=signed long, Pointer=thrust::pointer, thrust::use_default, thrust::use_default>, Derived=thrust::use_default]"
/usr/local/cuda/include/thrust/system/cuda/detail/reduce_intervals.inl(150): here
instantiation of "void thrust::system::cuda::detail::commutative_reduce_intervals_closure::operator()() [with InputIterator=thrust::transform_iterator, signed long>, thrust::device_ptr, signed long, thrust::use_default>, OutputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, BinaryFunction=thrust::plus, Decomposition=thrust::system::detail::internal::uniform_decomposition, Context=thrust::system::cuda::detail::detail::blocked_thread_array]"
/usr/local/cuda/include/thrust/system/cuda/detail/detail/launch_closure.inl(52): here
instantiation of "void thrust::system::cuda::detail::detail::launch_closure_by_value(Closure) [with Closure=thrust::system::cuda::detail::commutative_reduce_intervals_closure, signed long>, thrust::device_ptr, signed long, thrust::use_default>, thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, thrust::plus, thrust::system::detail::internal::uniform_decomposition, thrust::system::cuda::detail::detail::blocked_thread_array>]"
/usr/local/cuda/include/thrust/system/cuda/detail/detail/launch_closure.inl(81): here
instantiation of "thrust::system::cuda::detail::detail::closure_launcher_base::launch_function_t thrust::system::cuda::detail::detail::closure_launcher_base::get_launch_function() [with Closure=thrust::system::cuda::detail::commutative_reduce_intervals_closure, signed long>, thrust::device_ptr, signed long, thrust::use_default>, thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, thrust::plus, thrust::system::detail::internal::uniform_decomposition, thrust::system::cuda::detail::detail::blocked_thread_array>, launch_by_value=true]"
/usr/local/cuda/include/thrust/system/cuda/detail/detail/launch_closure.inl(206): here
[ 2 instantiation contexts not shown ]
instantiation of "thrust::system::cuda::detail::detail::launch_calculator::launch_calculator() [with Closure=thrust::system::cuda::detail::commutative_reduce_intervals_closure, signed long>, thrust::device_ptr, signed long, thrust::use_default>, thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, thrust::plus, thrust::system::detail::internal::uniform_decomposition, thrust::system::cuda::detail::detail::blocked_thread_array>]"
/usr/local/cuda/include/thrust/system/cuda/detail/reduce_intervals.inl(189): here
instantiation of "void thrust::system::cuda::detail::reduce_intervals(thrust::system::cuda::detail::execution_policy &, InputIterator, OutputIterator, BinaryFunction, Decomposition) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator=thrust::transform_iterator, signed long>, thrust::device_ptr, signed long, thrust::use_default>, OutputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, BinaryFunction=thrust::plus, Decomposition=thrust::system::detail::internal::uniform_decomposition]"
/usr/local/cuda/include/thrust/system/cuda/detail/copy_if.inl(201): here
instantiation of "OutputIterator thrust::system::cuda::detail::copy_if_detail::copy_if(thrust::system::cuda::detail::execution_policy &, InputIterator1, InputIterator1, InputIterator2, OutputIterator, Predicate) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator1=thrust::counting_iterator, InputIterator2=thrust::device_ptr, OutputIterator=thrust::permutation_iterator, thrust::transform_iterator>::stride_functor, thrust::counting_iterator, thrust::use_default, thrust::use_default>>, Predicate=NonZeroOp]"
/usr/local/cuda/include/thrust/system/cuda/detail/copy_if.inl(251): here
instantiation of "OutputIterator thrust::system::cuda::detail::copy_if(thrust::system::cuda::detail::execution_policy &, InputIterator1, InputIterator1, InputIterator2, OutputIterator, Predicate) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator1=thrust::counting_iterator, InputIterator2=thrust::device_ptr, OutputIterator=thrust::permutation_iterator, thrust::transform_iterator>::stride_functor, thrust::counting_iterator, thrust::use_default, thrust::use_default>>, Predicate=NonZeroOp]"
/usr/local/cuda/include/thrust/detail/copy_if.inl(60): here
instantiation of "OutputIterator thrust::copy_if(const thrust::detail::execution_policy_base &, InputIterator1, InputIterator1, InputIterator2, OutputIterator, Predicate) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator1=thrust::counting_iterator, InputIterator2=thrust::device_ptr, OutputIterator=thrust::permutation_iterator, thrust::transform_iterator>::stride_functor, thrust::counting_iterator, thrust::use_default, thrust::use_default>>, Predicate=NonZeroOp]"
/home/sojoyoo/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(313): here

/usr/local/cuda/include/thrust/detail/reference.inl(98): error: no default constructor exists for class "thrust::detail::execute_with_allocator"
detected during:
instantiation of "thrust::reference::operator thrust::reference::value_type() const [with Element=signed long, Pointer=thrust::pointer, thrust::use_default, thrust::use_default>, Derived=thrust::use_default]"
/usr/local/cuda/include/thrust/system/cuda/detail/bulk/algorithm/scan.hpp(514): here
instantiation of "RandomAccessIterator2 thrust::system::cuda::detail::bulk_::inclusive_scan(thrust::system::cuda::detail::bulk_::concurrent_group, size> &, RandomAccessIterator1, RandomAccessIterator1, RandomAccessIterator2, BinaryFunction) [with size=512UL, grainsize=3UL, RandomAccessIterator1=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, RandomAccessIterator2=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, BinaryFunction=thrust::plus]"
/usr/local/cuda/include/thrust/system/cuda/detail/scan.inl(55): here
instantiation of "void thrust::system::cuda::detail::scan_detail::inclusive_scan_n::operator()(ConcurrentGroup &, InputIterator, Size, OutputIterator, BinaryFunction) [with ConcurrentGroup=thrust::system::cuda::detail::bulk_::concurrent_group, 512UL>, InputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, Size=signed long, OutputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, BinaryFunction=thrust::plus]"
/usr/local/cuda/include/thrust/system/cuda/detail/bulk/detail/apply_from_tuple.hpp(83): here
instantiation of "void thrust::system::cuda::detail::bulk_::detail::apply_from_tuple(Function, const thrust::tuple &) [with Function=thrust::system::cuda::detail::scan_detail::inclusive_scan_n, Arg1=thrust::system::cuda::detail::bulk_::concurrent_group, 512UL> &, Arg2=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, Arg3=signed long, Arg4=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, Arg5=thrust::plus]"
/usr/local/cuda/include/thrust/system/cuda/detail/bulk/detail/closure.hpp(50): here
instantiation of "void thrust::system::cuda::detail::bulk_::detail::closure::operator()() [with Function=thrust::system::cuda::detail::scan_detail::inclusive_scan_n, Tuple=thrust::tuple, 512UL> &, thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, signed long, thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, thrust::plus, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>]"
/usr/local/cuda/include/thrust/system/cuda/detail/bulk/detail/cuda_task.hpp(58): here
[ 11 instantiation contexts not shown ]
instantiation of "OutputIterator thrust::system::cuda::detail::inclusive_scan(thrust::system::cuda::detail::execution_policy &, InputIterator, InputIterator, OutputIterator, AssociativeOperator) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, OutputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, AssociativeOperator=thrust::plus]"
/usr/local/cuda/include/thrust/detail/scan.inl(63): here
instantiation of "OutputIterator thrust::inclusive_scan(const thrust::detail::execution_policy_base &, InputIterator, InputIterator, OutputIterator, AssociativeOperator) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, OutputIterator=thrust::detail::normal_iterator, thrust::use_default, thrust::use_default>>, AssociativeOperator=thrust::plus]"
/usr/local/cuda/include/thrust/system/cuda/detail/copy_if.inl(204): here
instantiation of "OutputIterator thrust::system::cuda::detail::copy_if_detail::copy_if(thrust::system::cuda::detail::execution_policy &, InputIterator1, InputIterator1, InputIterator2, OutputIterator, Predicate) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator1=thrust::counting_iterator, InputIterator2=thrust::device_ptr, OutputIterator=thrust::permutation_iterator, thrust::transform_iterator>::stride_functor, thrust::counting_iterator, thrust::use_default, thrust::use_default>>, Predicate=NonZeroOp]"
/usr/local/cuda/include/thrust/system/cuda/detail/copy_if.inl(251): here
instantiation of "OutputIterator thrust::system::cuda::detail::copy_if(thrust::system::cuda::detail::execution_policy &, InputIterator1, InputIterator1, InputIterator2, OutputIterator, Predicate) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator1=thrust::counting_iterator, InputIterator2=thrust::device_ptr, OutputIterator=thrust::permutation_iterator, thrust::transform_iterator>::stride_functor, thrust::counting_iterator, thrust::use_default, thrust::use_default>>, Predicate=NonZeroOp]"
/usr/local/cuda/include/thrust/detail/copy_if.inl(60): here
instantiation of "OutputIterator thrust::copy_if(const thrust::detail::execution_policy_base &, InputIterator1, InputIterator1, InputIterator2, OutputIterator, Predicate) [with DerivedPolicy=thrust::detail::execute_with_allocator, InputIterator1=thrust::counting_iterator, InputIterator2=thrust::device_ptr, OutputIterator=thrust::permutation_iterator, thrust::transform_iterator>::stride_functor, thrust::counting_iterator, thrust::use_default, thrust::use_default>>, Predicate=NonZeroOp]"
/home/sojoyoo/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(313): here

2 errors detected in the compilation of "/tmp/tmpxft_000019e9_00000000-7_THCTensorMath.cpp1.ii".
CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message):
Error generating file
/home/sojoyoo/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:2778: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o' failed
make[2]: * [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1
make[2]:
姝e湪绛夊緟鏈畬鎴愮殑浠诲姟....
CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed
make[1]:
[lib/THC/CMakeFiles/THC.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *
[all] Error 2

Error: Build error: Failed building.

My OS is Ubuntu 16.04 LTS,compiler are gcc 5.4.1 and g++ 5.4.1.
I installed CUDA 8 and cudnn 5.1 successful.
Did someone met this error before?

Most helpful comment

I think i found the solution .
What I did to get it working was the following:
1) Renam /path_to_your_cuda/include/thrust/ to ./thrust_old for backup.
2) git clone thrust
3) git checkout 1.8.3
4) enter "thrust" folder you just cloned
5) copy the "thrust" sub-folder to your_cuda_path/include/
This worked for me.

All 3 comments

I met with the same error a few days back, I used alternate installation, no fix discovered yet.

I think i found the solution .
What I did to get it working was the following:
1) Renam /path_to_your_cuda/include/thrust/ to ./thrust_old for backup.
2) git clone thrust
3) git checkout 1.8.3
4) enter "thrust" folder you just cloned
5) copy the "thrust" sub-folder to your_cuda_path/include/
This worked for me.

guys, I get the same problem, and finally, find that it's the problem of cuda8.
I re-install cuda8 my ubuntu16.04, and it's work!

If it doesn't work, maybe you need to reinstall your GPU drive too, cause I did. I don't know whether they are related.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

i55code picture i55code  路  4Comments

visonpon picture visonpon  路  3Comments

omair-kg picture omair-kg  路  12Comments

lucasarb picture lucasarb  路  3Comments

stonebig picture stonebig  路  7Comments