Commit 9a3dcd02 authored by Elliot Cameron's avatar Elliot Cameron
Browse files

dcgm: switch to fixed autoAddOpenGLRunpathHook

parent 03e72e46
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -105,7 +105,11 @@ in gcc11Stdenv.mkDerivation rec {
  hardeningDisable = [ "all" ];

  nativeBuildInputs = [
    addOpenGLRunpath
    # autoAddOpenGLRunpathHook does not actually depend on or incur any dependency
    # of cudaPackages. It merely adds an impure, non-Nix PATH to the RPATHs of
    # executables that need to use cuda at runtime.
    cudaPackages_12.autoAddOpenGLRunpathHook

    cmake
    git
    python3
@@ -124,16 +128,6 @@ in gcc11Stdenv.mkDerivation rec {
    yaml-cpp
  ];

  # libcuda.so must be found at runtime because it is supplied by the NVIDIA
  # driver. autoAddOpenGLRunpathHook breaks on the statically linked exes.
  postFixup = ''
    find "$out/bin" "$out/lib" -type f -executable -print0 | while IFS= read -r -d "" f; do
      if isELF "$f" && [[ $(patchelf --print-needed "$f" || true) == *libcuda.so* ]]; then
        addOpenGLRunpath "$f"
      fi
    done
  '';

  disallowedReferences = lib.concatMap (x: x.pkgSet) cudaPackageSetByVersion;

  meta = with lib; {