diff options
author | Someone <sergei.kozlukov@aalto.fi> | 2024-01-15 14:31:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-15 14:31:08 +0000 |
commit | 447236a22f15db0286a6a9b0f9c2c74123f8bbba (patch) | |
tree | fdc7b6d1added0fcd44b30fd1f6d96915a1b7df4 | |
parent | fe3649c55756508577e8308db0f5542071597714 (diff) | |
parent | 18b114d8bf40e26c86e3d2eadc4df1e5e3fcfb0d (diff) |
Merge pull request #280386 from SomeoneSerge/fix/tests.cuda
tests.cuda: inherit the ready cudaPackages_XX.cuda-samples
-rw-r--r-- | pkgs/development/cuda-modules/cuda-library-samples/extension.nix (renamed from pkgs/test/cuda/cuda-library-samples/extension.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/cuda-modules/cuda-library-samples/generic.nix (renamed from pkgs/test/cuda/cuda-library-samples/generic.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/cuda-modules/cuda-samples/extension.nix (renamed from pkgs/test/cuda/cuda-samples/extension.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/cuda-modules/cuda-samples/generic.nix (renamed from pkgs/test/cuda/cuda-samples/generic.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/cuda-modules/saxpy/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/cuda-modules/setup-hooks/extension.nix | 7 | ||||
-rw-r--r-- | pkgs/test/cuda/default.nix | 77 | ||||
-rw-r--r-- | pkgs/top-level/cuda-packages.nix | 4 |
8 files changed, 62 insertions, 36 deletions
diff --git a/pkgs/test/cuda/cuda-library-samples/extension.nix b/pkgs/development/cuda-modules/cuda-library-samples/extension.nix index 4cb34af732095..4cb34af732095 100644 --- a/pkgs/test/cuda/cuda-library-samples/extension.nix +++ b/pkgs/development/cuda-modules/cuda-library-samples/extension.nix diff --git a/pkgs/test/cuda/cuda-library-samples/generic.nix b/pkgs/development/cuda-modules/cuda-library-samples/generic.nix index d4182536654e1..d4182536654e1 100644 --- a/pkgs/test/cuda/cuda-library-samples/generic.nix +++ b/pkgs/development/cuda-modules/cuda-library-samples/generic.nix diff --git a/pkgs/test/cuda/cuda-samples/extension.nix b/pkgs/development/cuda-modules/cuda-samples/extension.nix index d41da90cd5d0e..d41da90cd5d0e 100644 --- a/pkgs/test/cuda/cuda-samples/extension.nix +++ b/pkgs/development/cuda-modules/cuda-samples/extension.nix diff --git a/pkgs/test/cuda/cuda-samples/generic.nix b/pkgs/development/cuda-modules/cuda-samples/generic.nix index fb3d7cc99da95..fb3d7cc99da95 100644 --- a/pkgs/test/cuda/cuda-samples/generic.nix +++ b/pkgs/development/cuda-modules/cuda-samples/generic.nix diff --git a/pkgs/development/cuda-modules/saxpy/default.nix b/pkgs/development/cuda-modules/saxpy/default.nix index 9c6692cb0b313..68c60e2d84464 100644 --- a/pkgs/development/cuda-modules/saxpy/default.nix +++ b/pkgs/development/cuda-modules/saxpy/default.nix @@ -16,6 +16,7 @@ let libcublas setupCudaHook ; + inherit (lib) getDev getLib getOutput; in backendStdenv.mkDerivation { pname = "saxpy"; @@ -36,9 +37,9 @@ backendStdenv.mkDerivation { buildInputs = lib.optionals (lib.versionOlder cudaVersion "11.4") [cudatoolkit] ++ lib.optionals (lib.versionAtLeast cudaVersion "11.4") [ - libcublas.dev - libcublas.lib - libcublas.static + (getDev libcublas) + (getLib libcublas) + (getOutput "static" libcublas) cuda_cudart ] ++ lib.optionals (lib.versionAtLeast cudaVersion "12.0") [cuda_cccl]; @@ -50,10 +51,11 @@ backendStdenv.mkDerivation { )) ]; - meta = { + meta = rec { description = "A simple (Single-precision AX Plus Y) FindCUDAToolkit.cmake example for testing cross-compilation"; license = lib.licenses.mit; maintainers = lib.teams.cuda.members; platforms = lib.platforms.unix; + badPlatforms = lib.optionals flags.isJetsonBuild platforms; }; } diff --git a/pkgs/development/cuda-modules/setup-hooks/extension.nix b/pkgs/development/cuda-modules/setup-hooks/extension.nix index 10f126bc12fbf..5141bc9717f93 100644 --- a/pkgs/development/cuda-modules/setup-hooks/extension.nix +++ b/pkgs/development/cuda-modules/setup-hooks/extension.nix @@ -53,7 +53,7 @@ final: _: { autoAddCudaCompatRunpathHook = final.callPackage ( - {makeSetupHook, cuda_compat ? throw "autoAddCudaCompatRunpathHook: No cuda_compat for CUDA ${final.cudaMajorMinorVersion}" }: + {makeSetupHook, cuda_compat ? null }: makeSetupHook { name = "auto-add-cuda-compat-runpath-hook"; @@ -61,7 +61,12 @@ final: _: { # Hotfix Ofborg evaluation libcudaPath = if final.flags.isJetsonBuild then "${cuda_compat}/compat" else null; }; + meta.broken = !final.flags.isJetsonBuild; + + # Pre-cuda_compat CUDA release: + meta.badPlatforms = final.lib.optionals (cuda_compat == null) final.lib.platforms.all; + meta.platforms = cuda_compat.platforms or [ ]; } ./auto-add-cuda-compat-runpath.sh ) diff --git a/pkgs/test/cuda/default.nix b/pkgs/test/cuda/default.nix index 8431e4b9207db..dd9ad8b814dc5 100644 --- a/pkgs/test/cuda/default.nix +++ b/pkgs/test/cuda/default.nix @@ -1,32 +1,51 @@ -{callPackage}: +{ + lib, + recurseIntoAttrs, -rec { - cuda-samplesPackages = callPackage ./cuda-samples/generic.nix {}; - inherit (cuda-samplesPackages) - cuda-samples_cudatoolkit_10 - cuda-samples_cudatoolkit_10_0 - cuda-samples_cudatoolkit_10_1 - cuda-samples_cudatoolkit_10_2 - cuda-samples_cudatoolkit_11 - cuda-samples_cudatoolkit_11_0 - cuda-samples_cudatoolkit_11_1 - cuda-samples_cudatoolkit_11_2 - cuda-samples_cudatoolkit_11_3 - cuda-samples_cudatoolkit_11_4 - ; + cudaPackages, + cudaPackagesGoogle, - cuda-library-samplesPackages = callPackage ./cuda-library-samples/generic.nix {}; - inherit (cuda-library-samplesPackages) - cuda-library-samples_cudatoolkit_10 - cuda-library-samples_cudatoolkit_10_1 - cuda-library-samples_cudatoolkit_10_2 - cuda-library-samples_cudatoolkit_11 - cuda-library-samples_cudatoolkit_11_0 - cuda-library-samples_cudatoolkit_11_1 - cuda-library-samples_cudatoolkit_11_2 - cuda-library-samples_cudatoolkit_11_3 - cuda-library-samples_cudatoolkit_11_4 - ; + cudaPackages_10_0, + cudaPackages_10_1, + cudaPackages_10_2, + cudaPackages_10, - __attrsFailEvaluation = true; -} + cudaPackages_11_0, + cudaPackages_11_1, + cudaPackages_11_2, + cudaPackages_11_3, + cudaPackages_11_4, + cudaPackages_11_5, + cudaPackages_11_6, + cudaPackages_11_7, + cudaPackages_11_8, + cudaPackages_11, + + cudaPackages_12_0, + cudaPackages_12_1, + cudaPackages_12_2, + cudaPackages_12_3, + cudaPackages_12, +}@args: + +let + isTest = + name: package: + builtins.elem (package.pname or null) [ + "cuda-samples" + "cuda-library-samples" + "saxpy" + ]; +in +(lib.trivial.pipe args [ + (lib.filterAttrs (name: _: lib.hasPrefix "cudaPackages" name)) + (lib.mapAttrs ( + _: ps: + lib.pipe ps [ + (lib.filterAttrs isTest) + (as: as // { __attrsFailEvaluation = true; }) + recurseIntoAttrs + ] + )) + recurseIntoAttrs +]) diff --git a/pkgs/top-level/cuda-packages.nix b/pkgs/top-level/cuda-packages.nix index f20a361522031..4b8ad4646485e 100644 --- a/pkgs/top-level/cuda-packages.nix +++ b/pkgs/top-level/cuda-packages.nix @@ -106,8 +106,8 @@ let shimsFn = ../development/cuda-modules/tensorrt/shims.nix; fixupFn = ../development/cuda-modules/tensorrt/fixup.nix; }) - (callPackage ../test/cuda/cuda-samples/extension.nix {inherit cudaVersion;}) - (callPackage ../test/cuda/cuda-library-samples/extension.nix {}) + (callPackage ../development/cuda-modules/cuda-samples/extension.nix {inherit cudaVersion;}) + (callPackage ../development/cuda-modules/cuda-library-samples/extension.nix {}) ]; cudaPackages = customisation.makeScope newScope ( |