from brian2 import *
import brian2genn
set_device('genn', directory='genn' , compile=True, run=True, debug=False)
# configuration options
duration = 1*second
N = 10
NE = int(0.8 * N) # Number of excitatory cells
NI = NE/4 # Number of inhibitory cells
tau_ampa = 5.0*ms # Glutamatergic synaptic time constant
tau_gaba = 10.0*ms # GABAergic synaptic time constant
epsilon = 0.02 # Sparseness of synaptic connections
tau_stdp = 20*ms # STDP time constant
gl = 10.0*nsiemens # Leak conductance
el = -60*mV # Resting potential
er = -80*mV # Inhibitory reversal potential
vt = -50.*mV # Spiking threshold
memc = 200.0*pfarad # Membrane capacitance
bgcurrent = 200*pA # External current
eta = 0
eqs_neurons='''
dv/dt=(-gl*(v-el)-(g_ampa*v+g_gaba*(v-er))+bgcurrent)/memc : volt (unless refractory)
dg_ampa/dt = -g_ampa/tau_ampa : siemens
dg_gaba/dt = -g_gaba/tau_gaba : siemens
'''
neurons = NeuronGroup(NE+NI, model=eqs_neurons, threshold='v > vt',
reset='v=el', refractory=5*ms)
Pe = neurons[:NE]
Pi = neurons[NE:]
con_e = Synapses(Pe, neurons, on_pre='g_ampa += 0.3*nS')
con_e.connect('rand()<epsilon')
con_ii = Synapses(Pi, Pi, on_pre='g_gaba += 3*nS')
con_ii.connect('rand()<epsilon')
eqs_stdp_inhib = '''
w : 1
dA_pre/dt=-A_pre/tau_stdp : 1
dA_post/dt=-A_post/tau_stdp : 1
'''
alpha = 3*Hz*tau_stdp*2 # Target rate parameter
gmax = 100 # Maximum inhibitory weight
con_ie = Synapses(Pi, Pe, model=eqs_stdp_inhib,
on_pre='''A_pre += 1.
w = clip(w+(A_post-alpha)*eta, 0, gmax)
g_gaba += w*nS''',
on_post='''A_post += 1.
w = clip(w+A_pre*eta, 0, gmax)
'''
)
con_ie.connect('rand()<epsilon')
con_ie.w = 1e-10
run(duration)
...
building genn executable ...
ar -rcs /home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/lib/libgenn.a /hom
e/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/obj/global.o /home/denisalevi/
projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/obj/modelSpec.o /home/denisalevi/projects/d
ev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/obj/neuronModels.o /home/denisalevi/projects/dev_bria
n2cuda/brian2cuda_repo/frozen_repos/genn/lib/obj/synapseModels.o /home/denisalevi/projects/dev_brian2cuda
/brian2cuda_repo/frozen_repos/genn/lib/obj/postSynapseModels.o /home/denisalevi/projects/dev_brian2cuda/b
rian2cuda_repo/frozen_repos/genn/lib/obj/utils.o /home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo
/frozen_repos/genn/lib/obj/stringUtils.o /home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_
repos/genn/lib/obj/sparseUtils.o /home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/ge
nn/lib/obj/hr_time.o
g++ -std=c++11 -DNVCC=\""/usr/local/cuda/bin/nvcc"\" -DMODEL=\"/mnt/antares_raid/home/denisalevi/projects
/dev_brian2cuda/python_test_networks/test_feature_tests/genn/magicnetwork_model.cpp\" -o /mnt/antares_rai
d/home/denisalevi/projects/dev_brian2cuda/python_test_networks/test_feature_tests/genn/generateALL /home/
denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/src/generate*.cc -I"/home/denisa
levi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/include" -I"/usr/local/cuda/include" -
L"/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/lib" -L"/usr/local/cuda/
lib64" -lgenn -lcuda -lcudart
call was ./generateALL /mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/python_test_networks/tes
t_feature_tests/genn
optimizing block size...
Global memory required for core model: 0.000654 MB.
6440894464 for device 0
dry-run compile for device 0
"/usr/local/cuda/bin/nvcc" -cubin -x cu -arch sm_35 -O3 -I"$GENN_PATH/lib/include" -o "/mnt/antares_raid/
home/denisalevi/projects/dev_brian2cuda/python_test_networks/test_feature_tests/genn/runner.cubin" "/mnt/
antares_raid/home/denisalevi/projects/dev_brian2cuda/python_test_networks/test_feature_tests/genn/magicne
twork_model_CODE/runner.cc"
genn-buildmodel.sh:70: error 50: command failure
/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/python_test_networks/test_feature_tests/genn/ma
gicnetwork_model_CODE/synapseKrnl.cc(23): error: name must be a namespace name
1 error detected in the compilation of "/tmp/tmpxft_00007388_00000000-7_runner.cpp1.ii".
/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/genn/lib/src/generateALL.cc: 258: c
uda driver error 301: CUDA_ERROR_FILE_NOT_FOUND
ERROR Brian 2 encountered an unexpected error. If you think this is bug in Brian 2, please report th
is issue either to the mailing list at <http://groups.google.com/group/brian-development/>, or to the iss
ue tracker at <https://github.com/brian-team/brian2/issues>. Please include this file with debug informat
ion in your report: /tmp/brian_debug_FQg9Wu.log Additionally, you can also include a copy of the script
that was run, available at: /tmp/brian_script_wU0GlI.py You can also include a copy of the redirected std
stream outputs, available at /tmp/brian_stdout_8V3yfq.log and /tmp/brian_stderr_94OxVL.log Thanks! [bria
n2]
Traceback (most recent call last):
File "GENN_vogels_with_synaptic_dynamics_test.py", line 60, in <module>
run(duration)
File "/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/brian2/bri
an2/units/fundamentalunits.py", line 2428, in new_f
result = f(*args, **kwds)
File "/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/brian2/bri
an2/core/magic.py", line 371, in run
namespace=namespace, profile=profile, level=2+level)
File "/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/brian2/bri
an2/core/magic.py", line 231, in run
namespace=namespace, profile=profile, level=level+1)
File "/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/brian2/bri
an2/core/base.py", line 276, in device_override_decorated_function
return getattr(curdev, name)(*args, **kwds)
File "/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/brian2genn
/brian2genn/device.py", line 1205, in network_run
super(GeNNDevice, self).network_run(net=net, duration=duration, report=report, report_period=report_p
eriod, namespace=namespace, level=level+1)
File "/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/brian2/bri
an2/devices/cpp_standalone/device.py", line 1170, in network_run
self.build(direct_call=False, **self.build_options)
File "/mnt/antares_raid/home/denisalevi/projects/dev_brian2cuda/brian2cuda_repo/frozen_repos/brian2genn
/brian2genn/device.py", line 582, in build
returncode=ex.returncode)
RuntimeError: Project compilation failed (Command ['genn-buildmodel.sh', 'magicnetwork_model.cpp'] failed
with error code 50).
See the output above (if any) for more details.
I don't think its a genn configuration problem since all other speed tests work fine. Is there a not supported feature I am missing or is this a Brian2genn
bug?