Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build, error: ‘spikeCount_neurongroup’ was not declared in this scope #150

Open
ValerioB88 opened this issue Aug 31, 2022 · 1 comment

Comments

@ValerioB88
Copy link

Hi, I am trying to run the simple example here.
I have installed CUDA (which seems to work, I can run nvidia-smi), and is located in /usr/local/cuda. I have changed the PATH and CUDA_PATH.

When executing run(duration) I first run into a KeyError in device.py (just before building), in the line run_lines.extend(self.code_lines['before_network_run']). Before_network_run is not a key in self.code_lines, so I change it to before_run (and similarly I change after_network_run to after_run few lines later). KeyError is solved, but it fails again on the self.build(direct_call=False, **self.build_options) few lines later, with this error:

['/home/ft20308/genn-4.7.1/bin/genn-buildmodel.sh', '-i', '/home/ft20308/EvoSpike/src:/home/ft20308/EvoSpike/src/GeNNworkspace:/home/ft20308/EvoSpike/src/GeNNworkspace/brianlib/randomkit', 'magicnetwork_model.cpp']
make: Entering directory '/home/ft20308/genn-4.7.1/src/genn/generator'
if [ -w /home/ft20308/genn-4.7.1/lib ]; then make -C /home/ft20308/genn-4.7.1/src/genn/genn; fi;
if [ -w /home/ft20308/genn-4.7.1/lib ]; then make -C /home/ft20308/genn-4.7.1/src/genn/backends/cuda; fi;
make[1]: Entering directory '/home/ft20308/genn-4.7.1/src/genn/genn'
make[1]: Entering directory '/home/ft20308/genn-4.7.1/src/genn/backends/cuda'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ft20308/genn-4.7.1/src/genn/backends/cuda'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ft20308/genn-4.7.1/src/genn/genn'
mkdir -p /tmp/genn.5vCkbAKS
g++ -std=c++11 -Wall -Wpedantic -Wextra -MMD -MP -I/home/ft20308/genn-4.7.1/include/genn/genn -I/home/ft20308/genn-4.7.1/include/genn/third_party -I/home/ft20308/EvoSpike/src -I/home/ft20308/EvoSpike/src/GeNNworkspace -I/home/ft20308/EvoSpike/src/GeNNworkspace/brianlib/randomkit -I/home/ft20308/genn-4.7.1/include/genn/backends/cuda -DMODEL=\"/tmp/genn.btMvLfeb/magicnetwork_model.cpp\" -DBACKEND_NAMESPACE=CUDA -I"/usr/local/cuda/include" generator.cc -o /tmp/genn.5vCkbAKS/generator -L/home/ft20308/genn-4.7.1/lib  -lgenn_cuda_backend -lgenn -L"/usr/local/cuda/lib64" -lcuda -lcudart -pthread
make: Leaving directory '/home/ft20308/genn-4.7.1/src/genn/generator'
2022-08-31 10:00:05.289 INFO  [2518] [{anonymous}::optimizeBlockSize@595] Kernel: updateNeuronsKernel, block size:32
2022-08-31 10:00:05.289 INFO  [2518] [{anonymous}::optimizeBlockSize@595] Kernel: initializeKernel, block size:32
2022-08-31 10:00:05.289 INFO  [2518] [{anonymous}::optimizeBlockSize@595] Kernel: neuronSpikeQueueUpdateKernel, block size:32
2022-08-31 10:00:05.289 INFO  [2518] [{anonymous}::chooseOptimalDevice@679] Optimal device 0 - total occupancy:2688, number of small models:3, SM version:61
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@143] Host memory required for model: 0 MB
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@144] Device memory required for model: 0 MB
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@145] Zero-copy memory required for model: 0 MB
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@153] Merging model with 0 neuron groups and 0 synapse groups results in:
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@154] 	0 merged neuron update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@155] 	0 merged presynaptic update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@156] 	0 merged postsynaptic update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@157] 	0 merged synapse dynamics groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@158] 	0 merged custom update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@159] 	0 merged custom weight update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@160] 	0 merged custom weight transpose update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@161] 	0 merged neuron init groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@162] 	0 merged custom update init groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@163] 	0 merged custom WU update dense init groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@164] 	0 merged synapse dense init groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@165] 	0 merged synapse connectivity init groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@166] 	0 merged synapse sparse init groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@167] 	0 merged custom WU update sparse init groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@168] 	0 merged neuron spike queue update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@169] 	0 merged synapse dendritic delay update groups
2022-08-31 10:00:05.291 INFO  [2518] [CodeGenerator::generateAll@170] 	0 merged synapse connectivity host init groups
model build complete
make: Nothing to be done for 'clean'.
make -C magicnetwork_model_CODE
make[1]: Entering directory '/home/ft20308/EvoSpike/src/GeNNworkspace/magicnetwork_model_CODE'
make[1]: Leaving directory '/home/ft20308/EvoSpike/src/GeNNworkspace/magicnetwork_model_CODE'
g++ -std=c++11 -Wno-write-strings -I. -Ibrianlib/randomkit -w -O3 -ffast-math -fno-finite-math-only -march=native -std=c++11  main.cpp  code_objects/spikemonitor_codeobject.cpp  objects.cpp  code_objects/neurongroup_group_variable_set_conditional_codeobject.cpp  brianlib/randomkit/randomkit.cc -o main -Lmagicnetwork_model_CODE -lrunner -Wl,-rpath magicnetwork_model_CODE 
In file included from /tmp/genn.btMvLfeb/magicnetwork_model.cpp:5,
                 from generator.cc:31:
/tmp/genn.btMvLfeb/brianlib/randomkit/randomkit.cc:130:5: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  130 |     "no error",
      |     ^~~~~~~~~~
/tmp/genn.btMvLfeb/brianlib/randomkit/randomkit.cc:131:5: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  131 |     "random device unvavailable"
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/genn.btMvLfeb/objects.h:6,
                 from /tmp/genn.btMvLfeb/magicnetwork_model.cpp:7,
                 from generator.cc:31:
/tmp/genn.btMvLfeb/brianlib/clocks.h:12:3: warning: extra ‘;’ [-Wpedantic]
   12 |  };
      |   ^
/tmp/genn.btMvLfeb/brianlib/clocks.h:13:2: warning: extra ‘;’ [-Wpedantic]
   13 | };
      |  ^
In file included from /tmp/genn.btMvLfeb/magicnetwork_model.cpp:13,
                 from generator.cc:31:
/tmp/genn.btMvLfeb/code_objects/neurongroup_group_variable_set_conditional_codeobject.cpp: In function ‘void _run_neurongroup_group_variable_set_conditional_codeobject()’:
/tmp/genn.btMvLfeb/code_objects/neurongroup_group_variable_set_conditional_codeobject.cpp:105:18: warning: unused variable ‘_vectorisation_idx’ [-Wunused-variable]
  105 |     const size_t _vectorisation_idx = _idx;
      |                  ^~~~~~~~~~~~~~~~~~
/tmp/genn.btMvLfeb/code_objects/neurongroup_group_variable_set_conditional_codeobject.cpp:83:15: warning: unused variable ‘_numi’ [-Wunused-variable]
   83 |     const int _numi = 1000;
      |               ^~~~~
/tmp/genn.btMvLfeb/code_objects/neurongroup_group_variable_set_conditional_codeobject.cpp:84:11: warning: unused variable ‘_numv0’ [-Wunused-variable]
   84 | const int _numv0 = 1000;
      |           ^~~~~~
/tmp/genn.btMvLfeb/code_objects/neurongroup_group_variable_set_conditional_codeobject.cpp:93:14: warning: unused variable ‘_vectorisation_idx’ [-Wunused-variable]
   93 | const size_t _vectorisation_idx = -1;
      |              ^~~~~~~~~~~~~~~~~~
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/neuronUpdateCUDAOptim.cc(6): warning #177-D: variable "id" was declared but never referenced
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/neuronUpdateCUDAOptim.cc(11): warning #177-D: variable "id" was declared but never referenced
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/initCUDAOptim.cc(8): warning #177-D: variable "id" was declared but never referenced
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/initCUDAOptim.cc(29): warning #177-D: variable "deviceRNGSeed" was declared but never referenced
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/initCUDAOptim.cc(8): warning #177-D: variable "id" was declared but never referenced
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/initCUDAOptim.cc(29): warning #177-D: variable "deviceRNGSeed" was declared but never referenced
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/neuronUpdateCUDAOptim.cc(6): warning #177-D: variable "id" was declared but never referenced
/tmp/genn.5vCkbAKS/magicnetwork_model_CODE/neuronUpdateCUDAOptim.cc(11): warning #177-D: variable "id" was declared but never referenced
neuronUpdate.cc(6): warning #177-D: variable "id" was declared but never referenced
neuronUpdate.cc(11): warning #177-D: variable "id" was declared but never referenced
init.cc(8): warning #177-D: variable "id" was declared but never referenced
init.cc(29): warning #177-D: variable "deviceRNGSeed" was declared but never referenced
code_objects/spikemonitor_codeobject.cpp: In function ‘void _run_spikemonitor_codeobject()’:
code_objects/spikemonitor_codeobject.cpp:108:24: error: ‘spikeCount_neurongroup’ was not declared in this scope
  108 |  int32_t _num_events = spikeCount_neurongroup;
      |                        ^~~~~~~~~~~~~~~~~~~~~~
code_objects/spikemonitor_codeobject.cpp:117:23: error: ‘spike_neurongroup’ was not declared in this scope
  117 |      const int _idx = spike_neurongroup[_j];
      |                       ^~~~~~~~~~~~~~~~~
make: *** [Makefile:10: main] Error 1
Traceback (most recent call last):
  File "/home/ft20308/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<string>", line 27, in <module>
  File "/home/ft20308/miniconda3/lib/python3.9/site-packages/brian2genn/device.py", line 884, in build
    raise RuntimeError(('Project compilation failed (Command {cmd} '
RuntimeError: Project compilation failed (Command ['make'] failed with error code 2).
See the output above (if any) for more details.

The error seems to be error: ‘spikeCount_neurongroup’ was not declared in this scope.
Any idea what could I do about that? Thanks

@mstimberg
Copy link
Member

Hi @ValerioB88 . This is most likely a mismatch between the versions of Brian2GeNN and Brian2. Can you check which versions you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants