currennt icon indicating copy to clipboard operation
currennt copied to clipboard

Can't compile with CUDA 10.0

Open EmilPi opened this issue 5 years ago • 2 comments

Trying to compile https://github.com/che-shr-cat/currennt/ with CUDA 10.0:

git clone https://github.com/che-shr-cat/currennt/
mkdir build && cd build && cmake -DCUDA_cublas_device_LIBRARY=/usr/local/cuda/targets/x86_64-linux/lib/libcublas.so .. && make

yields

...
[ 61%] Building NVCC (Device) object CMakeFiles/currennt.dir/currennt_lib/src/optimizers/currennt_generated_Optimizer.cu.o
Scanning dependencies of target currennt
[ 65%] Building CXX object CMakeFiles/currennt.dir/currennt_lib/src/Configuration.cpp.o
[ 69%] Building CXX object CMakeFiles/currennt.dir/currennt_lib/src/NeuralNetwork.cpp.o
In file included from /usr/local/cuda-10.0/include/thrust/detail/reference.h:173:0,
                 from /usr/local/cuda-10.0/include/thrust/memory.h:25,
                 from /usr/local/cuda-10.0/include/thrust/detail/allocator/temporary_allocator.h:23,
                 from /usr/local/cuda-10.0/include/thrust/detail/temporary_array.h:40,
                 from /usr/local/cuda-10.0/include/thrust/system/cuda/detail/internal/copy_cross_system.h:41,
                 from /usr/local/cuda-10.0/include/thrust/system/cuda/detail/copy.h:99,
                 from /usr/local/cuda-10.0/include/thrust/system/detail/adl/copy.h:42,
                 from /usr/local/cuda-10.0/include/thrust/detail/copy.inl:22,
                 from /usr/local/cuda-10.0/include/thrust/detail/copy.h:90,
                 from /usr/local/cuda-10.0/include/thrust/detail/allocator/copy_construct_range.inl:21,
                 from /usr/local/cuda-10.0/include/thrust/detail/allocator/copy_construct_range.h:46,
                 from /usr/local/cuda-10.0/include/thrust/detail/contiguous_storage.inl:22,
                 from /usr/local/cuda-10.0/include/thrust/detail/contiguous_storage.h:161,
                 from /usr/local/cuda-10.0/include/thrust/detail/vector_base.h:29,
                 from /usr/local/cuda-10.0/include/thrust/host_vector.h:26,
                 from /home/misc/archive/currennt/currennt_lib/src/layers/../Types.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/layers/Layer.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/layers/InputLayer.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.cpp:23:
/usr/local/cuda-10.0/include/thrust/detail/reference.inl: In instantiation of ‘thrust::reference<Element, Pointer, Derived>::value_type thrust::reference<Element, Pointer, Derived>::strip_const_get_value(const System&) const [with System = thrust::cuda_cub::tag; Element = const char; Pointer = thrust::device_ptr<const char>; Derived = thrust::device_reference<const char>; thrust::reference<Element, Pointer, Derived>::value_type = char]’:
/usr/local/cuda-10.0/include/thrust/detail/reference.inl:105:31:   required from ‘thrust::reference<Element, Pointer, Derived>::value_type thrust::reference<Element, Pointer, Derived>::convert_to_value_type(System*) const [with System = thrust::cuda_cub::tag; Element = const char; Pointer = thrust::device_ptr<const char>; Derived = thrust::device_reference<const char>; thrust::reference<Element, Pointer, Derived>::value_type = char]’
/usr/local/cuda-10.0/include/thrust/detail/reference.inl:122:31:   required from ‘thrust::reference<Element, Pointer, Derived>::operator thrust::reference<Element, Pointer, Derived>::value_type() const [with Element = const char; Pointer = thrust::device_ptr<const char>; Derived = thrust::device_reference<const char>; thrust::reference<Element, Pointer, Derived>::value_type = char]’
/home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.cpp:244:9:   required from ‘std::vector<std::vector<std::vector<float> > > NeuralNetwork<TDevice>::getOutputs() [with TDevice = Gpu]’
/home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.cpp:267:16:   required from here
/usr/local/cuda-10.0/include/thrust/detail/reference.inl:137:73: error: void value not ignored as it ought to be
   return get_value(thrust::detail::derived_cast(non_const_system), m_ptr);
                                                                         ^
In file included from /usr/local/cuda-10.0/include/thrust/system/detail/generic/for_each.h:27:0,
                 from /usr/local/cuda-10.0/include/thrust/detail/for_each.inl:26,
                 from /usr/local/cuda-10.0/include/thrust/for_each.h:279,
                 from /usr/local/cuda-10.0/include/thrust/system/detail/generic/transform.inl:19,
                 from /usr/local/cuda-10.0/include/thrust/system/detail/generic/transform.h:105,
                 from /usr/local/cuda-10.0/include/thrust/detail/transform.inl:25,
                 from /usr/local/cuda-10.0/include/thrust/transform.h:724,
                 from /usr/local/cuda-10.0/include/thrust/system/detail/generic/copy.inl:23,
                 from /usr/local/cuda-10.0/include/thrust/system/detail/generic/copy.h:58,
                 from /usr/local/cuda-10.0/include/thrust/detail/copy.inl:21,
                 from /usr/local/cuda-10.0/include/thrust/detail/copy.h:90,
                 from /usr/local/cuda-10.0/include/thrust/detail/allocator/copy_construct_range.inl:21,
                 from /usr/local/cuda-10.0/include/thrust/detail/allocator/copy_construct_range.h:46,
                 from /usr/local/cuda-10.0/include/thrust/detail/contiguous_storage.inl:22,
                 from /usr/local/cuda-10.0/include/thrust/detail/contiguous_storage.h:161,
                 from /usr/local/cuda-10.0/include/thrust/detail/vector_base.h:29,
                 from /usr/local/cuda-10.0/include/thrust/host_vector.h:26,
                 from /home/misc/archive/currennt/currennt_lib/src/layers/../Types.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/layers/Layer.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/layers/InputLayer.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.hpp:26,
                 from /home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.cpp:23:
/usr/local/cuda-10.0/include/thrust/system/detail/generic/for_each.h: In instantiation of ‘void thrust::system::detail::generic::get_value(thrust::execution_policy<Derived>&, Pointer) [with DerivedPolicy = thrust::cuda_cub::tag; Pointer = thrust::device_ptr<const char>]’:
/usr/local/cuda-10.0/include/thrust/detail/reference.inl:137:19:   required from ‘thrust::reference<Element, Pointer, Derived>::value_type thrust::reference<Element, Pointer, Derived>::strip_const_get_value(const System&) const [with System = thrust::cuda_cub::tag; Element = const char; Pointer = thrust::device_ptr<const char>; Derived = thrust::device_reference<const char>; thrust::reference<Element, Pointer, Derived>::value_type = char]’
/usr/local/cuda-10.0/include/thrust/detail/reference.inl:105:31:   required from ‘thrust::reference<Element, Pointer, Derived>::value_type thrust::reference<Element, Pointer, Derived>::convert_to_value_type(System*) const [with System = thrust::cuda_cub::tag; Element = const char; Pointer = thrust::device_ptr<const char>; Derived = thrust::device_reference<const char>; thrust::reference<Element, Pointer, Derived>::value_type = char]’
/usr/local/cuda-10.0/include/thrust/detail/reference.inl:122:31:   required from ‘thrust::reference<Element, Pointer, Derived>::operator thrust::reference<Element, Pointer, Derived>::value_type() const [with Element = const char; Pointer = thrust::device_ptr<const char>; Derived = thrust::device_reference<const char>; thrust::reference<Element, Pointer, Derived>::value_type = char]’
/home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.cpp:244:9:   required from ‘std::vector<std::vector<std::vector<float> > > NeuralNetwork<TDevice>::getOutputs() [with TDevice = Gpu]’
/home/misc/archive/currennt/currennt_lib/src/NeuralNetwork.cpp:267:16:   required from here
/usr/local/cuda-10.0/include/thrust/detail/static_assert.h:71:13: error: invalid application of ‘sizeof’ to incomplete type ‘thrust::detail::STATIC_ASSERTION_FAILURE<false>’
       sizeof(::thrust::detail::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
             ^
/usr/local/cuda-10.0/include/thrust/system/detail/generic/for_each.h:49:3: note: in expansion of macro ‘THRUST_STATIC_ASSERT’
   THRUST_STATIC_ASSERT( (thrust::detail::depend_on_instantiation<InputIterator, false>::value) );
   ^~~~~~~~~~~~~~~~~~~~
CMakeFiles/currennt.dir/build.make:198: recipe for target 'CMakeFiles/currennt.dir/currennt_lib/src/NeuralNetwork.cpp.o' failed
make[2]: *** [CMakeFiles/currennt.dir/currennt_lib/src/NeuralNetwork.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/currennt.dir/all' failed
make[1]: *** [CMakeFiles/currennt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

EmilPi avatar Feb 20 '20 10:02 EmilPi

This issue seems to be related: https://github.com/thrust/thrust/issues/526 I am not familiar with thrust to understand this :)

EmilPi avatar Feb 20 '20 10:02 EmilPi

This is true also after using #4 #5 changes.

EmilPi avatar Feb 20 '20 10:02 EmilPi