2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
cmake,
|
|
|
|
config,
|
|
|
|
cudaPackages,
|
|
|
|
cudaSupport ? config.cudaSupport,
|
|
|
|
fetchzip,
|
|
|
|
ispc,
|
|
|
|
lib,
|
|
|
|
python3,
|
|
|
|
stdenv,
|
|
|
|
tbb,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openimagedenoise";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
# The release tarballs include pretrained weights, which would otherwise need to be fetched with git-lfs
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/OpenImageDenoise/oidn/releases/download/v${version}/oidn-${version}.src.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-ZIrs4oEb+PzdMh2x2BUFXKyu/HBlFb3CJX24ciEHy3Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = lib.optional cudaSupport ./cuda.patch;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
python3
|
|
|
|
ispc
|
|
|
|
] ++ lib.optional cudaSupport cudaPackages.cuda_nvcc;
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ tbb ]
|
|
|
|
++ lib.optionals cudaSupport [
|
|
|
|
cudaPackages.cuda_cudart
|
|
|
|
cudaPackages.cuda_cccl
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
cmakeFlags = [
|
2024-04-21 15:54:59 +00:00
|
|
|
(lib.cmakeBool "OIDN_DEVICE_CUDA" cudaSupport)
|
|
|
|
(lib.cmakeFeature "TBB_INCLUDE_DIR" "${tbb.dev}/include")
|
|
|
|
(lib.cmakeFeature "TBB_ROOT" "${tbb}")
|
2023-02-22 10:55:15 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://openimagedenoise.github.io";
|
|
|
|
description = "High-Performance Denoising Library for Ray Tracing";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.leshainc ];
|
|
|
|
platforms = platforms.unix;
|
2021-06-28 23:13:55 +00:00
|
|
|
changelog = "https://github.com/OpenImageDenoise/oidn/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|