python312Packages.gpu-rir: init at 0-unstable-2025-01-20 (#403598)

This commit is contained in:
Gaétan Lepage 2025-05-02 15:17:55 +02:00 committed by GitHub
commit 502f421fb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,83 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
cmake,
setuptools,
# nativeBuildInputs
autoAddDriverRunpath,
cudaPackages,
# dependencies
numpy,
scipy,
}:
buildPythonPackage {
pname = "gpu-rir";
version = "0-unstable-2025-01-20";
pyproject = true;
src = fetchFromGitHub {
owner = "DavidDiazGuerra";
repo = "gpuRIR";
rev = "fd8af43a4a113d3c2c05f0085a0119ecb1f1a484";
hash = "sha256-nYi91iaNb9gswYzXW7aNpD3yYIgMvTen9r02G4d6joo=";
};
# Inject cmakeFlags in the cmake call
postPatch = ''
substituteInPlace setup.py \
--replace-fail \
"cmake_args = [" \
"cmake_args = os.environ.get('cmakeFlags', \"\").split() + ["
'';
build-system = [
cmake
setuptools
];
dontUseCmakeConfigure = true;
nativeBuildInputs = [
autoAddDriverRunpath
cudaPackages.cuda_nvcc
];
# TODO: Investigate why (deprecated) FindCUDA fails to set these variables
cmakeFlags = [
(lib.cmakeFeature "CUDA_CUFFT_LIBARIES" "${lib.getLib cudaPackages.libcufft}/lib/libcufft.so")
(lib.cmakeFeature "CUDA_curand_LIBRARY" "${lib.getLib cudaPackages.libcurand}/lib/libcurand.so")
];
buildInputs = with cudaPackages; [
cuda_cccl # <nv/target>
cuda_cudart # cuda_runtime.h
libcufft
libcurand
];
dependencies = [
numpy
scipy
];
pythonImportsCheck = [ "gpuRIR" ];
# Fails at import because there is no GPU access in the sandbox:
# Check whether the following modules can be imported: gpuRIR
# GPUassert: CUDA driver version is insufficient for CUDA runtime version /build/source/src/gpuRIR_cuda.cu 1037
dontUsePythonImportsCheck = true;
# No tests
doCheck = false;
meta = {
description = "Python library for Room Impulse Response (RIR) simulation with GPU acceleration";
homepage = "https://github.com/DavidDiazGuerra/gpuRIR";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}

View file

@ -5914,6 +5914,8 @@ self: super: with self; {
gptcache = callPackage ../development/python-modules/gptcache { };
gpu-rir = callPackage ../development/python-modules/gpu-rir { };
gpuctypes = callPackage ../development/python-modules/gpuctypes { };
gpustat = callPackage ../development/python-modules/gpustat { };