-
Notifications
You must be signed in to change notification settings - Fork 475
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
[CUDA][build] error: identifier "__reference_constructs_from_temporary" is undefined #20915
Comments
Hi @apivovarov I've tried reproducing the issue, but I got a successful build.
These are the options in my
Please note that two last lines are added to download CUDA 12.6.0 redistributions and to use GCC13 for the build. |
Thank you, Yulia! Alternatively we can resolve the issue by adding
Investigation DetailsUpon examining the failed compilation command, I noticed it uses the following wrapper:
This wrapper determines whether to call The nvcc version used in this scenario was:
It appears this version of nvcc (12.5) incorrectly reports support for the built-in function #if __has_builtin(__reference_constructs_from_temporary) However, the compiler (nvcc 12.5) doesn't fully support this built-in, leading to a compilation error. Solution: Use Clang Instead of NVCCClang (version 18) compiles the code without any issues related to
This results in the following
Key Changes in xla_configure.bazelrcbefore:
now:
By switching to Clang as the CUDA compiler, the issue with |
TL;DR Solution
We can resolve the
__reference_constructs_from_temporary
issue by switching the CUDA compiler fromnvcc
toclang-18
.For example, in XLA, you can add the
--cuda_compiler
CLANG flag to theconfigure.py
command:OS: Ubuntu 24.04
compiler: clang-18
cuda-12-6
branch: main 79ada3d Dec 27
To reproduce
Error:
workaround:
edit
comment out line 2335
xla_configure.bazelrc
Related issues:
The text was updated successfully, but these errors were encountered: