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

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

Closed
fwyzard opened this issue Nov 16, 2020 · 5 comments
Closed

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

fwyzard opened this issue Nov 16, 2020 · 5 comments
Labels
Milestone

Comments

@fwyzard
Copy link
Contributor

fwyzard commented Nov 16, 2020

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
Copy link
Member

I could reproduce this issue exactly. Googling points you to exactly one result, which leads here:
NVIDIA/thrust#1268 (comment)

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
Copy link
Member

@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/

@psychocoderHPC psychocoderHPC added this to the 0.3.0 milestone Feb 17, 2021
@fwyzard
Copy link
Contributor Author

fwyzard commented Feb 19, 2021

hi @psychocoderHPC ,
thanks for the suggestion.

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

@fwyzard
Copy link
Contributor Author

fwyzard commented Feb 21, 2021

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.

@psychocoderHPC
Copy link
Member

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.

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

No branches or pull requests

3 participants