cudaPackages.nsight_compute: fixup for x86_64-linux

Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
(cherry picked from commit a5b920f455)
This commit is contained in:
Connor Baker
2025-08-04 02:22:39 +00:00
parent bd24366644
commit 5e60eed285

View File

@@ -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 [ ] ++ [