All Projects → nengo-labs → nengo-ocl

nengo-labs / nengo-ocl

Licence: other
OpenCL-based simulator for Nengo neural models

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nengo-ocl

primitiv-python
Python binding of primitiv.
Stars: ✭ 17 (-22.73%)
Mutual labels:  opencl
ctuning-programs
Collective Knowledge extension with unified and customizable benchmarks (with extensible JSON meta information) to be easily integrated with customizable and portable Collective Knowledge workflows. You can easily compile and run these benchmarks using different compilers, environments, hardware and OS (Linux, MacOS, Windows, Android). More info:
Stars: ✭ 41 (+86.36%)
Mutual labels:  opencl
oclcl
S-expression to OpenCL C
Stars: ✭ 42 (+90.91%)
Mutual labels:  opencl
Hetero-Mark
A Benchmark Suite for Heterogeneous System Computation
Stars: ✭ 41 (+86.36%)
Mutual labels:  opencl
folding-at-home
A Folding@Home Docker container with GPU support
Stars: ✭ 38 (+72.73%)
Mutual labels:  opencl
slibs
Single file libraries for C/C++
Stars: ✭ 80 (+263.64%)
Mutual labels:  opencl
rouziclib
This is my personal library of code that is common to my different projects (Photosounder, SplineEQ, Spiral and others)
Stars: ✭ 38 (+72.73%)
Mutual labels:  opencl
SimNDT
Ultrasonic NDT Simulator with engine core based on the Elastodynamic Finite Integration Technique (EFIT)
Stars: ✭ 34 (+54.55%)
Mutual labels:  opencl
Learning-Lab-C-Library
This library provides a set of basic functions for different type of deep learning (and other) algorithms in C.This deep learning library will be constantly updated
Stars: ✭ 20 (-9.09%)
Mutual labels:  opencl
SoliditySHA3Miner
All-in-one mixed multi-GPU (nVidia, AMD, Intel) & CPU miner solves proof of work to mine supported EIP918 tokens in a single instance (with API).
Stars: ✭ 28 (+27.27%)
Mutual labels:  opencl
faster lmm d
A faster lmm for GWAS. Supports GPU backend.
Stars: ✭ 12 (-45.45%)
Mutual labels:  opencl
spector
Spector: An OpenCL FPGA Benchmark Suite
Stars: ✭ 38 (+72.73%)
Mutual labels:  opencl
pytorch dlprim
DLPrimitives/OpenCL out of tree backend for pytorch
Stars: ✭ 51 (+131.82%)
Mutual labels:  opencl
darknet
Darknet on OpenCL Convolutional Neural Networks on OpenCL on Intel & NVidia & AMD & Mali GPUs for macOS & GNU/Linux
Stars: ✭ 160 (+627.27%)
Mutual labels:  opencl
OpenCL
The content of the OpenCL.org website
Stars: ✭ 18 (-18.18%)
Mutual labels:  opencl
pystella
A code generator for grid-based PDE solving on CPUs and GPUs
Stars: ✭ 18 (-18.18%)
Mutual labels:  opencl
voxel-raycaster
Hardware accelerated voxel ray marching
Stars: ✭ 30 (+36.36%)
Mutual labels:  opencl
rindow-neuralnetworks
Neural networks library for machine learning on PHP
Stars: ✭ 37 (+68.18%)
Mutual labels:  opencl
ufo-core
GLib-based framework for GPU-based data processing
Stars: ✭ 20 (-9.09%)
Mutual labels:  opencl
focal
A modern Fortran abstraction layer for OpenCL
Stars: ✭ 35 (+59.09%)
Mutual labels:  opencl
Latest PyPI version Python versions

NengoOCL

OpenCL-based Nengo Simulator

NengoOCL is an OpenCL-based simulator for brain models built using Nengo. It can be orders of magnitude faster than the reference simulator in nengo for large models.

Usage

To use the nengo_ocl project's OpenCL simulator, build a Nengo model as usual, but use nengo_ocl.Simulator when creating a simulator for your model:

import numpy as np
import matplotlib.pyplot as plt
import nengo
import nengo_ocl

# define the model
with nengo.Network() as model:
    stim = nengo.Node(np.sin)
    a = nengo.Ensemble(100, 1)
    b = nengo.Ensemble(100, 1)
    nengo.Connection(stim, a)
    nengo.Connection(a, b, function=lambda x: x**2)

    probe_a = nengo.Probe(a, synapse=0.01)
    probe_b = nengo.Probe(b, synapse=0.01)

# build and run the model
with nengo_ocl.Simulator(model) as sim:
    sim.run(10)

# plot the results
plt.plot(sim.trange(), sim.data[probe_a])
plt.plot(sim.trange(), sim.data[probe_b])
plt.show()

If you are running within nengo_gui make sure the PYOPENCL_CTX environment variable has been set. If this variable is not set it will open an interactive prompt which will cause nengo_gui to get stuck during build.

Dependencies and Installation

The requirements are the same as Nengo, with the additional Python packages mako and pyopencl (where the latter requires installing OpenCL).

General:

  • Python 2.7+ or Python 3.3+ (same as Nengo)
  • One or more OpenCL implementations (test with e.g. PyOpenCl)

A working installation of OpenCL is the most difficult part of installing NengoOCL. See below for more details on how to install OpenCL.

Python packages:

  • NumPy
  • nengo
  • mako
  • PyOpenCL

In the ideal case, all of the Python dependencies will be automatically installed when installing nengo_ocl with

pip install nengo-ocl

If that doesn't work, then do a developer install to figure out what's going wrong.

Developer Installation

First, pip install nengo. For best performance, first make sure a fast version of Numpy is installed by following the instructions in the Nengo README.

This repository can then be installed with:

git clone https://github.com/nengo/nengo-ocl.git
cd nengo-ocl
python setup.py develop --user

If you’re using a virtualenv (recommended!) then you can omit the --user flag. Check the output to make sure everything installed correctly. Some dependencies (e.g. pyopencl) may require manual installation.

Installing OpenCL

How you install OpenCL is dependent on your hardware and operating system. A good resource for various cases is found in the PyOpenCL documentation:

Below are instructions that have worked for the NengoOCL developers at one point in time.

AMD OpenCL on Debian Unstable

On Debian unstable (sid) there are packages in non-free and contrib to install AMD's OpenCL implementation easily. Actually, the easiest thing would be to apt-get install python-pyopencl. But if you're using a virtual environment, you can sudo apt-get install opencl-headers libboost-python-dev amd-opencl-icd amd-libopencl1 and then pip install pyopencl.

Nvidia OpenCL on Debian/Ubuntu Linux

On Debian unstable (sid) there are packages for installing the Nvidia OpenCL implementation as well.

sudo apt-get install nvidia-opencl-common nvidia-libopencl1

Ensure that the Nvidia driver version matches the OpenCL library version. You can check the Nvidia driver version by running nvidia-smi in the command line. You can find the OpenCL library version by looking at the libnvidia-opencl.so.XXX.XX file in the /usr/lib/x86_64-linux-gnu/ folder.

Intel OpenCL on Debian/Ubuntu Linux

The Intel SDK for OpenCL is no longer available. Intel OpenCL drivers can be found on Intel's website. See the PyOpenCL wiki for instructions.

Running Tests

From the nengo-ocl source directory, run:

py.test nengo_ocl/tests --pyargs nengo -v

This will run the tests using the default context. If you wish to use another context, configure it with the PYOPENCL_CTX environment variable (run the Python command pyopencl.create_some_context() for more info).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].