Commit 5d9e3ac0 authored by Andrew Marshall's avatar Andrew Marshall
Browse files

opensubdiv: Fix flaky build with CUDA and high parallelism

parent 85f1ba3e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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 = {