CARLsim 5
CARLsim is an efficient, easy-to-use, GPU-accelerated library for simulating large-scale spiking neural network (SNN) models with a high degree of biological detail. CARLsim allows execution of networks of Izhikevich spiking neurons with realistic synaptic dynamics on both generic x86 CPUs and standard off-the-shelf GPUs. The simulator provides a PyNN-like programming interface in C/C++, which allows for details and parameters to be specified at the synapse, neuron, and network level.
If you use CARLsim or PyCARL in your research, please cite our papers CARLsim and PyCARL.
Chou*, T.-S., Kashyap*, H.J., Xing, J., Listopad, S., Rounds, E.L., Beyeler, M., Dutt, N., and Krichmar, J.L. (2018). "CARLsim 4: An Open Source Library for Large Scale, Biologically Detailed Spiking Neural Network Simulation using Heterogeneous Clusters." In Proceedings of IEEE International Joint Conference on Neural Networks (IJCNN), pp. 1158-1165.
Balaji, A., Adiraju, P., Kashyap, H. J., Das, A., Krichmar, J. L., Dutt, N. D., & Catthoor, F. (2020). PyCARL: A PyNN Interface for Hardware-Software Co-Simulation of Spiking Neural Network. arXiv preprint arXiv:2003.09696. (To appear in IJCNN 2020)
News
We released PyCARL which is an interface of CARLsim to the pyNN framework! Please check here for more details.
Installation
Detailed instructions for installing the latest stable release of CARLsim on Mac OS X / Linux can be found in our User Guide.
Linux/MacOS
For Beginner
-
Download CARLsim 5 zip file by clicking on the
Clone or download
box in the top-right corner. -
Unzip the source code.
-
Go into
CARLsim5
folder$ cd CARLsim5
-
Make and install
$ make $ make install
-
Verify installation
$ cd ~ $ ls
You will see
CARL
folder -
Go back to
CARLsim5
folder and start your own project! The "Hello World" project is a goot starting point for this. Make sure it runs:$ cd CARLsim5 $ cd projects/hello_world $ make $ ./hello_world
For Advanced User and Developer
-
Fork CARLsim 5 by clicking on the
Fork
box in the top-right corner. -
Clone the repo, where
YourUsername
is your actual GitHub user name:$ git clone --recursive https://github.com/UCI-CARL/CARLsim5.git $ cd CARLsim5
Note the
--recursive
option: It will make sure Google Test gets installed. -
Choose between stable release and latest development version:
- For the latest development branch, you are already on the right branch (
master
). - For stable release, choose from https://github.com/UCI-CARL/CARLsim5/releases
- For the latest development branch, you are already on the right branch (
-
Choose the installation directory: By default, the CARLsim library lives in
~/CARL/lib
, and CARLsim include files live in~/CARL/include
. You can overwrite these by exporting an evironment variable calledCARLSIM5_INSTALL_DIR
:$ export CARLSIM5_INSTALL_DIR=/path/to/your/preferred/dir
or
$ export CARLSIM5_INSTALL_DIR=/usr/local
if you want to install CARLsim library for all users.
Also set the following evironment variable:
$ export CUDA_PATH=/path/to/CUDA
By default CUDA is installed to
/usr/local/cuda
in Linux systems. -
Make and install:
$ make -j4 $ sudo -E make install
Note the
-E
flag, which will causesudo
to remember theCARLSIM5_INSTALL_DIR
. -
In order to make sure the installation was successful, you can run the regression suite:
$ make test $ ./carlsim/test/carlsim_tests
-
Start your own project! The "Hello World" project is a goot starting point for this. Make sure it runs:
$ cd projects/hello_world $ make $ ./hello_world
You can easily create your own project based on this template using the
init.sh
script:$ cd projects $ ./init.sh project_name
where
project_name
is the name of your new project. The script will copy all files fromhello_world/
toproject_name/
, make all required file changes to compile the new project, and add all new files to git.
Using nvidia docker
- Using CARLsim5 on an Nvidia-docker image follows the instructions above. Only important thing to keep in mind is to copy the $CUDA_PATH/samples directory to the docker, which does not come with the nvidia docker image. CARLsim5 uses "helper_functions.h" from the library.
Using CMake
-
Obtatin
CARLsim5
's source code. -
Create a build directory (you can make it anywhere)
$ mkdir .build
-
Proceed into build directory and do configuration:
$ cd .build $ cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local/carlsim \ -DCARLSIM_NO_CUDA=OFF \ <path-to-carlsim>
As you can see
cmake
accepts several options-D<name>=<value>
: they define cmake variables.CMAKE_BUILD_TYPE=Release
means that we are going to build release version of the library. If you need debug version then passDebug
.CMAKE_INSTALL_PREFIX
specifies a directory which we are going to install the library into.CARLSIM_NO_CUDA
switches on/off support of CUDA inside the library.<path-to-carlsim>
must be replaced with the path to the CARLsim5's source directory. -
Build:
make -j <jobs-num>
Set
<jobs-num>
to the number of logical processors your computer has plus one, this will employ parallel building. -
Install:
make install
Prerequisites
CARLsim 5 comes with the following requirements:
- (optional) CMake 3.0 or higher in case you want to build it using CMake.
- (optional) CUDA Toolkit 6.0 or higher. For platform-specific CUDA installation instructions, please navigate to
the NVIDIA CUDA Zone.
This is only required if you want to run CARLsim in
GPU_MODE
. Make sure to install the CUDA samples, too, as CARLsim relies on the filehelper_cuda.h
. - (optional) A GPU with compute capability 2.0 or higher. To find the compute capability of your device please
refer to the CUDA article on Wikipedia.
This is only required if you want to run CARLsim in
GPU_MODE
. - (optional) MATLAB R2014a or higher. This is only required if you want to use the Offline Analysis Toolbox (OAT).
As of CARLsim 3.1 it is no longer necessary to have the CUDA framework installed. However, CARLsim development will continue to focus on the GPU implementation.
The latest release was tested on the following platforms:
- Ubuntu 16.04
- Mac OS X 10.11 (El Capitan)