# Error code 50 when compiling brian2genn code

**URL:** <https://brian.discourse.group/t/error-code-50-when-compiling-brian2genn-code/719>\
**Category:** Support\
**Tags:** brian2genn\
**Created:** [14 June 2022 16:35 UTC](https://brian.discourse.group/t/error-code-50-when-compiling-brian2genn-code/719 "2022-06-14T16:35:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidKing2020](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Post date:** [14 June 2022 16:35 UTC](https://brian.discourse.group/t/error-code-50-when-compiling-brian2genn-code/719/1 "2022-06-14T16:35:28Z")

</div>

I encountered the following error when running the “simple\_example\_synapses.py” provided by brian2genn. It looks like a out of memory issue during compilation. Thanks for any help.

# Description of problem

```pytb
Traceback (most recent call last):
  File "simple_example_synapses.py", line 50, in <module>
    run(100*ms)
  File "/home/wxie/local_pkgs/brian2/brian2/units/fundamentalunits.py", line 2428, in new_f
    result = f(*args, **kwds)
  File "/home/wxie/local_pkgs/brian2/brian2/core/magic.py", line 377, in run
    return magic_network.run(duration, report=report, report_period=report_period,
  File "/home/wxie/local_pkgs/brian2/brian2/core/magic.py", line 230, in run
    Network.run(self, duration, report=report, report_period=report_period,
  File "/home/wxie/local_pkgs/brian2/brian2/core/base.py", line 291, in device_override_decorated_function
    return getattr(curdev, name)(*args, **kwds)
  File "/home/wxie/local_pkgs/brian2genn/brian2genn/device.py", line 1900, in network_run
    super(GeNNDevice, self).network_run(net=net, duration=duration,
  File "/home/wxie/local_pkgs/brian2/brian2/devices/cpp_standalone/device.py", line 1535, in network_run
    self.build(direct_call=False, **self.build_options)
  File "/home/wxie/local_pkgs/brian2genn/brian2genn/device.py", line 880, in build
    raise RuntimeError(('Project compilation failed (Command {cmd} '
RuntimeError: Project compilation failed (Command ['/home/wxie/local_pkgs/genn/bin/genn-buildmodel.sh', '-i', '/home/wxie/example:/home/wxie/example/simple_example_synapses:/home/wxie/example/simple_example_synapses/brianlib/randomkit', 'magicnetwork_model.cpp'] failed with error code 50).
See the output above (if any) for more details.

```

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [14 June 2022 16:50 UTC](https://brian.discourse.group/t/error-code-50-when-compiling-brian2genn-code/719/2 "2022-06-14T16:50:56Z")

</div>

Hi @DavidKing2020 . Why do you think this is a memory issue? It’s hard to say what is going on just by the error message you posted. Could you run it again with `debug=True` in the `set_device` call at the beginning? I think it should give more output in that case. Also, what versions of `brian2`, `brian2genn` and `genn` are you using?

---

<div class="post-metadata">

**Author:** ![DavidKing2020](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Post date:** [14 June 2022 20:52 UTC](https://brian.discourse.group/t/error-code-50-when-compiling-brian2genn-code/719/3 "2022-06-14T20:52:38Z")

</div>

Hi Marcel, this error message doesn’t come up when running in a less busier machine. That made me think it’s a memory issue. Further inputs would be appreciated. The attached is the output after setting the debug=True.

[out.txt](https://brian.discourse.group/uploads/short-url/cQFJmjq9xhjY4k6GieIUCYJQTtz.txt) (15.3 KB)

Here are the version of the softwares:

- Brian2: 2.5.0.3.post0.dev123
- Brian2genn: 1.6
- genn: 4.7.1

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [15 June 2022 09:39 UTC](https://brian.discourse.group/t/error-code-50-when-compiling-brian2genn-code/719/4 "2022-06-15T09:39:06Z")

</div>

Thanks for the error output. The actual problem seems to be this:

```bash
cuda driver error 999: CUDA_ERROR_UNKNOWN

```

As far as I can tell, this is not an issue with GeNN or Brian2GeNN, but rather a problem with the nvidia driver. Apparently restarting the machine should fix it, otherwise reloading the drivers should work as well. See some example commands you could try here: [python - Runtime error 999 when trying to use cuda with pytorch - Stack Overflow](https://stackoverflow.com/questions/58595291/runtime-error-999-when-trying-to-use-cuda-with-pytorch)

---

<div class="post-metadata">

**Author:** ![DavidKing2020](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Post date:** [15 June 2022 14:00 UTC](https://brian.discourse.group/t/error-code-50-when-compiling-brian2genn-code/719/5 "2022-06-15T14:00:56Z")

</div>

Thanks. From the provided solutions in that link, the command “nvidia-modprobe -u” solved the problem without requiring superuser account.
