You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -30,12 +31,33 @@ Ignite](https://pytorch.org/ignite/), please follow the instructions:
30
31
31
32
-[Installing the recommended dependencies](#installing-the-recommended-dependencies)
32
33
33
-
The installation commands below usually end up installing CPU variant of PyTorch. To install GPU-enabled PyTorch:
34
+
---
35
+
36
+
## GPU-enabled installation (CUDA and CuPy)
37
+
38
+
The installation commands below usually end up installing the CPU variant of PyTorch. To install GPU-enabled PyTorch:
34
39
35
40
1. Install the latest NVIDIA driver.
36
41
1. Check [PyTorch Official Guide](https://pytorch.org/get-started/locally/) for the recommended CUDA versions. For Pip package, the user needs to download the CUDA manually, install it on the system, and ensure CUDA_PATH is set properly.
37
42
1. Continue to follow the guide and install PyTorch.
38
-
1. Install MONAI using one the ways described below.
43
+
1. Install MONAI using one of the ways described below.
44
+
45
+
Installing GPU-enabled PyTorch is enough to run models and transforms on the GPU. Some transforms,
46
+
however, additionally use [CuPy](https://cupy.dev/) for GPU-accelerated array operations (for example
47
+
when a transform converts a CUDA tensor via `convert_to_cupy`). If CuPy is not installed, these code
48
+
paths raise `OptionalImportError: import cupy (No module named 'cupy')`.
49
+
50
+
CuPy is provided through the `cucim` extra, so installing MONAI with that extra pulls in a compatible
51
+
CuPy build:
52
+
53
+
```bash
54
+
pip install 'monai[cucim]'
55
+
```
56
+
57
+
If you prefer to install CuPy directly, note that the PyPI package name is CUDA-version specific
58
+
(e.g. `cupy-cuda12x` for CUDA 12.x, `cupy-cuda11x` for CUDA 11.x) rather than plain `cupy`. See the
59
+
[CuPy installation guide](https://docs.cupy.dev/en/stable/install.html) for the correct package for
60
+
your CUDA toolkit.
39
61
40
62
---
41
63
@@ -298,3 +320,6 @@ O(N log N) alternatives to windowed self-attention). Install with
298
320
`pip install 'monai[hyena]'`.
299
321
300
322
-`pip install 'monai[all]'` installs all the optional dependencies.
323
+
- The `cucim` extra also provides [CuPy](https://cupy.dev/), which is required by GPU-accelerated
324
+
transforms. See [GPU-enabled installation (CUDA and CuPy)](#gpu-enabled-installation-cuda-and-cupy)
0 commit comments