If you are facing errors like the following when trying to complie applications with NVCC / CUDA 13.1 on Fedora 43
/usr/include/bits/mathcalls.h(206): error: exception specification is
incompatible with that of previous function "rsqrt" (declared at line 629
of
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.h)
extern double rsqrt (double __x) noexcept (true); extern double __rsqrt (double __x) noexcept (true);
^
/usr/include/bits/mathcalls.h(206): error: exception specification is
incompatible with that of previous function "rsqrtf" (declared at line 653
of
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.h)
extern float rsqrtf (float __x) noexcept (true); extern float __rsqrtf (float __x) noexcept (true);
^
Its likely due to the fact that glibc’s <math.h> declares rsqrt with noexcept(true), but CUDA’s headers declare it without noexcept (or with a different exception specification).
GCC 14 + glibc are now providing rsqrt/rsqrtf in the standard math library, and there’s a conflict with CUDA’s declarations.
The simplest path is to modify the CUDA headers for math_functions.h to match the glibc math.h headers. The following worked for me
Newer toolkit versions (I think since 13) now have a special macro called __NV_IEC_60559_FUNCS_EXCEPTION_SPECIFIER to deal with this. You can try if maybe it works on clang with the following patch:
I was running F42+Cuda13.1 when I noticed 13.2 was out and was supported under F43. This is good news as F42 will be out of support in a few weeks time, so I thought I should get the upgrade done. Can’t comment on your specific issue but at least the upgrade was entirely smooth for me, except for adding the 13.2 repo, so I thought it might be useful to others to reply.
I ran:
sudo dnf upgrade --refresh
sudo dnf system-upgrade download --releasever=43
sudo dnf5 offline reboot
(as I was running f42 at this point)
When it came back F43 seemed ok.
However when I went to add the cuda 13.2 repo via the Cuda installation Guide method: