about summary refs log tree commit diff
path: root/pkgs/development/cuda-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/cuda-modules')
-rw-r--r--pkgs/development/cuda-modules/aliases.nix2
-rw-r--r--pkgs/development/cuda-modules/cuda/extension.nix5
-rw-r--r--pkgs/development/cuda-modules/cudatoolkit/default.nix2
-rw-r--r--pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix2
-rw-r--r--pkgs/development/cuda-modules/modules/cudnn/default.nix2
-rw-r--r--pkgs/development/cuda-modules/modules/generic/manifests/feature/manifest.nix2
-rw-r--r--pkgs/development/cuda-modules/modules/generic/manifests/feature/outputs.nix10
-rw-r--r--pkgs/development/cuda-modules/modules/generic/manifests/feature/package.nix2
-rw-r--r--pkgs/development/cuda-modules/modules/generic/manifests/feature/release.nix2
-rw-r--r--pkgs/development/cuda-modules/modules/generic/manifests/redistrib/manifest.nix8
-rw-r--r--pkgs/development/cuda-modules/modules/generic/manifests/redistrib/package.nix10
-rw-r--r--pkgs/development/cuda-modules/modules/generic/manifests/redistrib/release.nix10
-rw-r--r--pkgs/development/cuda-modules/modules/generic/releases/default.nix12
-rw-r--r--pkgs/development/cuda-modules/modules/generic/types/default.nix12
-rw-r--r--pkgs/development/cuda-modules/modules/tensorrt/default.nix4
-rw-r--r--pkgs/development/cuda-modules/saxpy/default.nix22
-rw-r--r--pkgs/development/cuda-modules/write-gpu-python-test.nix29
17 files changed, 93 insertions, 43 deletions
diff --git a/pkgs/development/cuda-modules/aliases.nix b/pkgs/development/cuda-modules/aliases.nix
index 36dd07d773bd9..7f28f2c76d471 100644
--- a/pkgs/development/cuda-modules/aliases.nix
+++ b/pkgs/development/cuda-modules/aliases.nix
@@ -13,6 +13,6 @@ in
     mkRenamed "autoAddDriverRunpath" "pkgs.autoAddDriverRunpath"
       final.pkgs.autoAddDriverRunpath; # Added 2024-03-30
   autoAddOpenGLRunpathHook =
-    mkRenamed "autoAddOpenGLRunpathHook" "pkgs.autoAddDriverRunpath"
+    mkRenamed "autoAddOpenGLRunpathHook" "pkgs.autoAddDriverRunpathHook"
       final.pkgs.autoAddDriverRunpath; # Added 2024-03-30
 }
diff --git a/pkgs/development/cuda-modules/cuda/extension.nix b/pkgs/development/cuda-modules/cuda/extension.nix
index 5b87a3df0959a..f39171e888741 100644
--- a/pkgs/development/cuda-modules/cuda/extension.nix
+++ b/pkgs/development/cuda-modules/cuda/extension.nix
@@ -53,6 +53,10 @@ let
       redistribRelease = redistribManifest.${pname};
       featureRelease = featureManifest.${pname};
       drv =
+        let
+          # get `autoAddDriverRunpath` from pkgs instead of cudaPackages' alias to avoid warning
+          inherit (callPackage ({ pkgs }: pkgs) { }) autoAddDriverRunpath;
+        in
         (callPackage ../generic-builders/manifest.nix {
           # We pass the whole release to the builder because it has logic to handle
           # the case we're trying to build on an unsupported platform.
@@ -61,6 +65,7 @@ let
             redistName
             redistribRelease
             featureRelease
+            autoAddDriverRunpath
             ;
         }).overrideAttrs
           (prevAttrs: {
diff --git a/pkgs/development/cuda-modules/cudatoolkit/default.nix b/pkgs/development/cuda-modules/cudatoolkit/default.nix
index e5606f9395129..24e41d3318956 100644
--- a/pkgs/development/cuda-modules/cudatoolkit/default.nix
+++ b/pkgs/development/cuda-modules/cudatoolkit/default.nix
@@ -411,7 +411,7 @@ backendStdenv.mkDerivation rec {
   };
 
   meta = with lib; {
-    description = "The deprecated runfile-based CUDAToolkit installation (a compiler for NVIDIA GPUs, math libraries, and tools)";
+    description = "Deprecated runfile-based CUDAToolkit installation (a compiler for NVIDIA GPUs, math libraries, and tools)";
     homepage = "https://developer.nvidia.com/cuda-toolkit";
     platforms = [ "x86_64-linux" ];
     license = licenses.nvidiaCuda;
diff --git a/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix b/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix
index 6bdcdecbacd6f..b8906b3dc59b2 100644
--- a/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix
+++ b/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix
@@ -80,7 +80,7 @@ else
     };
 
     meta = with lib; {
-      description = "A wrapper substituting the deprecated runfile-based CUDA installation";
+      description = "Wrapper substituting the deprecated runfile-based CUDA installation";
       license = licenses.nvidiaCuda;
     };
   }
diff --git a/pkgs/development/cuda-modules/modules/cudnn/default.nix b/pkgs/development/cuda-modules/modules/cudnn/default.nix
index b9fe238e2587b..36a9a26bda523 100644
--- a/pkgs/development/cuda-modules/modules/cudnn/default.nix
+++ b/pkgs/development/cuda-modules/modules/cudnn/default.nix
@@ -5,7 +5,7 @@
   # to the generic release.
   # {
   #   url = options.mkOption {
-  #     description = "The URL to download the tarball from";
+  #     description = "URL to download the tarball from";
   #     type = types.str;
   #   };
   # }
diff --git a/pkgs/development/cuda-modules/modules/generic/manifests/feature/manifest.nix b/pkgs/development/cuda-modules/modules/generic/manifests/feature/manifest.nix
index d4ec8c84c91fb..984668ac34bb4 100644
--- a/pkgs/development/cuda-modules/modules/generic/manifests/feature/manifest.nix
+++ b/pkgs/development/cuda-modules/modules/generic/manifests/feature/manifest.nix
@@ -4,7 +4,7 @@ let
   Release = import ./release.nix { inherit lib config; };
 in
 options.mkOption {
-  description = "A feature manifest is an attribute set which includes a mapping from package name to release";
+  description = "Feature manifest is an attribute set which includes a mapping from package name to release";
   example = trivial.importJSON ../../../../cuda/manifests/feature_11.5.2.json;
   type = types.attrsOf Release.type;
 }
diff --git a/pkgs/development/cuda-modules/modules/generic/manifests/feature/outputs.nix b/pkgs/development/cuda-modules/modules/generic/manifests/feature/outputs.nix
index 6f2fafac9ffc0..961f0b9686859 100644
--- a/pkgs/development/cuda-modules/modules/generic/manifests/feature/outputs.nix
+++ b/pkgs/development/cuda-modules/modules/generic/manifests/feature/outputs.nix
@@ -4,7 +4,7 @@ let
 in
 # https://github.com/ConnorBaker/cuda-redist-find-features/blob/603407bea2fab47f2dfcd88431122a505af95b42/cuda_redist_find_features/manifest/feature/package/package.py
 options.mkOption {
-  description = "A set of outputs that a package can provide.";
+  description = "Set of outputs that a package can provide";
   example = {
     bin = true;
     dev = true;
@@ -16,7 +16,7 @@ options.mkOption {
   type = types.submodule {
     options = {
       bin = options.mkOption {
-        description = "A `bin` output requires that we have a non-empty `bin` directory containing at least one file with the executable bit set.";
+        description = "`bin` output requires that we have a non-empty `bin` directory containing at least one file with the executable bit set";
         type = types.bool;
       };
       dev = options.mkOption {
@@ -44,15 +44,15 @@ options.mkOption {
         type = types.bool;
       };
       lib = options.mkOption {
-        description = "A `lib` output requires that we have a non-empty lib directory containing at least one shared library.";
+        description = "`lib` output requires that we have a non-empty lib directory containing at least one shared library";
         type = types.bool;
       };
       sample = options.mkOption {
-        description = "A `sample` output requires that we have a non-empty `samples` directory.";
+        description = "`sample` output requires that we have a non-empty `samples` directory";
         type = types.bool;
       };
       static = options.mkOption {
-        description = "A `static` output requires that we have a non-empty lib directory containing at least one static library.";
+        description = "`static` output requires that we have a non-empty lib directory containing at least one static library";
         type = types.bool;
       };
     };
diff --git a/pkgs/development/cuda-modules/modules/generic/manifests/feature/package.nix b/pkgs/development/cuda-modules/modules/generic/manifests/feature/package.nix
index 957306dbe1cf0..2563598a78293 100644
--- a/pkgs/development/cuda-modules/modules/generic/manifests/feature/package.nix
+++ b/pkgs/development/cuda-modules/modules/generic/manifests/feature/package.nix
@@ -4,7 +4,7 @@ let
   Outputs = import ./outputs.nix { inherit lib; };
 in
 options.mkOption {
-  description = "A package in the manifest";
+  description = "Package in the manifest";
   example = (import ./release.nix { inherit lib; }).linux-x86_64;
   type = types.submodule { options.outputs = Outputs; };
 }
diff --git a/pkgs/development/cuda-modules/modules/generic/manifests/feature/release.nix b/pkgs/development/cuda-modules/modules/generic/manifests/feature/release.nix
index 13acd373e6c6e..6754ae56e0b01 100644
--- a/pkgs/development/cuda-modules/modules/generic/manifests/feature/release.nix
+++ b/pkgs/development/cuda-modules/modules/generic/manifests/feature/release.nix
@@ -4,7 +4,7 @@ let
   Package = import ./package.nix { inherit lib config; };
 in
 options.mkOption {
-  description = "A release is an attribute set which includes a mapping from platform to package";
+  description = "Release is an attribute set which includes a mapping from platform to package";
   example = (import ./manifest.nix { inherit lib; }).cuda_cccl;
   type = types.attrsOf Package.type;
 }
diff --git a/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/manifest.nix b/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/manifest.nix
index 1fd428be16959..b6f765a38a078 100644
--- a/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/manifest.nix
+++ b/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/manifest.nix
@@ -4,27 +4,27 @@ let
   Release = import ./release.nix { inherit lib; };
 in
 options.mkOption {
-  description = "A redistributable manifest is an attribute set which includes a mapping from package name to release";
+  description = "Redistributable manifest is an attribute set which includes a mapping from package name to release";
   example = trivial.importJSON ../../../../cuda/manifests/redistrib_11.5.2.json;
   type = types.submodule {
     # Allow any attribute name as these will be the package names
     freeformType = types.attrsOf Release.type;
     options = {
       release_date = options.mkOption {
-        description = "The release date of the manifest";
+        description = "Release date of the manifest";
         type = types.nullOr types.str;
         default = null;
         example = "2023-08-29";
       };
       release_label = options.mkOption {
-        description = "The release label of the manifest";
+        description = "Release label of the manifest";
         type = types.nullOr types.str;
         default = null;
         example = "12.2.2";
       };
       release_product = options.mkOption {
         example = "cuda";
-        description = "The release product of the manifest";
+        description = "Release product of the manifest";
         type = types.nullOr types.str;
         default = null;
       };
diff --git a/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/package.nix b/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/package.nix
index 04848ab15dee0..bf3bd478a1239 100644
--- a/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/package.nix
+++ b/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/package.nix
@@ -3,27 +3,27 @@ let
   inherit (lib) options types;
 in
 options.mkOption {
-  description = "A package in the manifest";
+  description = "Package in the manifest";
   example = (import ./release.nix { inherit lib; }).linux-x86_64;
   type = types.submodule {
     options = {
       relative_path = options.mkOption {
-        description = "The relative path to the package";
+        description = "Relative path to the package";
         example = "cuda_cccl/linux-x86_64/cuda_cccl-linux-x86_64-11.5.62-archive.tar.xz";
         type = types.str;
       };
       sha256 = options.mkOption {
-        description = "The sha256 hash of the package";
+        description = "Sha256 hash of the package";
         example = "bbe633d6603d5a96a214dcb9f3f6f6fd2fa04d62e53694af97ae0c7afe0121b0";
         type = types.str;
       };
       md5 = options.mkOption {
-        description = "The md5 hash of the package";
+        description = "Md5 hash of the package";
         example = "e5deef4f6cb71f14aac5be5d5745dafe";
         type = types.str;
       };
       size = options.mkOption {
-        description = "The size of the package as a string";
+        description = "Size of the package as a string";
         type = types.str;
         example = "960968";
       };
diff --git a/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/release.nix b/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/release.nix
index 7b15ba5854dcb..0165ecbb08bc6 100644
--- a/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/release.nix
+++ b/pkgs/development/cuda-modules/modules/generic/manifests/redistrib/release.nix
@@ -4,30 +4,30 @@ let
   Package = import ./package.nix { inherit lib; };
 in
 options.mkOption {
-  description = "A release is an attribute set which includes a mapping from platform to package";
+  description = "Release is an attribute set which includes a mapping from platform to package";
   example = (import ./manifest.nix { inherit lib; }).cuda_cccl;
   type = types.submodule {
     # Allow any attribute name as these will be the platform names
     freeformType = types.attrsOf Package.type;
     options = {
       name = options.mkOption {
-        description = "The full name of the package";
+        description = "Full name of the package";
         example = "CXX Core Compute Libraries";
         type = types.str;
       };
       license = options.mkOption {
-        description = "The license of the package";
+        description = "License of the package";
         example = "CUDA Toolkit";
         type = types.str;
       };
       license_path = options.mkOption {
-        description = "The path to the license of the package";
+        description = "Path to the license of the package";
         example = "cuda_cccl/LICENSE.txt";
         default = null;
         type = types.nullOr types.str;
       };
       version = options.mkOption {
-        description = "The version of the package";
+        description = "Version of the package";
         example = "11.5.62";
         type = types.str;
       };
diff --git a/pkgs/development/cuda-modules/modules/generic/releases/default.nix b/pkgs/development/cuda-modules/modules/generic/releases/default.nix
index 3977fa384f52c..87985ef08134f 100644
--- a/pkgs/development/cuda-modules/modules/generic/releases/default.nix
+++ b/pkgs/development/cuda-modules/modules/generic/releases/default.nix
@@ -5,11 +5,11 @@ let
 in
 {
   options.generic.releases = options.mkOption {
-    description = "A collection of packages targeting different platforms";
+    description = "Collection of packages targeting different platforms";
     type =
       let
         Package = options.mkOption {
-          description = "A package for a specific platform";
+          description = "Package for a specific platform";
           example = {
             version = "8.0.3.4";
             minCudaVersion = "10.2";
@@ -21,19 +21,19 @@ in
             freeformType = types.attrsOf types.anything;
             options = {
               version = options.mkOption {
-                description = "The version of the package";
+                description = "Version of the package";
                 type = majorMinorPatchBuildVersion;
               };
               minCudaVersion = options.mkOption {
-                description = "The minimum CUDA version supported";
+                description = "Minimum CUDA version supported";
                 type = majorMinorVersion;
               };
               maxCudaVersion = options.mkOption {
-                description = "The maximum CUDA version supported";
+                description = "Maximum CUDA version supported";
                 type = majorMinorVersion;
               };
               hash = options.mkOption {
-                description = "The hash of the tarball";
+                description = "Hash of the tarball";
                 type = types.str;
               };
             };
diff --git a/pkgs/development/cuda-modules/modules/generic/types/default.nix b/pkgs/development/cuda-modules/modules/generic/types/default.nix
index 59ea07521c546..31e0a4403e810 100644
--- a/pkgs/development/cuda-modules/modules/generic/types/default.nix
+++ b/pkgs/development/cuda-modules/modules/generic/types/default.nix
@@ -6,34 +6,34 @@ in
   options.generic.types = options.mkOption {
     type = types.attrsOf types.optionType;
     default = { };
-    description = "A set of generic types.";
+    description = "Set of generic types";
   };
   config.generic.types = {
     cudaArch = types.strMatching "^sm_[[:digit:]]+[a-z]?$" // {
       name = "cudaArch";
-      description = "A CUDA architecture name.";
+      description = "CUDA architecture name";
     };
     # https://github.com/ConnorBaker/cuda-redist-find-features/blob/c841980e146f8664bbcd0ba1399e486b7910617b/cuda_redist_find_features/types/_lib_so_name.py
     libSoName = types.strMatching ".*\\.so(\\.[[:digit:]]+)*$" // {
       name = "libSoName";
-      description = "The name of a shared object file.";
+      description = "Name of a shared object file";
     };
 
     majorMinorVersion = types.strMatching "^([[:digit:]]+)\\.([[:digit:]]+)$" // {
       name = "majorMinorVersion";
-      description = "A version number with a major and minor component.";
+      description = "Version number with a major and minor component";
     };
 
     majorMinorPatchVersion = types.strMatching "^([[:digit:]]+)\\.([[:digit:]]+)\\.([[:digit:]]+)$" // {
       name = "majorMinorPatchVersion";
-      description = "A version number with a major, minor, and patch component.";
+      description = "Version number with a major, minor, and patch component";
     };
 
     majorMinorPatchBuildVersion =
       types.strMatching "^([[:digit:]]+)\\.([[:digit:]]+)\\.([[:digit:]]+)\\.([[:digit:]]+)$"
       // {
         name = "majorMinorPatchBuildVersion";
-        description = "A version number with a major, minor, patch, and build component.";
+        description = "Version number with a major, minor, patch, and build component";
       };
   };
 }
diff --git a/pkgs/development/cuda-modules/modules/tensorrt/default.nix b/pkgs/development/cuda-modules/modules/tensorrt/default.nix
index 0d5f035a17128..a214a26e434be 100644
--- a/pkgs/development/cuda-modules/modules/tensorrt/default.nix
+++ b/pkgs/development/cuda-modules/modules/tensorrt/default.nix
@@ -5,11 +5,11 @@
   # to the generic release.
   # {
   #   cudnnVersion = lib.options.mkOption {
-  #     description = "The CUDNN version supported";
+  #     description = "CUDNN version supported";
   #     type = types.nullOr majorMinorVersion;
   #   };
   #   filename = lib.options.mkOption {
-  #     description = "The tarball name";
+  #     description = "Tarball name";
   #     type = types.str;
   #   };
   # }
diff --git a/pkgs/development/cuda-modules/saxpy/default.nix b/pkgs/development/cuda-modules/saxpy/default.nix
index a36cec3e692b3..5eb0a235ace81 100644
--- a/pkgs/development/cuda-modules/saxpy/default.nix
+++ b/pkgs/development/cuda-modules/saxpy/default.nix
@@ -3,6 +3,7 @@
   cmake,
   cudaPackages,
   lib,
+  saxpy,
 }:
 let
   inherit (cudaPackages)
@@ -15,15 +16,21 @@ let
     cudatoolkit
     flags
     libcublas
-    setupCudaHook
     ;
   inherit (lib) getDev getLib getOutput;
+  fs = lib.fileset;
 in
 backendStdenv.mkDerivation {
   pname = "saxpy";
   version = "unstable-2023-07-11";
 
-  src = ./.;
+  src = fs.toSource {
+    root = ./.;
+    fileset = fs.unions [
+      ./CMakeLists.txt
+      ./saxpy.cu
+    ];
+  };
 
   __structuredAttrs = true;
   strictDeps = true;
@@ -51,10 +58,19 @@ backendStdenv.mkDerivation {
     (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" flags.cmakeCudaArchitecturesString)
   ];
 
+  passthru.gpuCheck = saxpy.overrideAttrs (_: {
+    requiredSystemFeatures = [ "cuda" ];
+    doInstallCheck = true;
+    postInstallCheck = ''
+      $out/bin/${saxpy.meta.mainProgram or (lib.getName saxpy)}
+    '';
+  });
+
   meta = rec {
-    description = "A simple (Single-precision AX Plus Y) FindCUDAToolkit.cmake example for testing cross-compilation";
+    description = "Simple (Single-precision AX Plus Y) FindCUDAToolkit.cmake example for testing cross-compilation";
     license = lib.licenses.mit;
     maintainers = lib.teams.cuda.members;
+    mainProgram = "saxpy";
     platforms = lib.platforms.unix;
     badPlatforms = lib.optionals (flags.isJetsonBuild && cudaOlder "11.4") platforms;
   };
diff --git a/pkgs/development/cuda-modules/write-gpu-python-test.nix b/pkgs/development/cuda-modules/write-gpu-python-test.nix
new file mode 100644
index 0000000000000..5f0d5c6b8fe68
--- /dev/null
+++ b/pkgs/development/cuda-modules/write-gpu-python-test.nix
@@ -0,0 +1,29 @@
+{
+  lib,
+  writers,
+  runCommand,
+}:
+{
+  feature ? "cuda",
+  name ? feature,
+  libraries ? [ ],
+}:
+content:
+
+let
+  tester = writers.writePython3Bin "tester-${name}" { inherit libraries; } content;
+  tester' = tester.overrideAttrs (oldAttrs: {
+    passthru.gpuCheck =
+      runCommand "test-${name}"
+        {
+          nativeBuildInputs = [ tester' ];
+          requiredSystemFeatures = [ feature ];
+        }
+        ''
+          set -e
+          ${tester.meta.mainProgram or (lib.getName tester')}
+          touch $out
+        '';
+  });
+in
+tester'