about summary refs log tree commit diff
path: root/pkgs/development/cuda-modules/cuda/overrides.nix
diff options
context:
space:
mode:
authorSomeone <sergei.kozlukov@aalto.fi>2024-01-17 21:13:37 +0000
committerGitHub <noreply@github.com>2024-01-17 21:13:37 +0000
commit8282fe9c6faa1599a7e509c0a38d2b45b46ff8af (patch)
tree372e31d0e864ff751b32b909671dcbad8c16899c /pkgs/development/cuda-modules/cuda/overrides.nix
parent17144df1138eed490577503d8c9bd2e9419098ea (diff)
parentbed725db88c8163b9c5cd2186f34bed79e1add42 (diff)
Merge pull request #269639 from SomeoneSerge/update/cudaPackages
cudaPackages: bump the default 11 -> 12
Diffstat (limited to 'pkgs/development/cuda-modules/cuda/overrides.nix')
-rw-r--r--pkgs/development/cuda-modules/cuda/overrides.nix60
1 files changed, 58 insertions, 2 deletions
diff --git a/pkgs/development/cuda-modules/cuda/overrides.nix b/pkgs/development/cuda-modules/cuda/overrides.nix
index 37dc7bf29c358..d8fab198208cf 100644
--- a/pkgs/development/cuda-modules/cuda/overrides.nix
+++ b/pkgs/development/cuda-modules/cuda/overrides.nix
@@ -44,6 +44,11 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
 
   cuda_cudart = prev.cuda_cudart.overrideAttrs (
     prevAttrs: {
+      # Remove once cuda-find-redist-features has a special case for libcuda
+      outputs =
+        prevAttrs.outputs
+        ++ lists.optionals (!(builtins.elem "stubs" prevAttrs.outputs)) [ "stubs" ];
+
       allowFHSReferences = false;
 
       # The libcuda stub's pkg-config doesn't follow the general pattern:
@@ -64,6 +69,14 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
             ln -s libcuda.so lib/stubs/libcuda.so.1
           fi
         '';
+
+      postFixup =
+        prevAttrs.postFixup or ""
+        + ''
+          moveToOutput lib/stubs "$stubs"
+          ln -s "$stubs"/lib/stubs/* "$stubs"/lib/
+          ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs"
+        '';
     }
   );
 
@@ -200,20 +213,63 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
   );
 
   nsight_systems = prev.nsight_systems.overrideAttrs (
-    prevAttrs: {
-      nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [final.pkgs.qt5.wrapQtAppsHook];
+    prevAttrs:
+    let
+      qt = if lib.versionOlder prevAttrs.version "2022.4.2.1" then final.pkgs.qt5 else final.pkgs.qt6;
+      qtwayland =
+        if lib.versions.major qt.qtbase.version == "5" then
+          lib.getBin qt.qtwayland
+        else
+          lib.getLib qt.qtwayland;
+      qtWaylandPlugins = "${qtwayland}/${qt.qtbase.qtPluginPrefix}";
+    in
+    {
+      # An ad hoc replacement for
+      # https://github.com/ConnorBaker/cuda-redist-find-features/issues/11
+      env.rmPatterns = toString [
+        "nsight-systems/*/*/libQt*"
+        "nsight-systems/*/*/libstdc*"
+        "nsight-systems/*/*/libboost*"
+        "nsight-systems/*/*/lib{ssl,ssh,crypto}*"
+        "nsight-systems/*/*/lib{arrow,jpeg}*"
+        "nsight-systems/*/*/Mesa"
+        "nsight-systems/*/*/python/bin/python"
+        "nsight-systems/*/*/libexec"
+        "nsight-systems/*/*/Plugins"
+      ];
+      postPatch =
+        prevAttrs.postPatch or ""
+        + ''
+          for path in $rmPatterns ; do
+            rm -r "$path"
+          done
+        '';
+      nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ qt.wrapQtAppsHook ];
       buildInputs = prevAttrs.buildInputs ++ [
+        final.cuda_cudart.stubs
         final.pkgs.alsa-lib
+        final.pkgs.boost178
         final.pkgs.e2fsprogs
+        final.pkgs.gst_all_1.gst-plugins-base
+        final.pkgs.gst_all_1.gstreamer
         final.pkgs.nss
         final.pkgs.numactl
         final.pkgs.pulseaudio
+        final.pkgs.rdma-core
+        final.pkgs.ucx
         final.pkgs.wayland
         final.pkgs.xorg.libXcursor
         final.pkgs.xorg.libXdamage
         final.pkgs.xorg.libXrandr
         final.pkgs.xorg.libXtst
+        qt.qtbase
+        (qt.qtdeclarative or qt.full)
+        (qt.qtsvg or qt.full)
+        qtWaylandPlugins
       ];
+
+      # Older releases require boost 1.70 deprecated in Nixpkgs
+      meta.broken = prevAttrs.meta.broken or false || lib.versionOlder final.cudaVersion "11.8";
     }
   );