From d10acb2d69360cf502743301a2770c9012f72ff1 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 17 Mar 2021 18:17:31 +0000 Subject: [PATCH 1/3] maintainers: Add "Obsidian Systems Maintenance" This would be a "company maintainer" so the work can be shared between employees without hard-coding who those employees are. --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9efca53200f9..03a16d860b8b 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6987,6 +6987,12 @@ githubId = 3359345; name = "obadz"; }; + obsidian-systems-maintainence = { + name = "Obsidian Systems Maintenance"; + email = "maintainer@obsidian.systems"; + github = "obsidian-systems-maintenance"; + githubId = 80847921; + }; odi = { email = "oliver.dunkl@gmail.com"; github = "odi"; From 23f815f12c6cd3850f0df3723372e7fe9aea804b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 9 Mar 2021 13:04:03 -0500 Subject: [PATCH 2/3] tests.cuda.cuda-sample_*: Init at supported CUDA toolkit versions Since CUDA is unfree, we won't actually use this when testing Nixpkgs officially. But I want to include this as they are useful for users of Nixpkgs trying to set up / debug a CUDA environment. --- pkgs/test/cuda/cuda-samples/default.nix | 52 +++++++++++++++++++++++++ pkgs/test/cuda/cuda-samples/generic.nix | 51 ++++++++++++++++++++++++ pkgs/test/cuda/default.nix | 16 ++++++++ pkgs/test/default.nix | 2 + 4 files changed, 121 insertions(+) create mode 100644 pkgs/test/cuda/cuda-samples/default.nix create mode 100644 pkgs/test/cuda/cuda-samples/generic.nix create mode 100644 pkgs/test/cuda/default.nix diff --git a/pkgs/test/cuda/cuda-samples/default.nix b/pkgs/test/cuda/cuda-samples/default.nix new file mode 100644 index 000000000000..46d4d531690d --- /dev/null +++ b/pkgs/test/cuda/cuda-samples/default.nix @@ -0,0 +1,52 @@ +{ callPackage +, cudatoolkit_9_2 +, cudatoolkit_10_0, cudatoolkit_10_1, cudatoolkit_10_2 +, cudatoolkit_11_0, cudatoolkit_11_1, cudatoolkit_11_2 +}: + +rec { + cuda-samples_cudatoolkit_9_2 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_9_2; + sha256 = "1ydankhyigcg99h0rqnmz1z4vc0sl6p9s1s0hbdxh5l1sx9141j6"; + }; + + cuda-samples_cudatoolkit_9 = cuda-samples_cudatoolkit_9_2; + + ## + + cuda-samples_cudatoolkit_10_0 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_10_0; + sha256 = "1zvh4xsdyc59m87brpcmssxsjlp9dkynh4asnkcmc3g94f53l0jw"; + }; + + cuda-samples_cudatoolkit_10_1 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_10_1; + sha256 = "1s8ka0hznrni36ajhzf2gqpdrl8kd8fi047qijxks5l2abc093qd"; + }; + + cuda-samples_cudatoolkit_10_2 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_10_2; + sha256 = "01p1innzgh9siacpld6nsqimj8jkg93rk4gj8q4crn62pa5vhd94"; + }; + + cuda-samples_cudatoolkit_10 = cuda-samples_cudatoolkit_10_2; + + ## + + cuda-samples_cudatoolkit_11_0 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_11_0; + sha256 = "1n3vjc8c7zdig2xgl5fppavrphqzhdiv9m9nk6smh4f99fwi0705"; + }; + + cuda-samples_cudatoolkit_11_1 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_11_1; + sha256 = "1kjixk50i8y1bkiwbdn5lkv342crvkmbvy1xl5j3lsa1ica21kwh"; + }; + + cuda-samples_cudatoolkit_11_2 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_11_2; + sha256 = "1p1qjvfbm28l933mmnln02rqrf0cy9kbpsyb488d1haiqzvrazl1"; + }; + + cuda-samples_cudatoolkit_11 = cuda-samples_cudatoolkit_11_2; +} diff --git a/pkgs/test/cuda/cuda-samples/generic.nix b/pkgs/test/cuda/cuda-samples/generic.nix new file mode 100644 index 000000000000..a104f88ad4b2 --- /dev/null +++ b/pkgs/test/cuda/cuda-samples/generic.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchFromGitHub +, pkg-config, addOpenGLRunpath +, sha256, cudatoolkit +}: + +let + pname = "cuda-samples"; + version = lib.versions.majorMinor cudatoolkit.version; +in + +stdenv.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "NVIDIA"; + repo = pname; + rev = "v${version}"; + inherit sha256; + }; + + nativeBuildInputs = [ pkg-config addOpenGLRunpath ]; + + buildInputs = [ cudatoolkit ]; + + enableParallelBuilding = true; + + preConfigure = '' + export CUDA_PATH=${cudatoolkit} + ''; + + installPhase = '' + runHook preInstall + + install -Dm755 -t $out/bin bin/${stdenv.hostPlatform.parsed.cpu.name}/${stdenv.hostPlatform.parsed.kernel.name}/release/* + + runHook postInstall + ''; + + postFixup = '' + for exe in $out/bin/*; do + addOpenGLRunpath $exe + done + ''; + + meta = { + description = "Samples for CUDA Developers which demonstrates features in CUDA Toolkit"; + # CUDA itself is proprietary, but these sample apps are not. + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ obsidian-systems-maintainence ]; + }; +} diff --git a/pkgs/test/cuda/default.nix b/pkgs/test/cuda/default.nix new file mode 100644 index 000000000000..a3b0f8a66d1b --- /dev/null +++ b/pkgs/test/cuda/default.nix @@ -0,0 +1,16 @@ +{ callPackage }: + +rec { + cuda-samplesPackages = callPackage ./cuda-samples { }; + inherit (cuda-samplesPackages) + cuda-samples_cudatoolkit_9 + cuda-samples_cudatoolkit_9_2 + 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; +} diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index f45e981cff07..fa93ceb0721e 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -47,5 +47,7 @@ with pkgs; texlive = callPackage ./texlive {}; + cuda = callPackage ./cuda { }; + writers = callPackage ../build-support/writers/test.nix {}; } From c1ced05ec4330c4241cfd2e32c071470feeb9e8f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 12 Mar 2021 15:06:09 -0500 Subject: [PATCH 3/3] tests.cude.cuda-library-samples.{cublas,cusolver}: init at master Well, strictly speaking, master + https://github.com/NVIDIA/CUDALibrarySamples/pull/29 --- .../cuda/cuda-library-samples/default.nix | 35 +++++++++++++ .../cuda/cuda-library-samples/generic.nix | 51 +++++++++++++++++++ pkgs/test/cuda/default.nix | 10 ++++ 3 files changed, 96 insertions(+) create mode 100644 pkgs/test/cuda/cuda-library-samples/default.nix create mode 100644 pkgs/test/cuda/cuda-library-samples/generic.nix diff --git a/pkgs/test/cuda/cuda-library-samples/default.nix b/pkgs/test/cuda/cuda-library-samples/default.nix new file mode 100644 index 000000000000..501828c9a1fa --- /dev/null +++ b/pkgs/test/cuda/cuda-library-samples/default.nix @@ -0,0 +1,35 @@ +{ callPackage +, cudatoolkit_10_1, cudatoolkit_10_2 +, cudatoolkit_11_0, cudatoolkit_11_1, cudatoolkit_11_2 +}: + +rec { + + cuda-library-samples_cudatoolkit_10_1 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_10_1; + }; + + cuda-library-samples_cudatoolkit_10_2 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_10_2; + }; + + cuda-library-samples_cudatoolkit_10 = + cuda-library-samples_cudatoolkit_10_2; + + ## + + cuda-library-samples_cudatoolkit_11_0 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_11_0; + }; + + cuda-library-samples_cudatoolkit_11_1 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_11_1; + }; + + cuda-library-samples_cudatoolkit_11_2 = callPackage ./generic.nix { + cudatoolkit = cudatoolkit_11_2; + }; + + cuda-library-samples_cudatoolkit_11 = + cuda-library-samples_cudatoolkit_11_2; +} diff --git a/pkgs/test/cuda/cuda-library-samples/generic.nix b/pkgs/test/cuda/cuda-library-samples/generic.nix new file mode 100644 index 000000000000..75d4541d9866 --- /dev/null +++ b/pkgs/test/cuda/cuda-library-samples/generic.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchFromGitHub +, cmake, addOpenGLRunpath +, cudatoolkit +}: + +let + rev = "5aab680905d853bce0dbad4c488e4f7e9f7b2302"; + src = fetchFromGitHub { + owner = "NVIDIA"; + repo = "CUDALibrarySamples"; + inherit rev; + sha256 = "0gwgbkq05ygrfgg5hk07lmap7n7ampxv0ha1axrv8qb748ph81xs"; + }; + commonAttrs = { + version = lib.strings.substring 0 7 rev + "-" + lib.versions.majorMinor cudatoolkit.version; + nativeBuildInputs = [ cmake addOpenGLRunpath ]; + buildInputs = [ cudatoolkit ]; + enableParallelBuilding = true; + postFixup = '' + for exe in $out/bin/*; do + addOpenGLRunpath $exe + done + ''; + meta = { + description = "examples of using libraries using CUDA"; + longDescription = '' + CUDA Library Samples contains examples demonstrating the use of + features in the math and image processing libraries cuBLAS, cuTENSOR, + cuSPARSE, cuSOLVER, cuFFT, cuRAND, NPP and nvJPEG. + ''; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ obsidian-systems-maintainence ]; + }; + }; +in + +{ + cublas = stdenv.mkDerivation (commonAttrs // { + pname = "cuda-library-samples-cublas"; + + src = "${src}/cuBLASLt"; + }); + + cusolver = stdenv.mkDerivation (commonAttrs // { + pname = "cuda-library-samples-cusolver"; + + src = "${src}/cuSOLVER"; + + sourceRoot = "cuSOLVER/gesv"; + }); +} diff --git a/pkgs/test/cuda/default.nix b/pkgs/test/cuda/default.nix index a3b0f8a66d1b..9e7eaf8036a7 100644 --- a/pkgs/test/cuda/default.nix +++ b/pkgs/test/cuda/default.nix @@ -13,4 +13,14 @@ rec { cuda-samples_cudatoolkit_11_0 cuda-samples_cudatoolkit_11_1 cuda-samples_cudatoolkit_11_2; + + cuda-library-samplesPackages = callPackage ./cuda-library-samples { }; + 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; }