Skip to content

Commit 5a7e28e

Browse files
committed
docs: πŸ“ clarify cupy always needs a manual install
Cellpose gets GPU support for free via PyTorch's self-contained CUDA wheels; cupy (dog plugin, dilate_labels' use_gpu) doesn't work that way β€” it ships one wheel per CUDA major version, so patchworks never installs it automatically. Spells this out in the README, getting_started.md, and custom_segmentation.md, and adds the previously-missing dog extra to both install lists.
1 parent 8a1ef97 commit 5a7e28e

3 files changed

Lines changed: 33 additions & 2 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pip install "patchworks[gpu]" # GPU VRAM querying (nvidia-ml-py)
4040
pip install "patchworks[cellpose]" # Cellpose plugin (>=3.0, v3 or v4)
4141
pip install "patchworks[cellpose3]" # Cellpose plugin, pinned to v3.x
4242
pip install "patchworks[cellpose4]" # Cellpose plugin, pinned to v4+
43+
pip install "patchworks[dog]" # deconvolution + DoG plugin (pycudadecon)
4344
pip install "patchworks[bioio]" # convert any image format to OME-ZARR
4445
pip install "patchworks[imaris]" # convert Imaris .ims files to OME-ZARR
4546
pip install "patchworks[napari]" # interactive napari viewer plugin
@@ -52,6 +53,14 @@ pip install "patchworks[all]" # Everything, incl. the napari viewer
5253
> `[imaris]` adds native `.ims` support (HDF5, no JVM). Physical pixel
5354
> calibration is read from the input and written into the OME-ZARR.
5455
56+
> **`cupy` is never installed automatically**, unlike Cellpose's GPU support
57+
> (which comes for free via PyTorch's self-contained CUDA wheels). Any
58+
> `use_gpu=True`/`dilate_gpu: true` option (the `dog` plugin, `dilate_labels`)
59+
> needs `cupy` installed separately, matching your CUDA version β€” e.g.
60+
> `pip install cupy-cuda12x`. Not bundled because cupy ships one wheel per
61+
> CUDA major version; a generic pin would resolve to the wrong build (or fail
62+
> to resolve) depending on the machine.
63+
5564
---
5665

5766
## Quick start β€” 5 lines
@@ -307,10 +316,14 @@ Optional:
307316
- `tqdm` β€” progress bars
308317
- `cellpose` β€” Cellpose plugin, v3 or v4 (`patchworks[cellpose]`);
309318
pin with `[cellpose3]` or `[cellpose4]`
319+
- `pycudadecon` β€” deconvolution step of the `dog` plugin (`patchworks[dog]`)
310320
- `bioio` + readers β€” convert CZI/LIF/ND2/OME-TIFF/… to OME-ZARR
311321
(`patchworks[bioio]`)
312322
- `imaris-ims-file-reader` β€” convert Imaris `.ims` (`patchworks[imaris]`)
313323
- `napari` β€” interactive viewer plugin (`patchworks[napari]`)
324+
- `cupy` β€” **install manually**, matching your CUDA version (e.g.
325+
`pip install cupy-cuda12x`); not offered as an extra since it isn't one
326+
generic pin. Needed for `use_gpu=True`/`dilate_gpu: true`.
314327

315328
---
316329

β€Ždocs/getting_started.mdβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,25 @@ patchworks can be installed from PyPI on all operating systems, for Python β‰₯ 3
3636
pip install "patchworks[cellpose]"
3737
```
3838

39+
=== "With deconvolution + DoG plugin"
40+
41+
```bash
42+
pip install "patchworks[dog]"
43+
```
44+
3945
=== "Everything"
4046

4147
```bash
4248
pip install "patchworks[all]"
4349
```
4450

51+
!!! note "cupy is always a manual install"
52+
`use_gpu=True` (the `dog` plugin, `dilate_labels`) needs `cupy`, but it's
53+
never pulled in automatically β€” unlike Cellpose, which gets GPU support
54+
for free via PyTorch's self-contained CUDA wheels, `cupy` ships one wheel
55+
per CUDA major version. Install the one matching your CUDA version
56+
yourself, e.g. `pip install cupy-cuda12x`.
57+
4558
---
4659

4760
## The one function you need

β€Ždocs/guide/custom_segmentation.mdβ€Ž

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,15 @@ By default the dilation itself runs on CPU (scipy), independent of whatever
7878
backend `fn` used β€” pass `use_gpu=True` to dilate via cupy instead:
7979

8080
```python
81-
fn = dilate_labels(fn, iterations=2, use_gpu=True) # needs cupy installed
81+
fn = dilate_labels(fn, iterations=2, use_gpu=True)
8282
```
8383

84-
On the cluster, this is the `dilate_gpu: true` config key.
84+
Needs `cupy` installed **manually**, matching your CUDA version (e.g.
85+
`pip install cupy-cuda12x`) β€” it's never installed automatically by
86+
patchworks, unlike Cellpose's GPU support (which comes for free via
87+
PyTorch's self-contained CUDA wheels); cupy ships one wheel per CUDA major
88+
version, so there's no single generic pin that works everywhere. On the
89+
cluster, this is the `dilate_gpu: true` config key.
8590

8691
## Real example: StarDist 3-D, with model caching
8792

0 commit comments

Comments
Β (0)