mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 20:03:16 +00:00
apptainer: add a cuda test
This commit is contained in:
parent
07305dff4f
commit
0c4fe1f452
@ -33,6 +33,7 @@ in
|
|||||||
, which
|
, which
|
||||||
# Build inputs
|
# Build inputs
|
||||||
, bash
|
, bash
|
||||||
|
, callPackage
|
||||||
, conmon
|
, conmon
|
||||||
, coreutils
|
, coreutils
|
||||||
, cryptsetup
|
, cryptsetup
|
||||||
@ -269,6 +270,37 @@ in
|
|||||||
contents = [ hello cowsay ];
|
contents = [ hello cowsay ];
|
||||||
singularity = finalAttrs.finalPackage;
|
singularity = finalAttrs.finalPackage;
|
||||||
};
|
};
|
||||||
|
image-saxpy = callPackage
|
||||||
|
({ singularity-tools, cudaPackages }:
|
||||||
|
singularity-tools.buildImage {
|
||||||
|
name = "saxpy";
|
||||||
|
contents = [ cudaPackages.saxpy ];
|
||||||
|
memSize = 2048;
|
||||||
|
diskSize = 2048;
|
||||||
|
singularity = finalAttrs.finalPackage;
|
||||||
|
})
|
||||||
|
{ };
|
||||||
|
};
|
||||||
|
gpuChecks = lib.optionalAttrs (projectName == "apptainer") {
|
||||||
|
saxpy =
|
||||||
|
callPackage
|
||||||
|
({ runCommand, writeShellScriptBin }:
|
||||||
|
let
|
||||||
|
unwrapped = writeShellScriptBin "apptainer-cuda-saxpy"
|
||||||
|
''
|
||||||
|
${lib.getExe finalAttrs.finalPackage} exec --nv --nvccli ${finalAttrs.passthru.tests.image-saxpy} saxpy
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
runCommand "run-apptainer-cuda-saxpy"
|
||||||
|
{
|
||||||
|
requiredSystemFeatures = [ "cuda" ];
|
||||||
|
nativeBuildInputs = [ unwrapped ];
|
||||||
|
passthru = { inherit unwrapped; };
|
||||||
|
}
|
||||||
|
''
|
||||||
|
apptainer-cuda-saxpy
|
||||||
|
'')
|
||||||
|
{ };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user