apptainer: add a cuda test

This commit is contained in:
Someone Serge 2024-01-06 22:50:52 +00:00
parent 07305dff4f
commit 0c4fe1f452
No known key found for this signature in database
GPG Key ID: 7B0E3B1390D61DA4

View File

@ -33,6 +33,7 @@ in
, which
# Build inputs
, bash
, callPackage
, conmon
, coreutils
, cryptsetup
@ -269,6 +270,37 @@ in
contents = [ hello cowsay ];
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
'')
{ };
};
};
})