From 5e60eed2853eb785db58550bf113d3fc2d0175a5 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Mon, 4 Aug 2025 02:22:39 +0000 Subject: [PATCH] cudaPackages.nsight_compute: fixup for x86_64-linux Signed-off-by: Connor Baker (cherry picked from commit a5b920f455a7f9380e152f9c3589e788286c4a8c) --- .../_cuda/fixups/nsight_compute.nix | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix b/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix index 584893f54c24..a6fffb4b4518 100644 --- a/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix +++ b/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix @@ -1,9 +1,16 @@ { + cudaAtLeast, + cudaMajorMinorVersion, + cudaOlder, + e2fsprogs, + elfutils, + gst_all_1, lib, qt5 ? null, qt6 ? null, rdma-core, stdenv, + ucx, }: prevAttrs: let @@ -24,15 +31,36 @@ let .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); in { + outputs = [ "out" ]; # NOTE(@connorbaker): Force a single output so relative lookups work. nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ wrapQtAppsHook ]; - buildInputs = prevAttrs.buildInputs or [ ] ++ [ - qtwayland - qtwebview - (qt.qtwebengine or qt.full) - rdma-core - ]; + buildInputs = + prevAttrs.buildInputs or [ ] + ++ [ + qtwayland + qtwebview + (qt6.qtwebengine or qt6.full) + rdma-core + ] + ++ lib.optionals (cudaAtLeast "12.1" && cudaOlder "12.4") [ + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + ] + ++ lib.optionals (cudaAtLeast "12.0" && cudaOlder "12.7") [ + e2fsprogs + ucx + ] + ++ lib.optionals (cudaMajorMinorVersion == "12.9") [ + elfutils + ]; dontWrapQtApps = true; preInstall = prevAttrs.preInstall or "" + '' + if [[ -d nsight-compute ]]; then + nixLog "Lifting components of Nsight Compute to the top level" + mv -v nsight-compute/*/* . + nixLog "Removing empty directories" + rmdir -pv nsight-compute/* + fi + rm -rf host/${archDir}/Mesa/ ''; postInstall = prevAttrs.postInstall or "" + '' @@ -42,8 +70,8 @@ in moveToOutput 'target/${archDir}' "''${!outputBin}/bin" wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin" ''; + # lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6 preFixup = prevAttrs.preFixup or "" + '' - # lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6 patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/bin/host/${archDir}/Plugins/imageformats/libqtiff.so" ''; autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [