GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
Installation

You can download GeNN either as a zip file of a stable release or a snapshot of the most recent stable version or the unstable development version using the Git version control system.

Downloading a release

Point your browser to https://github.com/genn-team/genn/releases and download a release from the list by clicking the relevant source code button. After downloading continue to install GeNN as described in the Installing GeNN section below.

Obtaining a Git snapshot

If it is not yet installed on your system, download and install Git (http://git-scm.com/).Then clone the GeNN repository from Github

git clone https://github.com/genn-team/genn.git

The github url of GeNN in the command above can be copied from the HTTPS clone URL displayed on the GeNN Github page (https://github.com/genn-team/genn).

This will clone the entire repository, including all open branches. By default git will check out the master branch which contains the source version upon which the next release will be based. There are other branches in the repository that are used for specific development purposes and are opened and closed without warning.

Installing GeNN

Installing GeNN comprises a few simple steps to create the GeNN development environment:

Note
While GeNN models are normally simulated using CUDA on NVIDIA GPUs, if you want to use GeNN on a machine without an NVIDIA GPU, you can skip steps v and vi and use GeNN in "CPU_ONLY" mode.

(i) If you have downloaded a zip file, unpack GeNN.zip in a convenient location. Otherwise enter the directory where you downloaded the Git repository.

(ii) Add GeNN's 'bin' directory to your path, e.g. if you are running Linux or Mac OS X and extracted/downloaded GeNN to $HOME/GeNN, this can be done with:

export PATH=$PATH:$HOME/GeNN/bin

to make this change persistent, this can be added to your login script (e.g. .profile or .bashrc) using your favourite text editor or with:

echo "export PATH=$PATH:$CUDA_PATH/bin" >> ~/.bash_profile

. If you are using Windows, the easiest way to modify the path is by using the 'Environment variables' GUI, which can be accessed by clicking start and searching for (by starting to type) 'Edit environment variables for your account'. In the upper 'User variables' section, scroll down until you see 'Path', select it and click 'Edit'. Now add a new directory to the path by clicking 'New' in the 'Edit environment variable' window e.g.:

path_windows.png
if GeNN is installed in a sub-directory of your home directory (USERPROFILE% is an environment variable which points to the current user's home directory) called genn.

(iv) Install the C++ compiler on the machine, if not already present. For Windows, download Microsoft Visual Studio Community Edition from https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx. When installing Visual Studio, one should select the 'Desktop development with C++' configuration. Mac users should download and set up Xcode from https://developer.apple.com/xcode/index.html , Linux users should install the GNU compiler collection gcc and g++ from their Linux distribution repository, or alternatively from https://gcc.gnu.org/index.html

(v) If your machine has a GPU and you haven't installed CUDA already, obtain a fresh installation of the NVIDIA CUDA toolkit from https://developer.nvidia.com/cuda-downloads Again, be sure to pick CUDA and C++ compiler versions which are compatible with each other. The latest C++ compiler need not necessarily be compatible with the latest CUDA toolkit.

(vi) GeNN uses the CUDA_PATH environment variable to determine which version of CUDA to build against. On Windows, this is set automatically when installing CUDA. However, if you choose, you can verify which version is selected by looking for the CUDA_PATH environment variable in the lower 'System variables' section of the GUI you used to configure the path:

cuda_path_windows.png
here, CUDA 10.1 and 11.4 are installed and CUDA 11.4 is selected via CUDA_PATH. However, on Linux and Mac you need to set CUDA_PATH manually with:

export CUDA_PATH=/usr/local/cuda

assuming CUDA is installed in /usr/local/cuda (the standard location on Ubuntu Linux). Again, to make this change persistent, this can be added to your login script (e.g. .profile or .bashrc)

This normally completes the installation. Windows users must close and reopen their command window so changes to the path take effect.

If you are using GeNN in Windows, the Visual Studio development environment must be set up within every instance of the CMD.EXE command window used. One can open an instance of CMD.EXE with the development environment already set up by navigating to Start - All Programs - Microsoft Visual Studio - Visual Studio Tools - x64 Native Tools Command Prompt. You may also wish to create a shortcut for this tool on the desktop, for convenience.

Installing PyGeNN

Installing PyGeNN from source on Linux or Mac OSX

  • Navigate to the GeNN directory and build a dynamic library version of GeNN, directly into the PyGeNN directory with:
    make DYNAMIC=1 LIBRARY_DIRECTORY=`pwd`/pygenn/genn_wrapper/
  • Build the Python extension with setup tools with:
    python setup.py develop

Installing PyGeNN from source on Windows

  • Ensure that you have at least Python 3.5 and Visual Studio 2015 installed (extensions for earlier versions of Python cannot be built using any versions of Visual Studio new enough to compile GeNN). If you are using Visual Studio 2019, you need at least Python 3.7.5. These instructions assume that the Anaconda platform was used to install Python, but it should be possible to install PyGeNN using suitable versions of Python installed in a different way (please let us know if you succeed in doing so!)
  • This process requires a command prompt with the environment correctly configured for both Visual Studio and Anaconda. To create one, launch an "x64 Native Tools Command Prompt" from your chosen version of Visual Studio's start menu folder and activate your chosen version of Anaconda by running the activate.bat in its Scripts directory. For example, if your user is called "me" and Anaconda is installed in your home directory, you would run:
    c:\Users\Me\Anaconda3\Scripts\activate.bat c:\Users\Me\Anaconda3
  • From this command prompt, install SWIG using the conda install swig command.
  • Navigate to the GeNN directory and build GeNN as a dll with:
    msbuild genn.sln /t:Build /p:Configuration=Release_DLL
    (if you don't have CUDA installed, building the CUDA backend will fail but it should still build the CPU backend).
  • Copy the newly built DLLs into pygenn using:
    copy /Y lib\genn*Release_DLL.* pygenn\genn_wrapper
  • Build the Python extension with setup tools with
    python setup.py develop

Top | Next