Running Bonsai on Mac

985 views
Skip to first unread message

Adam Armada-Moreira

unread,
Dec 11, 2020, 5:50:22 AM12/11/20
to Bonsai Users
Hello everyone,

Is there a way to run Bonsai on a Mac? 
I wanted to give it a try.

Cheers,
Adam Armada-Moreira.

Gonçalo Lopes

unread,
Dec 13, 2020, 8:41:19 AM12/13/20
to Adam Armada-Moreira, Bonsai Users
Hi Adam and welcome to the forums,

Which Mac OS version are you currently using? Unfortunately from Catalina onwards Mono support has been severely impaired and so you'll probably have to wait until the .NET 5 Bonsai version is released (currently aiming at sometime next year).

Virtual machines for Windows or Linux should work though if you just want to try it on some videos.


--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/9675ae2f-f2c7-4aa6-9eb4-08a24cd42d7an%40googlegroups.com.

Mikkel Roald-Arbøl

unread,
May 6, 2021, 6:17:06 AM5/6/21
to Bonsai Users
Hi Goncalo,
How is the .NET 5 Bonsai version progressing? Still just looking much forward to running Bonsai cross-platform! ;-)
Best, Mikkel

Gonçalo Lopes

unread,
May 16, 2021, 1:45:13 PM5/16/21
to Mikkel Roald-Arbøl, Bonsai Users
Hi Mikkel,

The .NET 5 version has been moving along nicely, and its progress is tracked on the 3.0 branch:

Currently we have been able to run image processing workflows successfully with OpenCV on Linux. No editor support just yet outside of Windows for .NET 5.0 but several components are in place to enable this.

Rough steps for installing / building:
3. cd bonsai
4. dotnet build Bonsai.Player/Bonsai.Player.csproj
5. export PATH=$PATH:$HOME/bonsai/Bonsai.Player/bin/Debug/net5.0

This will build the .NET 5.0 command-line player. Running it should allow you to play Bonsai workflows through the command-line using .NET 5.0. At the moment you need to install packages by hand by building them and copying them to the player folder. For example, to install the System package:

dotnet build Bonsai.System/Bonsai.System.csproj -o Bonsai.Player/bin/Debug/net5.0/

I've made some really simple test workflows you can download to test whether this is working:

For example to test listing folders:
2. Bonsai.Player ListFiles.bonsai

Some packages are a bit laborious to get working, such as Vision and Dsp, but doable. OpenCV needs to be built against the 2.4 branch for compatibility (for now).

It's basically a matter of patience, but it's getting there.
Hope this helps,

Mikkel Roald-Arbøl

unread,
Jun 25, 2021, 2:08:46 PM6/25/21
to Bonsai Users
Hi Goncalo,
Sorry for the delay in replying. Great to hear that things are progressing! Also, I hope it doesn't come across as impatience - it's all sheer excitement. :-)
I haven't been at my experimental work station for a while so I haven't tested out the above. For now I'll stick to my Python scripts for my (quite simple) experiments, but do get in touch if you need someone to do some test runs on either Mac or Raspberry Pi OS, then I'll be happy to help out. And once the .NET 5.0 editor is up and running I'll be back onboard 100%.

Best, Mikkel

Gonçalo Lopes

unread,
Jun 27, 2021, 12:37:24 PM6/27/21
to Mikkel Roald-Arbøl, Bonsai Users
Cool, no worries at all. Trying these on a Raspberry Pi is definitely on the to-do list.

My understanding is you can get mono on the Pi with Ubuntu, so actually it might be possible to get the full editor running by just installing Mono and then running the portable version of Bonsai 2.6.

oren A

unread,
Jan 28, 2022, 10:03:50 AM1/28/22
to Bonsai Users
Hi,
I've tried running Bonai on windows virtualbox (running in mac), and I get this error:

C:\Users\Computer1\AppData\Local\Bonsai>Bonsai.exe

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at OpenTK.Graphics.OpenGL4.GL.GenBuffers(Int32 n, Int32& buffers) in I:\work\github\opentk\src\OpenTK\Graphics\OpenGL4\GL4.cs:line 19126
   at Bonsai.Shaders.Mesh..ctor()
   at Bonsai.Shaders.Configuration.TexturedModel.CreateResource(ResourceManager resourceManager)
   at Bonsai.Resources.ResourceConfiguration`1.Bonsai.Resources.IResourceConfiguration.CreateResource(ResourceManager resourceManager)
   at Bonsai.Resources.ResourceManager.Load(Type type, String name)
   at Bonsai.Resources.ResourceManager.<>c__DisplayClass3_0.<Load>b__0(KeyValuePair`2 configuration)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Bonsai.Resources.ResourceManager.Load(IEnumerable`1 source)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value)
   at System.Reactive.ObserverBase`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value)
   at System.Reactive.ObserverBase`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value)
   at System.Reactive.ObserverBase`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value)
   at System.Reactive.ObserverBase`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value)
   at System.Reactive.ObserverBase`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)
   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value)
   at System.Reactive.ObserverBase`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)
   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value)
   at System.Reactive.ObserverBase`1.OnNext(T value)
   at Bonsai.Shaders.ShaderManager.<>c__DisplayClass2_2.<CreateWindow>b__2(Object <p0>, EventArgs <p1>)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second) in I:\work\github\opentk\src\OpenTK\GameWindow.cs:line 350
   at Bonsai.Shaders.ShaderManager.<>c__DisplayClass2_1.<CreateWindow>b__1()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Thanks
Reply all
Reply to author
Forward
0 new messages