From 01d468622e3a767e1951bf72c78eeb49990383ac Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 27 Apr 2026 08:57:36 +0000 Subject: [PATCH] cudaPackages.cuda_crt: do not patch math headers on >=13.2 --- pkgs/development/cuda-modules/packages/cuda_crt.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/cuda-modules/packages/cuda_crt.nix b/pkgs/development/cuda-modules/packages/cuda_crt.nix index 914967d7cc8d..f8ee427fbed1 100644 --- a/pkgs/development/cuda-modules/packages/cuda_crt.nix +++ b/pkgs/development/cuda-modules/packages/cuda_crt.nix @@ -2,6 +2,7 @@ lib, backendStdenv, buildRedist, + cudaOlder, glibc, }: buildRedist { @@ -11,10 +12,11 @@ buildRedist { outputs = [ "out" ]; # Fix compatibility with glibc 2.42: - # CUDA >= 13.0 fixed sinpi/cospi (using __NV_IEC_60559_FUNCS_EXCEPTION_SPECIFIER), but - # rsqrt/rsqrtf in math_functions.h still lack noexcept, conflicting with glibc 2.42's - # declarations. - postInstall = lib.optionalString (lib.versionAtLeast glibc.version "2.42") '' + # - CUDA >= 13.0 fixed sinpi/cospi (using __NV_IEC_60559_FUNCS_EXCEPTION_SPECIFIER), but + # rsqrt/rsqrtf in math_functions.h still lack noexcept, conflicting with glibc 2.42's + #  declarations. + # - CUDA >= 13.2 fixed rsqrt/rsqrtf as well (using _NV_RSQRT_SPECIFIER). + postInstall = lib.optionalString (cudaOlder "13.2" && lib.versionAtLeast glibc.version "2.42") '' nixLog "Patching math_functions.h rsqrt signatures to match glibc's ones" substituteInPlace "''${!outputInclude:?}/include/crt/math_functions.h" \ --replace-fail \