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.
This commit is contained in:
parent
d10acb2d69
commit
23f815f12c
|
@ -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;
|
||||
}
|
|
@ -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 ];
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -47,5 +47,7 @@ with pkgs;
|
|||
|
||||
texlive = callPackage ./texlive {};
|
||||
|
||||
cuda = callPackage ./cuda { };
|
||||
|
||||
writers = callPackage ../build-support/writers/test.nix {};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue