NVIDIA / cuCollections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: After commit from PR #340 getting compilation errors

aavbsouza opened this issue · comments

Is this a duplicate?

Type of Bug

Silent Failure

Describe the bug

cmake --build build
[1/2] Building CUDA object _deps/cucollections-build/tests/CMakeFiles/STATIC_MAP_TEST.dir/static_map/custom_type_test.cu.o
FAILED: _deps/cucollections-build/tests/CMakeFiles/STATIC_MAP_TEST.dir/static_map/custom_type_test.cu.o 
/usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -I/workspaces/rmm/build/_deps/cucollections-src/tests -I/workspaces/rmm/build/_deps/catch2-src/src/catch2/.. -I/workspaces/rmm/build/_deps/catch2-build/generated-includes -I/workspaces/rmm/build/_deps/cucollections-src/include -I/workspaces/rmm/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include -I/workspaces/rmm/build/_deps/thrust-src -I/workspaces/rmm/build/_deps/thrust-src/dependencies/cub -isystem /usr/local/cuda/include -O3 -DNDEBUG -std=c++20 --generate-code=arch=compute_70,code=[compute_70,sm_70] --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_90,code=[compute_90,sm_90] --compiler-options=-Wall --compiler-options=-Wextra --expt-extended-lambda --expt-relaxed-constexpr -Xcompiler -Wno-subobject-linkage -MD -MT _deps/cucollections-build/tests/CMakeFiles/STATIC_MAP_TEST.dir/static_map/custom_type_test.cu.o -MF _deps/cucollections-build/tests/CMakeFiles/STATIC_MAP_TEST.dir/static_map/custom_type_test.cu.o.d -x cu -c /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu -o _deps/cucollections-build/tests/CMakeFiles/STATIC_MAP_TEST.dir/static_map/custom_type_test.cu.o
/workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/bitwise_compare.cuh(79): error: invalid alignment value specified by attribute
    alignas(sizeof(T)) T __lhs{lhs};
            ^
          detected during:
            instantiation of "__nv_bool cuco::detail::bitwise_compare(const T &, const T &) [with T=large_key_type<int32_t>]" at line 533 of /workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/static_map.inl
            instantiation of "__nv_bool cuco::static_map<Key, Value, Scope, Allocator>::device_mutable_view::insert(const CG &, const cuco::static_map<Key, Value, Scope, Allocator>::device_mutable_view::value_type &, Hash, KeyEqual) noexcept [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>, Scope=cuda::std::__4::__detail::thread_scope_device, Allocator=cuco::cuda_allocator<char>, CG=cooperative_groups::__v1::thread_block_tile<4U, cooperative_groups::__v1::thread_block>, Hash=hash_custom_key, KeyEqual=custom_key_equals]" at line 158 of /workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/static_map_kernels.cuh
            instantiation of "void cuco::detail::insert<block_size,tile_size,InputIt,atomicT,viewT,Hash,KeyEqual>(InputIt, int64_t, atomicT *, viewT, Hash, KeyEqual) [with block_size=128UL, tile_size=4U, InputIt=thrust::transform_iterator<lambda [](auto)->auto, thrust::counting_iterator<int, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::use_default, thrust::use_default>, atomicT=cuda::__4::atomic<std::size_t, cuda::std::__4::__detail::thread_scope_device>, viewT=cuco::static_map<large_key_type<int32_t>, value_pair_type<int32_t>, cuda::std::__4::__detail::thread_scope_device, cuco::cuda_allocator<char>>::device_mutable_view, Hash=hash_custom_key, KeyEqual=custom_key_equals]" at line 110 of /workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/static_map.inl
            instantiation of "void cuco::static_map<Key, Value, Scope, Allocator>::insert(InputIt, InputIt, Hash, KeyEqual, cudaStream_t) [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>, Scope=cuda::std::__4::__detail::thread_scope_device, Allocator=cuco::cuda_allocator<char>, InputIt=thrust::transform_iterator<lambda [](auto)->auto, thrust::counting_iterator<int, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::use_default, thrust::use_default>, Hash=hash_custom_key, KeyEqual=custom_key_equals]" at line 141 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu
            instantiation of "void CATCH2_INTERNAL_TEMPLATE_TEST_0<Key,Value>() [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>]" at line 100 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu
            instantiation of "void <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::reg_test(<unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<Key, Value>, Catch::NameAndTags) [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>]" at line 100 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu
            instantiation of "<unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::CATCH2_INTERNAL_TEMPLATE_TEST_1<Types...>::CATCH2_INTERNAL_TEMPLATE_TEST_1() [with Types=<<unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<key_pair_type<int64_t>, value_pair_type<int32_t>>, <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<key_pair_type<int64_t>, value_pair_type<int64_t>>, <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<large_key_type<int32_t>, value_pair_type<int32_t>>, <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<key_pair_type<int32_t>, value_pair_type<int32_t>>>]" at line 100 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu

/workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/bitwise_compare.cuh(80): error: invalid alignment value specified by attribute
    alignas(sizeof(T)) T __rhs{rhs};
            ^
          detected during:
            instantiation of "__nv_bool cuco::detail::bitwise_compare(const T &, const T &) [with T=large_key_type<int32_t>]" at line 533 of /workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/static_map.inl
            instantiation of "__nv_bool cuco::static_map<Key, Value, Scope, Allocator>::device_mutable_view::insert(const CG &, const cuco::static_map<Key, Value, Scope, Allocator>::device_mutable_view::value_type &, Hash, KeyEqual) noexcept [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>, Scope=cuda::std::__4::__detail::thread_scope_device, Allocator=cuco::cuda_allocator<char>, CG=cooperative_groups::__v1::thread_block_tile<4U, cooperative_groups::__v1::thread_block>, Hash=hash_custom_key, KeyEqual=custom_key_equals]" at line 158 of /workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/static_map_kernels.cuh
            instantiation of "void cuco::detail::insert<block_size,tile_size,InputIt,atomicT,viewT,Hash,KeyEqual>(InputIt, int64_t, atomicT *, viewT, Hash, KeyEqual) [with block_size=128UL, tile_size=4U, InputIt=thrust::transform_iterator<lambda [](auto)->auto, thrust::counting_iterator<int, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::use_default, thrust::use_default>, atomicT=cuda::__4::atomic<std::size_t, cuda::std::__4::__detail::thread_scope_device>, viewT=cuco::static_map<large_key_type<int32_t>, value_pair_type<int32_t>, cuda::std::__4::__detail::thread_scope_device, cuco::cuda_allocator<char>>::device_mutable_view, Hash=hash_custom_key, KeyEqual=custom_key_equals]" at line 110 of /workspaces/rmm/build/_deps/cucollections-src/include/cuco/detail/static_map.inl
            instantiation of "void cuco::static_map<Key, Value, Scope, Allocator>::insert(InputIt, InputIt, Hash, KeyEqual, cudaStream_t) [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>, Scope=cuda::std::__4::__detail::thread_scope_device, Allocator=cuco::cuda_allocator<char>, InputIt=thrust::transform_iterator<lambda [](auto)->auto, thrust::counting_iterator<int, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::use_default, thrust::use_default>, Hash=hash_custom_key, KeyEqual=custom_key_equals]" at line 141 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu
            instantiation of "void CATCH2_INTERNAL_TEMPLATE_TEST_0<Key,Value>() [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>]" at line 100 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu
            instantiation of "void <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::reg_test(<unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<Key, Value>, Catch::NameAndTags) [with Key=large_key_type<int32_t>, Value=value_pair_type<int32_t>]" at line 100 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu
            instantiation of "<unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::CATCH2_INTERNAL_TEMPLATE_TEST_1<Types...>::CATCH2_INTERNAL_TEMPLATE_TEST_1() [with Types=<<unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<key_pair_type<int64_t>, value_pair_type<int32_t>>, <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<key_pair_type<int64_t>, value_pair_type<int64_t>>, <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<large_key_type<int32_t>, value_pair_type<int32_t>>, <unnamed>::ns_CATCH2_INTERNAL_TEMPLATE_TEST_1::Nttp<key_pair_type<int32_t>, value_pair_type<int32_t>>>]" at line 100 of /workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu

2 errors detected in the compilation of "/workspaces/rmm/build/_deps/cucollections-src/tests/static_map/custom_type_test.cu".

``

### How to Reproduce

```cmake
FetchContent_Declare(
    cuCollections
    GIT_REPOSITORY https://github.com/NVIDIA/cuCollections.git
    GIT_TAG 6548a1ed0e59387f4411ba08e0e869811bc38690
)
FetchContent_MakeAvailable(cuCollections)

Expected behavior

Code compile without issues

Compiler: gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0

Reproduction link

No response

Operating System

container image: docker.io/nvidia/cuda:12.2.0-devel-ubuntu22.04

nvidia-smi output

No response

NVCC version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Jun_13_19:16:58_PDT_2023
Cuda compilation tools, release 12.2, V12.2.91
Build cuda_12.2.r12.2/compiler.32965470_0

The same problem also happens with g++-11

We haven't thoroughly tested our code with -std=c++20 yet. @aavbsouza is it OK to build with -std=c++17 in your case?

Hello @PointKernel it create some problems on other sections of the code

@aavbsouza Can you please provide the full error log or share the image you are using? docker.io/nvidia/cuda:12.2.0-devel-ubuntu22.04 doesn't have tools like git or cmake thus I assume you have a custom image on top of it.

Hello @PointKernel I am using a custom image based on this dockerfile

FROM docker.io/nvidia/cuda:12.2.0-devel-ubuntu22.04

RUN  apt-get update -y        && \
     DEBIAN_FRONTEND=noninteractive apt-get install -y  \
     clang-15                    \
     clang-format-15             \
     gcc-12                      \
     g++-12                      \
     gcc                         \
     libc++-15-dev               \
     libc++abi1-15               \
     libomp5-15                  \
     libomp-15-dev               \
     ninja-build                 \
     autoconf                    \
     automake                    \
     libtool                     \
     pkg-config                  \
     zip                         \
     valgrind                    \
     libgmp-dev                  \
     libmpfr-dev                 \
     git                         \
     vim                         \
     curl                        \
     python3-pip              && \
     rm -rf /var/lib/apt/lists/* && \
     update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 50 && \
     update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 50 && \
     update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 50       && \
     update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 50             && \
     update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 50

RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh -o cmake.sh && \
    chmod +x cmake.sh && \
    ./cmake.sh --prefix=/usr/local --skip-license && \
    rm -rf ./cmake.sh