From 5d9e3ac039b2c2fd62b71256e7368c212b6f475e Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Wed, 16 Aug 2023 18:40:22 -0400 Subject: [PATCH] opensubdiv: Fix flaky build with CUDA and high parallelism See upstream issue: https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1313 --- pkgs/development/libraries/opensubdiv/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/opensubdiv/default.nix b/pkgs/development/libraries/opensubdiv/default.nix index 06d65be106da..b0ff4b528864 100644 --- a/pkgs/development/libraries/opensubdiv/default.nix +++ b/pkgs/development/libraries/opensubdiv/default.nix @@ -47,6 +47,11 @@ stdenv.mkDerivation rec { "-DNO_OPENCL=1" ]; + preBuild = let maxBuildCores = 16; in lib.optionalString cudaSupport '' + # https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1313 + NIX_BUILD_CORES=$(( NIX_BUILD_CORES < ${toString maxBuildCores} ? NIX_BUILD_CORES : ${toString maxBuildCores} )) + ''; + postInstall = "rm $out/lib/*.a"; meta = {