Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cudaPackages_12.cudatoolkit: hotfix after switching to autoPatchelfHook #224986

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions pkgs/development/compilers/cudatoolkit/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ args@
, freeglut
, libGLU
, libsForQt5
, libtiff
, qt6Packages
, rdma-core
, ucx
, rsync
}:

backendStdenv.mkDerivation rec {
Expand Down Expand Up @@ -67,13 +72,20 @@ backendStdenv.mkDerivation rec {
nativeBuildInputs = [
perl
makeWrapper
rsync
addOpenGLRunpath
autoPatchelfHook
autoAddOpenGLRunpathHook
] ++ lib.optionals (lib.versionOlder version "11") [
libsForQt5.wrapQtAppsHook
] ++ lib.optionals (lib.versionAtLeast version "11.8") [
qt6Packages.wrapQtAppsHook
];
buildInputs = [
buildInputs = lib.optionals (lib.versionOlder version "11") [
libsForQt5.qt5.qtwebengine
freeglut
libGLU
] ++ [
# To get $GDK_PIXBUF_MODULE_FILE via setup-hook
gdk-pixbuf

Expand Down Expand Up @@ -109,10 +121,13 @@ backendStdenv.mkDerivation rec {
unixODBC
alsa-lib
wayland
] ++ lib.optionals (lib.versionOlder version "11") [
libsForQt5.qt5.qtwebengine
freeglut
libGLU
] ++ lib.optionals (lib.versionAtLeast version "11.8") [
(lib.getLib libtiff)
qt6Packages.qtwayland
rdma-core
ucx
xorg.libxshmfence
xorg.libxkbfile
];

# Prepended to runpaths by autoPatchelf.
Expand Down Expand Up @@ -205,6 +220,13 @@ backendStdenv.mkDerivation rec {
mv pkg/builds/nsight_systems/target-linux-x64 $out/target-linux-x64
mv pkg/builds/nsight_systems/host-linux-x64 $out/host-linux-x64
''}
${lib.optionalString (lib.versionAtLeast version "11.8")
# error: auto-patchelf could not satisfy dependency libtiff.so.5 wanted by /nix/store/.......-cudatoolkit-12.0.1/host-linux-x64/Plugins/imageformats/libqtiff.so
# we only ship libtiff.so.6, so let's use qt plugins built by Nix.
# TODO: don't copy, come up with a symlink-based "merge"
''
rsync ${lib.getLib qt6Packages.qtimageformats}/lib/qt-6/plugins/ $out/host-linux-x64/Plugins/ -aP
''}
Comment on lines +223 to +229
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow the logic of this comment... how does using Qt plugins built by nix alleviate the .so.5 vs .so.6 version issue?

Also, why use rsync instead of simply ln -s? Ideally we'd like to avoid copying files b/w outputs.

Copy link
Contributor Author

@SomeoneSerge SomeoneSerge Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does using Qt plugins built by nix

...because Nix builds Qt plugins against nixpkgs' libtiff and they end up linking to .so.6

Also, why use rsync instead of simply ln -s? Ideally we'd like to avoid copying files b/w outputs.

No good reason at all, other than I wanted a "synchronize these two directory trees recursively" operation, and rsync is one. Either way, we want to be removing all of these plugins, and for all versions of cuda, so we'll have rewritten this patch before we can close #224646


rm -f $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?

Expand Down