Skip to content

Commit b70b3ee

Browse files
committed
python3Packages.rembg: fix cuda build
1 parent fa645ab commit b70b3ee

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkgs/development/python-modules/rembg/default.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@
3333

3434
# tests
3535
versionCheckHook,
36+
pocl,
3637

3738
withCli ? false,
39+
config,
40+
cudaSupport ? config.cudaSupport,
41+
writableTmpDirAsHomeHook,
3842
}:
3943

4044
let
@@ -102,6 +106,12 @@ buildPythonPackage (finalAttrs: {
102106
# not running python tests, as they require network access
103107
nativeCheckInputs = lib.optionals withCli [
104108
versionCheckHook
109+
] ++ lib.optionals cudaSupport [
110+
# Provides a CPU-based OpenCL ICD so that pyopencl's module-level
111+
# cl.create_some_context() succeeds without GPU hardware.
112+
pocl
113+
# pocl needs a writable $HOME for its kernel cache directory.
114+
writableTmpDirAsHomeHook
105115
];
106116
versionCheckKeepEnvironment = [
107117
# Otherwise, fail with:

0 commit comments

Comments
 (0)