From 518da426e71209e007338f94e837d58e9d2d00a2 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 15 Oct 2026 18:14:05 -0700 Subject: [PATCH] cudaPackages.nccl: drop remove-references-to for cuda_nvcc The nvlink wrapper in cuda_nvcc removes the library directories nvlink records in libnccl's device code. disallowedRequisites still checks that cuda_nvcc isn't a runtime dependency. Assisted-by: Claude Code (Claude Opus 5.5) --- pkgs/development/cuda-modules/packages/nccl.nix | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkgs/development/cuda-modules/packages/nccl.nix b/pkgs/development/cuda-modules/packages/nccl.nix index 87576cc890fe..9d2b2bc5b377 100644 --- a/pkgs/development/cuda-modules/packages/nccl.nix +++ b/pkgs/development/cuda-modules/packages/nccl.nix @@ -14,7 +14,6 @@ patchelf, python3, rdma-core, - removeReferencesTo, which, # passthru.updateScript gitUpdater, @@ -99,7 +98,6 @@ backendStdenv.mkDerivation (finalAttrs: { cuda_nvcc patchelf python3 - removeReferencesTo which ]; @@ -150,17 +148,6 @@ backendStdenv.mkDerivation (finalAttrs: { _overrideFirst outputStatic "static" "lib" "out" moveToOutput lib/libnccl_static.a "''${!outputStatic:?}" '' - # Since CUDA 12.8, the cuda_nvcc path leaks in: - # - libnccl.so's .nv_fatbin section - # - libnccl_static.a - # &devrt -L /nix/store/00000000000000000000000000000000-...nvcc-.../bin/... - # This string makes cuda_nvcc a runtime dependency of nccl. - # See https://github.com/NixOS/nixpkgs/pull/457803 - + '' - remove-references-to -t "${lib.getBin cuda_nvcc}" \ - ''${!outputLib}/lib/libnccl.so.* \ - ''${!outputStatic}/lib/*.a - '' # makefiles/common.mk sets RDMA_CORE=0 and MLX5DV=0, so libibverbs/libmlx5/libgdrapi are dlopen'd # rather than DT_NEEDED and buildInputs would not reach the runpath. Losing them is quiet: NCCL # logs at INFO and falls back to the socket transport. @@ -171,7 +158,7 @@ backendStdenv.mkDerivation (finalAttrs: { }" "''${!outputLib:?}"/lib/libnccl.so.*.* ''; - # C.f. remove-references-to above. Ensure *all* references to cuda_nvcc are removed + # nvlink records its library directories in libnccl's device code; cuda_nvcc's nvlink wrapper removes them. disallowedRequisites = [ (lib.getBin cuda_nvcc) ]; passthru = {