|
4 | 4 | This is part of the Virtual Neuroscience Lab (VNL) project. |
5 | 5 |
|
6 | 6 | ## Installation |
| 7 | + |
| 8 | +### Option 1: `uv` |
| 9 | + |
| 10 | +#### Prerequisites |
| 11 | + |
| 12 | +- Python 3.11 or 3.12 |
| 13 | +- [uv](https://docs.astral.sh/uv/) package manager (recommended) or pip |
| 14 | +- CUDA 12.x or 13.x (for GPU support, optional) |
| 15 | + |
| 16 | +#### Installing `uv` |
| 17 | + |
| 18 | +If you don't have uv installed: |
| 19 | + |
| 20 | +```bash |
| 21 | +# Linux/macOS |
| 22 | +curl -LsSf https://astral.sh/uv/install.sh | sh |
| 23 | + |
| 24 | +# Or using pip |
| 25 | +pip install uv |
| 26 | +``` |
| 27 | + |
| 28 | +#### Installation Steps |
| 29 | + |
| 30 | +1. Clone the repository: |
| 31 | +```bash |
| 32 | +git clone https://github.com/talmolab/stac-mjx.git |
| 33 | +``` |
| 34 | +2. Create and activate a virutal environment: |
| 35 | +```bash |
| 36 | +uv venv |
| 37 | +source .venv/bin/activate # On Windows: .venv\Scripts\activate |
| 38 | +``` |
| 39 | +3. Install the package with optional dependencies based on your hardware. CUDA 12, CUDA 13, and CPU-only configurations are supported: |
| 40 | + |
| 41 | +For CUDA 12.x: |
| 42 | +```bash |
| 43 | +uv pip install -e ".[cuda12]" |
| 44 | +``` |
| 45 | + |
| 46 | +For CUDA 13.x: |
| 47 | +```bash |
| 48 | +uv pip install -e ".[cuda13]" |
| 49 | +``` |
| 50 | + |
| 51 | +For CPU-only: |
| 52 | +```bash |
| 53 | +uv pip install -e . |
| 54 | +``` |
| 55 | + |
| 56 | +For development, include the `[dev]` extras in addition to the hardware optional dependencies: |
| 57 | +```bash |
| 58 | +uv pip install -e ".[cuda13,dev]" |
| 59 | +``` |
| 60 | +4. Verify the installation: |
| 61 | +```bash |
| 62 | +python -c "import jax; print(f'JAX version: {jax.__version__}'); print(f'Available devices: {jax.devices()}')" |
| 63 | +``` |
| 64 | +5. Register the environment as a Jupyter kernel: |
| 65 | +```bash |
| 66 | +python -m ipykernel install --user --name=stac-mjx --display-name="Python (stac-mjx)" |
| 67 | +``` |
| 68 | + |
| 69 | +### Option 2: `conda` |
| 70 | + |
7 | 71 | stac-mjx relies on many prerequisites, therefore we suggest installing in a new conda environment, using the provided `environment.yaml`: |
8 | 72 | [Local installation before package is officially published] |
9 | 73 | 1. Clone the repository `git clone https://github.com/talmolab/stac-mjx.git` and `cd` into it |
|
0 commit comments