"identifier '_Float32' is undefined" etc. (CUDA 12.2.0, GCC 13.1)

I get hundreds of these sorts of errors when trying to build CTranslate2 against CUDA 12.2.0 with GCC 13.1

/usr/include/bits/mathcalls.h(101): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(104): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(107): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(110): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(53): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(55): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(57): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(59): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(62): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(64): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(66): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(71): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(73): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(75): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(79): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(85): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(87): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(89): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(95): error: identifier "_Float32" is undefined
/usr/include/bits/mathcalls.h(98): error: identifier "_Float32" is undefined
/usr/include/stdlib.h(141): error: identifier "_Float32" is undefined
/usr/include/stdlib.h(147): error: identifier "_Float64" is undefined
/usr/include/stdlib.h(153): error: identifier "_Float128" is undefined
/usr/include/stdlib.h(159): error: identifier "_Float32x" is undefined
/usr/include/stdlib.h(165): error: identifier "_Float64x" is undefined
/usr/include/stdlib.h(234): error: identifier "_Float32" is undefined
/usr/include/stdlib.h(240): error: identifier "_Float64" is undefined
/usr/include/stdlib.h(246): error: identifier "_Float128" is undefined
/usr/include/stdlib.h(252): error: identifier "_Float32x" is undefined
/usr/include/stdlib.h(258): error: identifier "_Float64x" is undefined
/usr/include/stdlib.h(317): error: identifier "_Float32" is undefined
/usr/include/stdlib.h(324): error: identifier "_Float64" is undefined
/usr/include/stdlib.h(331): error: identifier "_Float128" is undefined
/usr/include/stdlib.h(338): error: identifier "_Float32x" is undefined
/usr/include/stdlib.h(345): error: identifier "_Float64x" is undefined
Error limit reached.
100 errors detected in the compilation of "/tmp/CTranslate2/src/ops/topp_mask_gpu.cu".
Compilation terminated.
CMake Error at ctranslate2_generated_topp_mask_gpu.cu.o.Release.cmake:280 (message):
  Error generating file
  /tmp/usr/CTranslate2/build/CMakeFiles/ctranslate2.dir/src/ops/./ctranslate2_generated_topp_mask_gpu.cu.o


make[2]: *** [CMakeFiles/ctranslate2.dir/build.make:14853: CMakeFiles/ctranslate2.dir/src/ops/ctranslate2_generated_topp_mask_gpu.cu.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/ctranslate2.dir/all] Fehler 2
make: *** [Makefile:136: all] Fehler 2

Is there a workaround to this that doesn’t involve downgrading GCC? (The docs say 12.2 is the latest supported version…)

My question is similar to the closed question “Strange errors after system gcc upgraded to 13.1.1,” but the answers there didn’t seem relevant to my scenario here.

Not that I’m aware of, though nvcc is supported by a different team so I’m not always current on their development. You’ll likely need to wait until they add support for GNU 13.1. Though, feel free to post on the nvcc forums as well: CUDA NVCC Compiler - NVIDIA Developer Forums

For the nvc++ question you pointed to, my team was able to get this particular issue addressed in our 23.5 release, but will take a bit before we can say interoperability with GNU 13.1 is fully supported.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.