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

Compilation failure in absl/container/internal/inlined_vector.h with NVCC #1099

Closed
suryakiran opened this issue Jan 23, 2022 · 8 comments
Closed
Labels

Comments

@suryakiran
Copy link

Describe the bug

When including absl/container/flat_hash_set.h in a cuda source file and compiling the source file with nvcc (11.4.1) and gcc (9.3.0), the compilation fails with the following error.

/usr/local/packages/rez/abseil/2021.11.2/gcc-9.3.0/include/absl/container/internal/inlined_vector.h:907:97: error: expected ‘;’ before ‘}’ token

Steps to reproduce the bug

Include absl/container/flat_hash_set.h in a cuda source file and compile with nvcc. Attached CMakeLists.txt, test.cpp (as test.cpp.txt) and test.cu (as test.cu.txt) to reproduce the problem.

It's important that we are able to reproduce the problem that you are
experiencing. Please provide all code and relevant steps to reproduce the
problem, including your BUILD/CMakeLists.txt file and build commands. Links
to a GitHub branch or godbolt.org that demonstrate the
problem are also helpful.

What version of Abseil are you using?
Abseil LTS 20211102

What operating system and version are you using
5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

If you are using a Linux distribution please include the name and version of the
distribution as well.

Ubuntu 20.04

What compiler and version are you using?

Please include the output of gcc -v or clang -v, or the equivalent for your
compiler.

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

What build system are you using?
cmake version 3.21.1
CMakeLists.txt
test.cpp.txt
test.cu.txt

Please include the output of bazel --version or cmake --version, or the
equivalent for your build system.

Additional context

Add any other context about the problem here.

@suryakiran suryakiran added the bug label Jan 23, 2022
@Liu-xiandong
Copy link

I get the same error

@derekmauro
Copy link
Member

I'm guessing the reason TensorFlow has this patch https://github.com/tensorflow/tensorflow/blob/da83132aba8d2b6a3c3a9b2e662868eb24f4dd1e/third_party/absl/com_google_absl_fix_mac_and_nvcc_build.patch#L243-L256 is to deal with this issue.

I'm not setup with the compiler you are using, but if someone could verify that this fixes the issue I will patch our code.

@suryakiran
Copy link
Author

This patch is working.

@derekmauro
Copy link
Member

Thank you for confirming. A patch is coming.

@derekmauro
Copy link
Member

Fixed in 5202173.

@suryakiran
Copy link
Author

Thanks much for the fix. I'd like to know if there is any patch for the LTS coming up or should I use the master ?

@derekmauro
Copy link
Member

This won't be patched in the LTS. We actually recommend living at head and updating frequently.

@suryakiran
Copy link
Author

Thanks for the confirmation. And once again, thank you for the patch. I'll use the master.

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