Installation#
brainevent is a pure-Python package built on JAX. Pick the
install that matches your hardware.
pip install -U brainevent[cpu]
# CUDA 12
pip install -U brainevent[cuda12]
# CUDA 13
pip install -U brainevent[cuda13]
pip install -U brainevent[tpu]
To install the whole BrainX ecosystem (brainevent
bundled with compatible modeling packages) in one step:
pip install -U BrainX
Verifying the installation#
import brainevent
import jax
print(brainevent.__version__)
print(jax.devices()) # confirm the expected CPU / GPU / TPU backend
GPU compilation dependencies#
The first time a kernel runs on a GPU, brainevent compiles its CUDA source on the fly.
This needs three things:
NVIDIA driver (provides
libcudaandnvidia-smi) — a system-level requirement for any GPU workload.``jax[cuda12]`` or ``jax[cuda13]`` — installing it pulls in the
nvidia-*pip packages, which already bundlenvcc/ptxas/the CUDA runtime/headers. A separate system CUDA Toolkit is therefore not required.A host C++ compiler (``g++``/``clang++``) — pip does not provide one. Install it via
conda install -c conda-forge gxx,sudo apt-get install g++, orsudo dnf install gcc-c++.
Note
Pure event-driven array and sparse-matrix operations work out of the box on every backend. The C++ compiler is only needed when you compile custom C++/CUDA kernels (see Compile a raw CUDA/C++ kernel).
Optional toolchain configuration#
For non-standard CUDA setups, these knobs control kernel compilation:
Setting |
Effect |
|---|---|
|
Prefer the system |
|
Same choice via environment variable. |
|
Point at a specific |
|
Force compilation when the host gcc is newer than nvcc officially supports. |
|
Skip |
|
Append a “toolchain snapshot” to every toolchain error for easier debugging. |
Once installed, head to the Quickstart.