nixos-config/pkgs/peakperf/default.nix

48 lines
996 B
Nix
Raw Normal View History

2024-09-26 11:27:34 +02:00
{
2024-10-01 11:36:42 +02:00
config,
2024-09-26 11:27:34 +02:00
lib,
stdenv,
fetchFromGitHub,
cmake,
2024-10-01 11:36:42 +02:00
enableCuda ? config.cudaSupport,
cudaPackages ? { },
2024-09-26 11:27:34 +02:00
}:
2024-10-01 11:36:42 +02:00
let
effectiveStdenv = if enableCuda then cudaPackages.backendStdenv else stdenv;
in
effectiveStdenv.mkDerivation (finalAttrs: {
2024-09-26 11:27:34 +02:00
pname = "peakperf";
version = "1.17";
src = fetchFromGitHub {
owner = "Dr-Noob";
repo = "peakperf";
rev = "v${finalAttrs.version}";
hash = "sha256-bP38oo0tHDvzbWHiNwbkQoM7ZQ4nwTimVYfbPh0FUd4=";
};
2024-10-01 11:36:42 +02:00
buildInputs =
[ ]
++ lib.optionals enableCuda [
cudaPackages.cuda_cudart
cudaPackages.cudatoolkit
cudaPackages.cuda-samples
2024-10-01 11:36:42 +02:00
];
nativeBuildInputs =
[
cmake
]
++ lib.optionals enableCuda [
cudaPackages.cuda_nvcc
];
2024-09-26 11:27:34 +02:00
meta = {
description = "Achieve peak performance on x86 CPUs and NVIDIA GPUs";
homepage = "https://github.com/Dr-Noob/peakperf";
license = lib.licenses.gpl2Only;
mainProgram = "peakperf";
platforms = lib.platforms.all;
};
})