SpikeInterface / MEArec

Fast and customizable of extracellular recordings on MEA
GNU General Public License v3.0
42 stars 19 forks source link

Kernel crash when generating templates #166

Closed droumis closed 10 months ago

droumis commented 10 months ago

Running the generate_templates_and_recordings.ipynb in a fresh env produces the error below and then kills the jupyter kernel.

Versions

Apple M1 Pro, macOS Ventura 13.5.2 Python 3.11.7 mearec 1.9.0 lfpy 2.3 neuron 8.2.3

Code from generate_templates_and_recordings.ipynb, setting njobs=1

import MEArec as Mr
default_info, mearec_home = mr.get_default_config()
cell_folder = default_info['cell_models_folder']
template_params = mr.get_default_templates_params()
template_params['n'] = 10
template_params['probe'] = 'Neuronexus-32'
tempgen = mr.gen_templates(cell_models_folder=cell_folder, params=template_params, n_jobs=1)

Error:

Intracellular simulation: /Users/droumis/.config/mearec/1.9.0/cell_models/bbp/L5_BP_bAC217_1
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
NEURON: NaTs2_t is not a MECHANISM
 in biophysics.hoc near line 50
        insert NaTs2_t
                ^
        xopen("biophysics.hoc")
      execute1("{xopen("bi...")
    load_file(1, "biophysics.hoc")
NEURON: ProbGABAAB_EMS is not a template
 in synapses.hoc near line 274
             section.sec synapse = new ProbGABAAB_EMS(seg_x)
                                                           ^
        xopen("synapses.hoc")
      execute1("{xopen("sy...")
    load_file(1, "synapses/s...")

In the above, I'm setting n_jobs=1 because otherwise it tries to run with multiple jobs and I get a more cryptic error:

Current thread 0x00000001e559a080 (most recent call first):
  <no Python frame>
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
OSError: [Errno 9] Bad file descriptor
droumis commented 10 months ago

UPDATE: After some guess work, I seemed to have solved one of the issues by going to the ~/.config/mearec/1.9.0/cell_models/bbp/mods and running nrnivmodl. That seemed to resolve NEURON: NaTs2_t is not a MECHANISM. The rest of the notebook seems to be happy enough so I think I'll close this issue. I still can't use n_jobs>1 but I can live with that.

alejoe91 commented 10 months ago

Ideally compilation should be done automatically at the first run, not sure why this didn't happen! Anyways, glad you figured this out ;)