I have a manually-installed version of CUDA 13.1 on my machine, which runs Devuan GNU/Linux Freia. After updating my distribution packages recently, compilations of C++ programs including some of the CUDA headers fails, with the following error message:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h(206): error: exception
specification is incompatible with that of previous function "rsqrt"
(declared at line 629 of
/usr/local/cuda-13.1/bin/../targets/x86_64-linux/include/crt/math_functions.h)
extern double rsqrt (double __x) noexcept (true); extern double __rsqrt (double __x) noexcept (true);
in mathcalls.h I have that line saying:
__MATHCALL (rsqrt,, (_Mdouble_ __x));
and in /usr/local/cuda-13.1/bin/../targets/x86_64-linux/include/crt/math_functions.h I have:
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x);
I'm guessing that macro expands into a noexcept(true), or whatever, which is incompatible with what NVIDIA defines in the CUDA header.
I tried switching to GCC 14, or 13, instead of my distribution's default (15), but that doesn't help.
- Why is this happening? I realize it's probably because of my distro package upgrade, but why exactly?
- How do I circumvent this problem?
Notes:
- This doesn't happen with CUDA 13.2
- This reminds me of a similar issue I (and everyone) was facing with exception specification of some trig functions like
__sinpi()and__cospi(); I hope I don't have to start patching CUDA again :-(