Does Brian2CUDA work under Windows WSL


I know Windows is not currently supported for brian2CUDA, but is there any known reason why it would not work under Ubuntu with Windows Subsystem for Linux (WSL)? Sorry for asking before testing.


Hi Simo, I see no reason that it should not work if you follow 1. NVIDIA GPU Accelerated Computing on WSL 2 — wsl-user-guide 12.2 documentation to install CUDA, but I don’t think anyone has ever tried… Would be great if you could give it a spin and report back. If there are issues, I guess they’d be much easier to fix than adding full Windows support.


Hi Simo,

I don’t see a reason for why it shouldn’t work on Windows. I only didn’t implement it because I didn’t have a Windows machine at hand.

If you want to give it a go, that would be much appreciated. Here is the related issue: Support Windows · Issue #225 · brian-team/brian2cuda · GitHub

You would have to implement the win_makefile which compiles the generated code. And then there are probably a few things to fix in the GPU selection part in Windows (assuming that the commands to query GPUs might be slightly different).

I’m happy to assist if you give it a go.


Thanks! Denis, do you think the win_makefile is necessary for WSL? It should be a linux operating system under Windows.

best regards,

Hi Simo,

sorry for the late reply, I missed your question.

If you are using Linux as WSL, you shouldn’t need the win_makefile. I would assume compilation would work as expected under Linux. I just don’t know how GPU access is handled under WSL. But I would just give it a try. It might just work.

It would be great to hear if it works if you give it a try.

Best, Denis

Thanks Denis!
I will give this a try when I start optimizing my current retina simulator code.

1 Like