mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
cudaPackages.nsight_compute: fixup for Jetson aarch64-linux
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
cudaOlder,
|
||||
e2fsprogs,
|
||||
elfutils,
|
||||
flags,
|
||||
gst_all_1,
|
||||
lib,
|
||||
libjpeg8,
|
||||
qt6,
|
||||
rdma-core,
|
||||
stdenv,
|
||||
@@ -17,7 +19,8 @@ let
|
||||
inherit (qt6) wrapQtAppsHook qtwebview;
|
||||
archDir =
|
||||
{
|
||||
aarch64-linux = "linux-desktop-t210-a64";
|
||||
aarch64-linux =
|
||||
"linux-" + (if flags.isJetsonBuild then "v4l_l4t" else "linux-desktop") + "-t210-a64";
|
||||
x86_64-linux = "linux-desktop-glibc_2_11_3-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
@@ -33,6 +36,9 @@ in
|
||||
(qt6.qtwebengine or qt6.full)
|
||||
rdma-core
|
||||
]
|
||||
++ lib.optionals (cudaMajorMinorVersion == "12.0" && flags.isJetsonBuild) [
|
||||
libjpeg8
|
||||
]
|
||||
++ lib.optionals (cudaAtLeast "12.1" && cudaOlder "12.4") [
|
||||
gst_all_1.gstreamer
|
||||
gst_all_1.gst-plugins-base
|
||||
@@ -55,13 +61,24 @@ in
|
||||
|
||||
rm -rf host/${archDir}/Mesa/
|
||||
'';
|
||||
postInstall = prevAttrs.postInstall or "" + ''
|
||||
moveToOutput 'ncu' "''${!outputBin}/bin"
|
||||
moveToOutput 'ncu-ui' "''${!outputBin}/bin"
|
||||
moveToOutput 'host/${archDir}' "''${!outputBin}/bin"
|
||||
moveToOutput 'target/${archDir}' "''${!outputBin}/bin"
|
||||
wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin"
|
||||
'';
|
||||
postInstall =
|
||||
prevAttrs.postInstall or ""
|
||||
+ ''
|
||||
moveToOutput 'ncu' "''${!outputBin}/bin"
|
||||
moveToOutput 'ncu-ui' "''${!outputBin}/bin"
|
||||
moveToOutput 'host/${archDir}' "''${!outputBin}/bin"
|
||||
moveToOutput 'target/${archDir}' "''${!outputBin}/bin"
|
||||
wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin"
|
||||
''
|
||||
# NOTE(@connorbaker): No idea what this platform is or how to patchelf for it.
|
||||
+ lib.optionalString (flags.isJetsonBuild && cudaAtLeast "11.8" && cudaOlder "12.9") ''
|
||||
nixLog "Removing QNX 700 target directory for Jetson builds"
|
||||
rm -rfv "''${!outputBin}/target/qnx-700-t210-a64"
|
||||
''
|
||||
+ lib.optionalString (flags.isJetsonBuild && cudaAtLeast "12.8") ''
|
||||
nixLog "Removing QNX 800 target directory for Jetson builds"
|
||||
rm -rfv "''${!outputBin}/target/qnx-800-tegra-a64"
|
||||
'';
|
||||
# lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6
|
||||
preFixup = prevAttrs.preFixup or "" + ''
|
||||
patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/bin/host/${archDir}/Plugins/imageformats/libqtiff.so"
|
||||
@@ -69,4 +86,9 @@ in
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
];
|
||||
# NOTE(@connorbaker): It might be a problem that when nsight_compute contains hosts and targets of different
|
||||
# architectures, that we patchelf just the binaries matching the builder's platform; autoPatchelfHook prints
|
||||
# messages like
|
||||
# skipping [$out]/host/linux-desktop-glibc_2_11_3-x64/libQt6Core.so.6 because its architecture (x64) differs from
|
||||
# target (AArch64)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user