REMI Lab
OPEN KNOWLEDGE / TOOLS

Installation

이 페이지의 내용

Install

rfx needs Python 3.11 or newer. The PyPI package is rfx-fdtd, and the import name is rfx.

Terminal window
pip install rfx-fdtd

This installs JAX and jaxlib 0.10.2 or newer (CPU), NumPy, SciPy, matplotlib and h5py.

GPU

rfx runs on whatever device JAX finds. For an NVIDIA GPU, install the CUDA build of JAX:

Terminal window
pip install "jax[cuda12]" rfx-fdtd
python -c "import jax; print(jax.devices())" # should list a CUDA device

See the JAX installation guide for CUDA and driver requirements.

Optional extras

ExtraAddsNeeded for
rfx-fdtd[optimization]optaxgradient-based optimizers in inverse design
rfx-fdtd[visualization]matplotlib, pillowplots and field animations
rfx-fdtd[cad]trimesh, rtree, cascadioimporting STL/STEP geometry with MeshShape
rfx-fdtd[dashboard]streamlit, pandasthe rfx-dashboard browser UI
rfx-fdtd[all]everything above plus the dev toolsdevelopment

Check the install

Terminal window
rfx-diagnose

This prints a PASS / WARN / FAIL line for Python, rfx, the JAX backend and devices, the core dependencies and the optional extras. It then runs a tiny FDTD simulation. It exits with code 0 when every critical check passes.

Two warnings are normal:

  • CPU-only backend. Everything works, but large 3-D runs are slow.
  • x64 disabled. This is harmless for the default precision="float32".

If you want precision="float64", enable JAX 64-bit mode before you build the simulation:

import jax
jax.config.update("jax_enable_x64", True)

Development install

Terminal window
git clone https://github.com/bk-squared/rfx.git
cd rfx
pip install -e ".[dev]"
python examples/quickstart/hello_world.py

hello_world.py runs a 20 mm PEC box with one source and one probe. It finishes in seconds. The scripts in examples/ come only with a source checkout; the PyPI wheel does not include them.

To contribute, see Contributing.

Hardware

  • Memory: 4 GB is enough for the examples. Use 16 GB or more for large 3-D models. On a GPU, device memory is usually the limit, and gradients need much more of it than a plain forward run; see Memory Reduction.
  • GPU: an NVIDIA card with CUDA 12 or newer. Absorbing boundaries cost more per cell than PEC, so budget for them in open-boundary work.

Next

Continue with the Quick Start.

Back to top ↑