Unverified Commit 00207e62 authored by Luna Nova's avatar Luna Nova
Browse files

rocmPackages.rocblas: remove reference to tensile in librocblas

rocblas's closure-size was bloated by around 400MB by a ref to
tensile in an error message string. tensile is used at build time
to build and link kernels, but is not needed at runtime.

Before:
/nix/store/zggwlwji0jca2cvhgl4ick7l3fwlwsfb-rocblas-gfx1030-6.4.3          1.3G

After:
/nix/store/71rz9qm323rzmzgkx31llcsnhd0gkvl3-rocblas-gfx1030-6.4.3        904.5M
parent d920659b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
  python3Packages,
  rocm-smi,
  pkg-config,
  removeReferencesTo,
  buildTensile ? true,
  buildTests ? false,
  buildBenchmarks ? false,
@@ -54,6 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
    clr
    gitMinimal
    pkg-config
    removeReferencesTo
  ]
  ++ lib.optionals buildTensile [
    tensile
@@ -148,6 +150,13 @@ stdenv.mkDerivation (finalAttrs: {
      --replace-fail '0.10' '1.0'
  '';

  postInstall =
    # tensile isn't needed at runtime and pulls in ~400MB of python deps
    ''
      remove-references-to -t ${tensile} \
        "$out/lib/librocblas.so."*
    '';

  passthru = {
    amdgpu_targets = gpuTargets';
    tests.rocblas-tests = finalAttrs.finalPackage.override {