mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
parent
c76883f955
commit
231aca2b97
@ -33,6 +33,7 @@ in
|
||||
, which
|
||||
# Build inputs
|
||||
, bash
|
||||
, callPackage
|
||||
, conmon
|
||||
, coreutils
|
||||
, cryptsetup
|
||||
@ -271,5 +272,38 @@ in
|
||||
singularity = finalAttrs.finalPackage;
|
||||
};
|
||||
};
|
||||
gpuChecks = lib.optionalAttrs (projectName == "apptainer") {
|
||||
# Should be in tests, but Ofborg would skip image-hello-cowsay because
|
||||
# saxpy is unfree.
|
||||
image-saxpy = callPackage
|
||||
({ singularity-tools, cudaPackages }:
|
||||
singularity-tools.buildImage {
|
||||
name = "saxpy";
|
||||
contents = [ cudaPackages.saxpy ];
|
||||
memSize = 2048;
|
||||
diskSize = 2048;
|
||||
singularity = finalAttrs.finalPackage;
|
||||
})
|
||||
{ };
|
||||
saxpy =
|
||||
callPackage
|
||||
({ runCommand, writeShellScriptBin }:
|
||||
let
|
||||
unwrapped = writeShellScriptBin "apptainer-cuda-saxpy"
|
||||
''
|
||||
${lib.getExe finalAttrs.finalPackage} exec --nv $@ ${finalAttrs.passthru.gpuChecks.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