-
Notifications
You must be signed in to change notification settings - Fork 0
Installing nengo_loihi
If you will be connecting to a Loihi board, you will need to perform these steps on the superhost machine (the machine connected to the Loihi board). Make sure you're connected and logged in to the super host before doing this.
If you are just going to be running your model in simulation, you can perform these same steps on your local machine, and omit the NxSDK installation step at the end.
-
Ensure that you have
git,ssh, and thenengoloihi/nengoloihi.pubSSH key pair. If you do not have the key pair, talk to Chris or Terry to get it. -
Install the SSH key.
a. If you do not have a
~/.ssh/id_rsafile:mkdir -p ~/.ssh mv nengoloihi ~/.ssh/id_rsa mv nengoloihi.pub ~/.ssh/id_rsa.pub chmod 600 id_rsa
b. If you already have a
~/.ssh/id_rsafile:eval $(ssh-agent -s) ssh-add nengoloihi ssh-add -l # The nengo-loihi key should be listed
3a. Clone the repository. (If you're on intel's cloud, see 3b):
git clone ssh://git@gl.appliedbrainresearch.com:36563/abr/nengo-loihi.gitIf you've set up the SSH key correctly,
git should not prompt you for a password.
3b. If you're on Intel's cloud, you have to make a local clone (i.e. on your machine). Follow the instructions above on your computer (instead of on a superhost).
Then you can rsync it to the cloud account from the parent folder of nengo-loihi:
rsync nengo-loihi username@ncl-telluride.research.intel-research.net:~ -r-
It is highly recommended to use a python virtual environment to run
nengo_loihimodels. The steps below will show you how to set up a virtual environment using thecondapackage.a. If you are on your own machine or Intel's servers, install it using these instructions. Here's a summary: - In your home directory type:
bash wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.shThen follow the prompts, being generally agreeable.b. If you are on the super host machine: Add conda to your path by editing your
.bashrc. Start the editor using the following:pico ~/.bashrcThen add this line at the end of the file:
export PATH=/opt/miniconda3/bin:$PATH
Save and close the file. Now close that terminal and open a new one (or ssh back in).
-
Create a new
condaenvironment.conda create --name loihi python=3.5.5
If you will be connecting to a Loihi board, you must use a Python version after 3.5.2 and before 3.6.0. We recommend 3.5.5.
-
Activate your new environment.
source activate loihiSometimes when creating the environment, you will start in that environment, but the path will not be updated correctly. Before continuing to the next step, please ensure that
which pipshows thepipassociated with yourcondaenvironment.Note: Ensure you always activate your environment after you log off and back on to the super host.
-
Install
nengo_loihi.cd nengo-loihi # This is the cloned repository from step 1 pip install -e .
Make sure to include the
.in thepipcommand above.
NxSDK is Intel's Python SDK for Loihi.
If you want to run Nengo models of real Loihi hardware,
you will need to install NxSDK. If you're on Intel's server see 1.b.
1a. Clone the latest version of the repo:
cd ~
git clone /etc/NxSDK/.git
cd NxSDK1b. Clone when on Intel's servers
cd ~
git clone /nfs/ncl/git/NxSDK.git
cd NxSDK-
Check out the
0.5tag, which is the most recent release. (Note: or 0.5.1 might be, please check)git checkout 0.5
-
Add a
setup.pyfile. You can paste this at your command prompt:cat > setup.py << 'EOL' import sys from setuptools import setup if not ((3, 5, 2) <= sys.version_info[:3] < (3, 6, 0)): pyversion = ".".join("%d" % v for v in sys.version_info[:3]) raise EnvironmentError( "NxSDK has .pyc files that only work on Python 3.5.2 through 3.5.5. " "You are running version %s." % pyversion) setup( name='nxsdk', version='0.5.0', install_requires=[ "numpy", "pandas", "matplotlib", "teamcity-messages", "rpyc<4", ] ) EOL
or paste the text above (excluding the first and last lines) into an editor and save as
setup.pyin the NxSDK folder. -
Install
nxsdkpip install -e .
- Check that you have a folder called
matplotlibin the.configfolder in your home directory.If it doesn't exist, check that thecd ~ cd .config/matplotlib
matplotlibpython package has been installed correctly in your python virtual environment, and if needed, create thematplotlibfolder. - Add the matplotlib backend option to a
matplotlibrcfile in the~/.config/matplotlib/folder:echo "backend: Agg" >> matplotlibrc