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

Update to GCC 11 #12868

Merged
merged 5 commits into from
Mar 6, 2023
Merged

Update to GCC 11 #12868

merged 5 commits into from
Mar 6, 2023

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Feb 28, 2023

This PR updates builds to use GCC 11.

@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 28, 2023
@github-actions github-actions bot added the conda label Feb 28, 2023
@bdice bdice self-assigned this Feb 28, 2023
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Mar 1, 2023
@bdice
Copy link
Contributor Author

bdice commented Mar 1, 2023

Error log shows an issue with nvbench and -Wmaybe-uninitialized.

sccache $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++ -DFMT_HEADER_ONLY=1 -DFMT_SHARED -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO -DSPDLOG_FMT_EXTERNAL -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -I$SRC_DIR/cpp/benchmarks -I$SRC_DIR/cpp -I$SRC_DIR/cpp/src -I$SRC_DIR/cpp/build/_deps/gbench-src/src/../include -I$SRC_DIR/cpp/build/_deps/nvbench-src -I$SRC_DIR/cpp/build/_deps/nvbench-build -I$SRC_DIR/cpp/build/_deps/dlpack-src/include -I$SRC_DIR/cpp/build/_deps/jitify-src -I$SRC_DIR/cpp/include -I$SRC_DIR/cpp/build/include -I$SRC_DIR/cpp/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include -I$SRC_DIR/cpp/build/_deps/thrust-src -I$SRC_DIR/cpp/build/_deps/thrust-src/dependencies/cub -I$BUILD_PREFIX/include -isystem $SRC_DIR/cpp/build/_deps/gtest-src/googlemock/include -isystem $SRC_DIR/cpp/build/_deps/gtest-src/googlemock -isystem $SRC_DIR/cpp/build/_deps/gtest-src/googletest/include -isystem $SRC_DIR/cpp/build/_deps/gtest-src/googletest -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/libcudf-split- -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -isystem /usr/local/cuda/include -O3 -DNDEBUG -fPIE -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations -Wno-deprecated-declarations -pthread -MD -MT benchmarks/CMakeFiles/SORT_NVBENCH.dir/sort/sort_structs.cpp.o -MF benchmarks/CMakeFiles/SORT_NVBENCH.dir/sort/sort_structs.cpp.o.d -o benchmarks/CMakeFiles/SORT_NVBENCH.dir/sort/sort_structs.cpp.o -c $SRC_DIR/cpp/benchmarks/sort/sort_structs.cpp
In file included from $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/benchmark_base.cuh:22,
                 from $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/benchmark.cuh:21,
                 from $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/nvbench.cuh:21,
                 from $SRC_DIR/cpp/benchmarks/sort/nested_types_common.hpp:24,
                 from $SRC_DIR/cpp/benchmarks/sort/sort_structs.cpp:17:
In member function 'bool nvbench::device_info::operator==(const nvbench::device_info&) const',
    inlined from 'constexpr std::__optional_eq_t<_Tp, _Up> std::operator==(const std::optional<_Tp>&, const std::optional<_Up>&) [with _Tp = nvbench::device_info; _Up = nvbench::device_info]' at $BUILD_PREFIX/x86_64-conda-linux-gnu/include/c++/11.3.0/optional:1049:28,
    inlined from 'nvbench::runner<nvbench::benchmark<nvbench_sort_struct_line_33> >::run_device(const std::optional<nvbench::device_info>&)::<lambda(auto:48)> [with auto:48 = nvbench::wrapped_type<nvbench::type_list<> >]' at $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/runner.cuh:96:38,
    inlined from 'void nvbench::tl::detail::foreach(std::index_sequence<_Idx ...>, Functor&&) [with TypeList = nvbench::type_list<nvbench::type_list<> >; Functor = nvbench::runner<nvbench::benchmark<nvbench_sort_struct_line_33> >::run_device(const std::optional<nvbench::device_info>&)::<lambda(auto:48)>; long unsigned int ...Is = {0}]' at $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/detail/type_list_impl.cuh:94:6,
    inlined from 'void nvbench::tl::detail::foreach(Functor&&) [with TypeList = nvbench::type_list<nvbench::type_list<> >; Functor = nvbench::runner<nvbench::benchmark<nvbench_sort_struct_line_33> >::run_device(const std::optional<nvbench::device_info>&)::<lambda(auto:48)>]' at $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/detail/type_list_impl.cuh:103:28,
    inlined from 'void nvbench::tl::foreach(Functor&&) [with TypeList = nvbench::type_list<nvbench::type_list<> >; Functor = nvbench::runner<nvbench::benchmark<nvbench_sort_struct_line_33> >::run_device(const std::optional<nvbench::device_info>&)::<lambda(auto:48)>]' at $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/type_list.cuh:140:28,
    inlined from 'void nvbench::runner<BenchmarkType>::run_device(const std::optional<nvbench::device_info>&) [with BenchmarkType = nvbench::benchmark<nvbench_sort_struct_line_33>]' at $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/runner.cuh:87:39,
    inlined from 'void nvbench::runner<BenchmarkType>::run() [with BenchmarkType = nvbench::benchmark<nvbench_sort_struct_line_33>]' at $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/runner.cuh:66:23:
$SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/device_info.cuh:196:80: error: '*(const nvbench::device_info*)((char*)&<unnamed> + offsetof(const std::optional<nvbench::device_info>,std::optional<nvbench::device_info>::<unnamed>.std::_Optional_base<nvbench::device_info, true, true>::<unnamed>)).nvbench::device_info::m_id' may be used uninitialized [-Werror=maybe-uninitialized]
  196 |   [[nodiscard]] bool operator==(const device_info &o) const { return m_id == o.m_id; }
      |                                                                              ~~^~~~
In file included from $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/benchmark.cuh:24,
                 from $SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/nvbench.cuh:21,
                 from $SRC_DIR/cpp/benchmarks/sort/nested_types_common.hpp:24,
                 from $SRC_DIR/cpp/benchmarks/sort/sort_structs.cpp:17:
$SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/runner.cuh: In member function 'void nvbench::runner<BenchmarkType>::run() [with BenchmarkType = nvbench::benchmark<nvbench_sort_struct_line_33>]':
$SRC_DIR/cpp/build/_deps/nvbench-src/nvbench/runner.cuh:66:23: note: '<anonymous>' declared here
   66 |       this->run_device(std::nullopt);
      |       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

I pushed 3911e48 to try and disable this warning. I'm not sure if it's a real issue in nvbench or a compiler bug. Reminds me of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635.

@davidwendt
Copy link
Contributor

I verified this locally. It is strange that it only fails for me in when compiling cpp/benchmarks/sort/sort_structs.cpp and not cpp/benchmarks/sort/sort_lists.cpp which has the same includes. I was able to get the build to pass by just wrapping the #include "nested_types_common.hpp" line in sort_structs.cpp with these pragma statements.

#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#include "nested_types_common.hpp"
#pragma GCC diagnostic pop

It definitely seems like a bug in the compiler somewhere.

@bdice
Copy link
Contributor Author

bdice commented Mar 2, 2023

@davidwendt I agree -- I looked at the sort_structs.cpp vs. sort_lists.cpp yesterday and concluded that it was a problem with how nvbench was being invoked. That particular part of the header-only library might not be used in sort_lists.cpp, only in sort_structs.cpp? I think it's clearer to put the "shielding" around <nvbench/nvbench.cuh> rather than "nested_types_common.hpp" because the problem is in nvbench, not our code.

I agree either option could work, so if you feel strongly that we should go the other way and guard "nested_types_common.hpp" in only sort_structs.cpp, feel free to push that change.

@davidwendt
Copy link
Contributor

I think it's clearer to put the "shielding" around <nvbench/nvbench.cuh> rather than "nested_types_common.hpp" because the problem is in nvbench, not our code.

I agree with this. We should keep it as you have coded it here.

@bdice bdice marked this pull request as ready for review March 2, 2023 02:28
@bdice bdice requested review from a team as code owners March 2, 2023 02:28
@bdice bdice requested review from elstehle and ttnghia March 2, 2023 02:28
@bdice bdice added the 5 - DO NOT MERGE Hold off on merging; see PR for details label Mar 2, 2023
@bdice
Copy link
Contributor Author

bdice commented Mar 2, 2023

This is ready for review. We will merge once all RAPIDS repos are ready to migrate.

@pxLi pxLi mentioned this pull request Mar 6, 2023
3 tasks
@bdice bdice removed the 5 - DO NOT MERGE Hold off on merging; see PR for details label Mar 6, 2023
@bdice
Copy link
Contributor Author

bdice commented Mar 6, 2023

/merge

@rapids-bot rapids-bot bot merged commit f00baad into rapidsai:branch-23.04 Mar 6, 2023
rapids-bot bot pushed a commit that referenced this pull request Mar 7, 2023
related to #2568

update JNI dockerfile default to gcc 11.

mark as draft for review first, will verify after #12868

Authors:
  - Peixin (https://github.com/pxLi)

Approvers:
  - Jason Lowe (https://github.com/jlowe)

URL: #12881
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants