Skip to content

Commit

Permalink
Merge pull request fbpic#691 from agolovanov/doc-cuda
Browse files Browse the repository at this point in the history
Update documentation for CUDA 12
  • Loading branch information
RemiLehe authored May 20, 2024
2 parents 6353d34 + 4515232 commit c553dae
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,34 @@ it from [here](https://www.continuum.io/downloads).
**Installation steps**:

- Install the dependencies of FBPIC. This can be done in two lines:
```
conda install numba scipy h5py mkl
conda install -c conda-forge mpi4py
```
```
conda install numba scipy h5py mkl
conda install -c conda-forge mpi4py
```
- Download and install FBPIC:
```
pip install fbpic
```
(If you want to run FBPIC through the [PICMI](https://picmi-standard.github.io/)
interface, you can instead use `pip install fbpic[picmi]`.)
```
pip install fbpic
```
(If you want to run FBPIC through the [PICMI](https://picmi-standard.github.io/)
interface, you can instead use `pip install fbpic[picmi]`.)
- **Optional:** in order to run on GPU, install the additional package
`cupy` -- e.g. using CUDA version 11.8. (The command below also automatically installs `cudatoolkit` which is also needed by FBPIC.)
```
conda install cupy cuda-version=11.8
```
(In the above command, you should choose a CUDA version that is compatible with your GPU driver ; see [this table](https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#major-components__table-cuda-toolkit-driver-versions) for more info.)
`cupy` — e.g. using CUDA version 11.8. (The command below also automatically installs `cudatoolkit` which is also needed by FBPIC.)
```
conda install cupy cuda-version=11.8
```
(In the above command, you should choose a CUDA version that is compatible with your GPU driver ; see [this table](https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#major-components__table-cuda-toolkit-driver-versions) for more info.)
If you want to use CUDA version 12+ which no longer comes with the `cudatoolkit` package, explicit installation of `cuda-nvcc` and `cuda-nvrtc` is required
```
conda install cupy cuda-version=12.0 cuda-nvcc cuda-nvrtc
```
- **Optional:** in order to run on a CPU which is **not** an Intel model, you
need to install `pyfftw`, in order to replace the MKL FFT:
```
conda install -c conda-forge pyfftw
```
```
conda install -c conda-forge pyfftw
```
## Running simulations
Expand Down
13 changes: 10 additions & 3 deletions docs/source/install/install_local.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,23 @@ Python. If Anaconda is not your default Python distribution, download and instal
A shortcut for this is: ``python3 -m pip install git+https://github.com/fbpic/fbpic.git``.

- **Optional:** In order to be able to run the code on a GPU,
install the additional package ``cupy``.
install the additional package ``cupy`` as well as dependencies needed to enable GPU support in ``numba``.

For CUDA versions below 12, install ``cupy`` and ``cuda-version`` (which will automatically install ``cudatoolkit``), for example
::


conda install -c conda-forge cupy
conda install -c conda-forge cupy cuda-version=11.8

For CUDA 12+ which no longer provides the ``cudatoolkit`` package, explicit installation of ``cuda-nvcc`` and ``cuda-nvrtc`` is required

::

conda install -c conda-forge cupy cuda-version=12.0 cuda-nvcc cuda-nvrtc

.. warning::

In the above command, you should choose a CUDA version that is **compatible
In the above commands, you should choose a CUDA version that is **compatible
with your GPU driver**. You can see the version of your GPU driver by typing
the command ``nvidia-smi``. You can then find the compatible CUDA
versions using `this table <https://docs.nvidia.com/deploy/cuda-compatibility/index.html#use-the-right-compat-package>`__.
Expand Down

0 comments on commit c553dae

Please sign in to comment.