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/strings/internal/string_constant.h with Cuda compiler #1105

Closed
suryakiran opened this issue Feb 3, 2022 · 2 comments
Labels

Comments

@suryakiran
Copy link

suryakiran commented Feb 3, 2022

Describe the bug

Include a clear and concise description of what the problem is, including what
you expected to happen, and what actually happened.

When including flat_hash_set.h file in a cuda source file, the cuda compiler is throwing error
absl/strings/internal/string_constant.h(43): error: expression must have a constant value

This is with cuda 11.6 (gcc compiler). The same is working fine with Cuda 11.4.1 (gcc compiler)
I'm not sure if this is nvcc bug or abseil bug.

Steps to reproduce the bug

The sample code is provided in the github repo.
Github Repo

What version of Abseil are you using?
master: 5202173ca7671ebe241cb4d9447dc4b1f2d3ec10

What operating system and version are you using
5.4.0-96-generic #109 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)

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Fri_Dec_17_18:16:03_PST_2021
Cuda compilation tools, release 11.6, V11.6.55
Build cuda_11.6.r11.6/compiler.30794723_0

What build system are you using?
cmake version 3.21.1

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 Feb 3, 2022
@derekmauro
Copy link
Member

It looks like TensorFlow also has a patch for this one that I can import.

@suryakiran
Copy link
Author

This patch seems to be working on both linux (gcc 9.3) and windows (vs 2019) platforms with cuda 11.6

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

2 participants