alpaka-group / cupla

C++ User interface for the Platform independent Library Alpaka :arrows_clockwise:
Other
37 stars 18 forks source link

cupla does not build with GCC 10 and CUDA 11 n C++17 mode #190

Closed fwyzard closed 3 years ago

fwyzard commented 4 years ago

For example, the matrixMul example builds find with GCC 9, CUDA 11, in C++17 mode:

/usr/local/cuda/bin/nvcc \
  -ccbin /usr/bin/g++-9 \
  -std=c++17 \
  -m64 \
  -x=cu /home/fwyzard/src/alpaka-group/cupla/src/stream.cpp \
  -c \
  -o /home/fwyzard/src/alpaka-group/cupla/example/CUDASamples/matrixMul/build/CMakeFiles/cupla.dir/__/__/__/src/cupla_generated_stream.cpp.o \
  -DCUPLA_STREAM_ASYNC_ENABLED=1 \
  -DALPAKA_ACC_GPU_CUDA_ENABLED \
  -DALPAKA_DEBUG=0 \
  -DBOOST_ALL_NO_LIB \
  --expt-extended-lambda \
  --expt-relaxed-constexpr \
  --generate-code=arch=compute_50,code=compute_50 \
  --use_fast_math \
  --ftz=false \
  -Xcudafe=--display_error_number \
  -Xcudafe=--diag_suppress=esa_on_defaulted_function_ignored \
  -DNVCC \
  -I/home/fwyzard/src/alpaka-group/cupla/include \
  -I/usr/local/cuda/include \
  -I/home/fwyzard/src/alpaka-group/cupla/alpaka/include \
  -I/usr/include \
  -Wno-deprecated-gpu-targets

The same command using g++-10 instead of g++-9 failes with

/usr/include/c++/10/tuple(566): error #1921: pack "_UElements" does not have the same number of elements as "_Elements"
          detected during:
            instantiation of "__nv_bool std::tuple<_Elements...>::__nothrow_constructible<_UElements...>() [with _Elements=<const int &>, _UElements=<>]" 
/usr/include/c++/10/bits/stl_map.h(502): here
            instantiation of "std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type &std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const std::map<_Key, _Tp, _Compare, _Alloc>::key_type &) [with _Key=int, _Tp=std::unique_ptr<cupla::cupla_cuda_async::AccDev, std::default_delete<cupla::cupla_cuda_async::AccDev>>, _Compare=std::less<int>, _Alloc=std::allocator<std::pair<const int, std::unique_ptr<cupla::cupla_cuda_async::AccDev, std::default_delete<cupla::cupla_cuda_async::AccDev>>>>]" 
/home/fwyzard/src/alpaka-group/cupla/include/cupla/manager/Device.hpp(117): here
            instantiation of "auto cupla::cupla_cuda_async::manager::Device<T_DeviceType>::device(int)->cupla::cupla_cuda_async::manager::Device<T_DeviceType>::DeviceType & [with T_DeviceType=cupla::cupla_cuda_async::AccDev]" 
/home/fwyzard/src/alpaka-group/cupla/include/cupla/manager/Device.hpp(158): here
            instantiation of "auto cupla::cupla_cuda_async::manager::Device<T_DeviceType>::current()->cupla::cupla_cuda_async::manager::Device<T_DeviceType>::DeviceType & [with T_DeviceType=cupla::cupla_cuda_async::AccDev]" 
/home/fwyzard/src/alpaka-group/cupla/include/cupla/manager/Stream.hpp(157): here
            instantiation of "auto cupla::cupla_cuda_async::manager::Stream<T_DeviceType, T_QueueType>::createNewStream(cuplaStream_t)->cuplaStream_t [with T_DeviceType=cupla::cupla_cuda_async::AccDev, T_QueueType=cupla::cupla_cuda_async::AccStream]" 
/home/fwyzard/src/alpaka-group/cupla/include/cupla/manager/Stream.hpp(72): here
            instantiation of "auto cupla::cupla_cuda_async::manager::Stream<T_DeviceType, T_QueueType>::create()->cuplaStream_t [with T_DeviceType=cupla::cupla_cuda_async::AccDev, T_QueueType=cupla::cupla_cuda_async::AccStream]" 
/home/fwyzard/src/alpaka-group/cupla/src/stream.cpp(43): here

1 error detected in the compilation of "/home/fwyzard/src/alpaka-group/cupla/src/stream.cpp".

Some more tests: g++-9 with -std=c++14 --> ok g++-9 with -std=c++17 --> ok g++-10 with -std=c++14 --> ok g++-10 with -std=c++17 --> error (see above)

bernhardmgruber commented 4 years ago

I could reproduce this issue exactly. Googling points you to exactly one result, which leads here: https://github.com/NVIDIA/thrust/issues/1268#issuecomment-695119871

A later comment mentions a bug report to the compiler team has been filed. So I guess we have to wait for NVIDIA to fix this :S

psychocoderHPC commented 3 years ago

@fwyzard sry for the late response

Could you try if this error still exists in the current dev branch. With the latest dev and included alpaka 0.6.0 and CUDA 11.2 I do not see the issue:

docker run --runtime=nvidia -it registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci-cuda112-gccpic:1.2
git clone -b dev https://github.com/alpaka-group/cupla.git
cmake -DCMAKE_CXX_COMPILER=g++-10 -DALPAKA_ACC_GPU_CUDA_ENABLE=ON -DALPAKA_CUDA_ARCH=70  cupla/example/CUDASamples/matrixMul/ -DBOOST_ROOT=/opt/boost/1.70.0/
fwyzard commented 3 years ago

hi @psychocoderHPC , thanks for the suggestion.

Do I just pick the HEAD of the dev branch together with Alpaka 0.6.0 ?

fwyzard commented 3 years ago

hi @psychocoderHPC , I can confirm that using

the problem is solved.

psychocoderHPC commented 3 years ago

hi @psychocoderHPC , I can confirm that using

  • CUDA 11.2.1
  • GCC 10.2.0 with -std=c++17
  • Alpaka 0.6.0
  • Cupla HEAD of the dev branch

the problem is solved.

Thanks for testing, I will close this issue.