Note
This documentation is for a development version. Click here for the latest stable release (v1.1.0).
Installation¶
Local machine¶
On a local machine not connected to a Loihi host,
you can use any version of Python
that has pip
.
pip install nengo-loihi
pip
will do its best to install
NengoLoihi’s requirements.
If anything goes wrong during this process,
it is likely related to installing NumPy.
Follow our NumPy install instructions,
then try again.
INRC/Superhost¶
These steps will take you through setting up a Python environment for running NengoLoihi, as well as for running models using the NxSDK directly. We will use Miniconda to set up an isolated environment for running Loihi models.
Ensure that
conda
is available.To see if it is available, run
conda -V
If conda is available, the conda version should be printed to the console.
If it is not available:
Ask your superhost administrator if conda is installed. If it is, you need to add the
bin
directory of the conda installation to your path.export PATH="/path/to/conda/bin:$PATH"
Running this once will change your path for the current session. Adding it to a shell configuration file (e.g.,
~/.profile
,~/.bashrc
) will change your path for all future terminal sessions.If conda is not installed, install Miniconda.
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh
Follow the prompts to set up Miniconda as desired.
Create a new
conda
environment.conda create --name loihi python=3
Activate your new environment.
conda activate loihi
Sometimes the environment can have issues when first created. Before continuing, run
which pip
and ensure that the path topip
is in your conda environment.Note
You will need to run
conda activate loihi
every time you log onto the superhost.Install NumPy and Cython with conda.
conda install numpy cython
The NumPy provided by conda is usually faster than those installed by other means.
Copy the latest NxSDK release to your current directory.
Note
The location of NxSDK may have changed. Refer to Intel’s documentation to be sure. The most recent release and NxSDK location are current as of November, 2021.
If you are logged into INRC:
cp /nfs/ncl/releases/1.0.0/nxsdk-1.0.0.tar.gz .
If you are setting up a non-INRC superhost:
scp <inrc-host>:/nfs/ncl/releases/1.0.0/nxsdk-1.0.0.tar.gz .
Install NxSDK.
pip install nxsdk-1.0.0.tar.gz
Install NengoLoihi.
pip install nengo-loihi
pip
will install other requirements like Nengo automatically.Test that both packages installed correctly.
Start Python by running the
python
command. If everything is installed correctly, you should be able to importnxsdk
andnengo_loihi
.Python 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import nxsdk >>> import nengo_loihi
Developer install¶
If you plan to make changes to NengoLoihi,
you should perform a developer install.
All of the steps above are the same
with a developer install,
except that instead of doing pip install nengo-loihi
,
you should do
git clone https://github.com/nengo/nengo-loihi.git
pip install -e nengo-loihi
cd nengo-loihi
pre-commit install