Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.lightgbm: add GPU support #221775

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions pkgs/development/python-modules/lightgbm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
, scikit-learn
, llvmPackages ? null
, pythonOlder
, python
, ocl-icd
, opencl-headers
, boost
, gpuSupport ? true
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved
}:

buildPythonPackage rec {
Expand All @@ -28,16 +33,24 @@ buildPythonPackage rec {

dontUseCmakeConfigure = true;

buildInputs = lib.optionals stdenv.cc.isClang [
buildInputs = (lib.optionals stdenv.cc.isClang [
llvmPackages.openmp
];
]) ++ (lib.optionals gpuSupport [
boost
ocl-icd
opencl-headers
]);

propagatedBuildInputs = [
numpy
scipy
scikit-learn
];

buildPhase = ''
${python.pythonForBuild.interpreter} setup.py bdist_wheel ${lib.optionalString gpuSupport "--gpu"}
'';

postConfigure = ''
export HOME=$(mktemp -d)
'';
Expand All @@ -51,11 +64,11 @@ buildPythonPackage rec {
"lightgbm"
];

meta = with lib; {
meta = {
description = "A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework";
homepage = "https://github.com/Microsoft/LightGBM";
changelog = "https://github.com/microsoft/LightGBM/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ teh costrouc ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ teh costrouc ];
};
}