Skip to content
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
31 changes: 30 additions & 1 deletion pkgs/development/cuda-modules/cudatoolkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,29 @@ backendStdenv.mkDerivation rec {
rm $out/host-linux-x64/libstdc++.so*
''}
${
lib.optionalString (lib.versionAtLeast version "11.8")
lib.optionalString (lib.versionAtLeast version "11.8" && lib.versionOlder version "12")
# 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
''
}
${
lib.optionalString (lib.versionAtLeast version "12")
# Use Qt plugins built by Nix.
''
for qtlib in $out/host-linux-x64/Plugins/*/libq*.so; do
qtdir=$(basename $(dirname $qtlib))
filename=$(basename $qtlib)
for qtpkgdir in ${lib.concatMapStringsSep " " (x: qt6Packages.${x}) ["qtbase" "qtimageformats" "qtsvg" "qtwayland"]}; do
if [ -e $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename ]; then
ln -snf $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename $qtlib
fi
done
done
''
}

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

Expand Down Expand Up @@ -336,6 +351,20 @@ backendStdenv.mkDerivation rec {
wrapProgram "$out/bin/$b" \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
done
${
lib.optionalString (lib.versionAtLeast version "12")
# Check we don't have any lurking vendored qt libraries that weren't
# replaced during installPhase
''
qtlibfiles=$(find $out -name "libq*.so" -type f)
if [ ! -z "$qtlibfiles" ]; then
echo "Found unexpected vendored Qt library files in $out" >&2
echo $qtlibfiles >&2
echo "These should be replaced with symlinks in installPhase" >&2
exit 1
fi
''
}
'';

# cuda-gdb doesn't run correctly when not using sandboxing, so
Expand Down