glibc 2.41(Ubuntu 25.04 や debian sid で採用)で cuda toolkit を使うにはパッチが必要です
と言っても,以下のパッチを /usr/local/cuda/include/crt/math_functions.h に当てるだけで解決です
--- math_functions.h.orig~ 2025-05-22 11:09:49.994627842 +0900 +++ math_functions.h 2025-05-22 11:11:05.624851346 +0900 @@ -2553,7 +2553,7 @@ * * \note_accuracy_double */ -extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept (true); /** * \ingroup CUDA_MATH_SINGLE * \brief Calculate the sine of the input argument @@ -2576,7 +2576,7 @@ * * \note_accuracy_single */ -extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x) noexcept (true); /** * \ingroup CUDA_MATH_DOUBLE * \brief Calculate the cosine of the input argument @@ -2598,7 +2598,7 @@ * * \note_accuracy_double */ -extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x) noexcept (true); /** * \ingroup CUDA_MATH_SINGLE * \brief Calculate the cosine of the input argument @@ -2620,7 +2620,7 @@ * * \note_accuracy_single */ -extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x) noexcept (true); /** * \ingroup CUDA_MATH_DOUBLE * \brief Calculate the sine and cosine of the first input argument
経緯としては
- 2025年1月 glibc 2.41 登場
- cuda toolkit で不具合発生
- forums.developer.nvidia.com
- 今までのglibc は sinpi(double x) だったのに,glibc 2.41 で sinpi(double x) noexcept (true) に変更された
- cuda側でも同じ変更が必要になった
- 2025年5月現在.まだ修正されず
という感じです
2025年5月時点で未だに修正されてないので,ブログに書いておくことにしました

