Brian2Cuda not compatible with Brian 2.5.4

Description of problem

Hi everyone,

I am trying to use brian2cuda to speed up computations in my project in which I am also using Dendrify (Dendrify 2.1.2). The problem is that Dendrify seems to require version brian2==2.5.4, but brian2cuda requires version brian2==2.6.0. Is there a way to install brian2cuda so that it is compatible with brian2 version 2.5.4?

What you have already tried

I tried to install brian2 after installing brian2cuda (first installed brian2cuda with pip install brian2cuda, then uninstalled brian2 with pip and then did pip install brian2==2.5.4)

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
brian2cuda 1.0a4 requires brian2==2.6.0, but you have brian2 2.5.4 which is incompatible.

When I install Dendrify (pip install dendrify --no-deps) and then install brian2cuda using ‘python -m pip install brian2cuda’, I get the following error:

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
dendrify 2.1.2 requires brian2==2.5.4, but you have brian2 2.6.0 which is incompatible.

I also tried the following:

  • installed Dendrify with no dependencies pip install dendrify --no-deps
  • installed Brian2 version: pip install brian2==2.5.4
  • then installed brian2cuda with no dependencies with ‘pip install --no-deps brian2cuda’

but when I run brian2cuda.example_run(), I get:
Traceback (most recent call last):
File “”, line 1, in
File “/home/rad216/miniconda3/envs/test_brian2cuda/lib/python3.12/site-packages/brian2cuda/init.py”, line 72, in example_run
run(1 * ms)
File “/home/rad216/miniconda3/envs/test_brian2cuda/lib/python3.12/site-packages/brian2/units/fundamentalunits.py”, line 2780, in new_f
result = f(*args, **kwds)
^^^^^^^^^^^^^^^^
File “/home/rad216/miniconda3/envs/test_brian2cuda/lib/python3.12/site-packages/brian2/core/magic.py”, line 407, in run
return magic_network.run(
^^^^^^^^^^^^^^^^^^
File “/home/rad216/miniconda3/envs/test_brian2cuda/lib/python3.12/site-packages/brian2/core/magic.py”, line 248, in run
Network.run(
File “/home/rad216/miniconda3/envs/test_brian2cuda/lib/python3.12/site-packages/brian2/core/base.py”, line 333, in device_override_decorated_function
return getattr(curdev, name)(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/rad216/miniconda3/envs/test_brian2cuda/lib/python3.12/site-packages/brian2cuda/device.py”, line 1704, in network_run
if not self.run_args_applied:
^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘CUDAStandaloneDevice’ object has no attribute ‘run_args_applied’

which tells me that the brian2 version is not compatible with the brian2cuda version.

Any idea how I can resolve this conflict and use brian2cuda with Brian2 version 2.5.4?

Thank you in advance!

1 Like

Hi @raresdorcioman. The latest version of brian2cuda requires Brian version 2.6, as you saw, but the previous version (1.0a3) is compatible with Brian 2.5.4. For situations like this, it is usually the best to install all the packages that you need to be compatible with each other in a single command. The pip tool should then automatically figure out that Brian2cuda 1.0a3, Brian2 2.5.4, and dendrify 2.1.2 are compatible with each other:

$ pip install dendrify brian2 brian2cuda

Hope that helps!

Thanks a lot! That actually solved the installation conflicts! I’ll see how it goes with the actual usage of the GPU tools :slight_smile:

2 Likes

Hi @raresdorcioman,

My name is Michalis and I am the main developer of Dendrify. Dendrify is actually fully compatible with Brian 2.6 but I set as a requirement Brian 2.5.4. because Brian2cuda used to require this version as well. I apologize for any inconvenience regarding installation conflicts with Brian. I was writing my PhD thesis and paused its development for a while.

@mstimberg As you mentioned brian2cuda works with Brian 2.6 right? If yes, then I need to change its requirements in the PyPI setup file!

UPDATE:
I just updated dendrify to version 2.1.3 that resolved the above issue. If you come across any other weird errors please let me know. Thanks!

1 Like

Hi Michalis, thank you for the update and for solving this!

1 Like

Yes – but actually I am in the process of pushing out Brian 2.7 and Brian2CUDA 1.0a5, so you might have to do the same thing yet again soon :grimacing: Not urgent, though, the main change in Brian 2.7 vs. 2.6 is that it is compatible with numpy 2.0 (which hasn’t been released yet).

1 Like

Haha, good to know. Thank you for another Brian update <3.

1 Like