Burst, Jobs, and Cross Platform Standalone Builds?

Hey,

I’ve tried searching but not finding any clear answers. Pardon if this has asked before.

For our main builds, we’re using il2cpp on WindowsStandalone, Xbox, Nintendo Switch–Burst is a game changer, works great, everything is happy. Burst/Jobs is now integral to the project.

I would really like to support Mac and Linux–at least if its not too much hassle. I do not have a Mac or Linux build machine, nor do I really want to get one setup.

a) If I build Mac/Linux locally, I have to disable il2cpp. Minor performance hit, but I’ll take a mono Mac build over no Mac build.
b) With il2cpp disabled, I have a Linux build. Seems to be fine, runs fine… except, as soon as gameplay starts it fills the log file with:

InvalidOperationException: This should have been initialized by code gen
at Unity.Jobs.IJobBurstScheduableExtensions.Schedule[T] (T jobData, Unity.Jobs.JobHandle dependsOn) [0x00019] in :0
at Unity.Entities.ChunkIterationUtility.PreparePrefilteredChunkLists (System.Int32 unfilteredChunkCount, Unity.Entities.UnsafeMatchingArchetypePtrList archetypes, Unity.Entities.EntityQueryFilter filter, Unity.Jobs.JobHandle dependsOn, Unity.Jobs.LowLevel.Unsafe.ScheduleMode mode, Unity.Collections.NativeArray`1[System.Byte]& prefilterDataArray, System.Void*& deferredCountData) [0x000ba] in <5d5a854347494de1a5caa65aeedc545c>:0
at Unity.Entities.JobChunkExtensions.ScheduleInternal[T] (T& jobData, Unity.Entities.EntityQuery query, Unity.Jobs.JobHandle dependsOn, Unity.Jobs.LowLevel.Unsafe.ScheduleMode mode, System.Boolean isParallel) [0x00010] in <5d5a854347494de1a5caa65aeedc545c>:0
at Unity.Entities.JobChunkExtensions.Schedule[T] (T jobData, Unity.Entities.EntityQuery query, Unity.Jobs.JobHandle dependsOn) [0x00000] in <5d5a854347494de1a5caa65aeedc545c>:0
at Unity.Physics.Systems.ExportPhysicsWorld.OnUpdate () [0x0007c] in :0
at Unity.Entities.SystemBase.Update () [0x00041] in <5d5a854347494de1a5caa65aeedc545c>:0
at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x0006a] in <5d5a854347494de1a5caa65aeedc545c>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
Unity.Entities.ComponentSystemGroup:OnUpdate()
Unity.Entities.ComponentSystem:Update()
Unity.Entities.DummyDelegateWrapper:TriggerUpdate()

I’m using Burst 1.3.2. My understanding is that cross compilation for standalone (Windows/Linux/Mac) is now a feature and I should have been able to generate my non-il2cpp Linux Build?

What would I need to do as a Windows based dev to build for Linux and or Mac? I’m open to using Unity Cloud Build if that works–does il2cpp and or Burst/Jobs work with either target yet?

Can you confirm whether you are using Entities and the Entities.ForEach or not? Just want to rule some stuff out early!

I’m using the Entities namespace a fair bit (all my high performance stuff is in a Burst compiled Job), but not the Entities.ForEach. I am using the DOTS Physics system, but only for raycasts. I am not using any other ECS type patterns, like Entities/Systems.

The basic pattern is create some general input (static data blob and a dynamic input struct), pass in these inputs to a job via native array, schedule the job, and then read the output on the next frame. Lets me do some pretty crazy things (pass in 3 points and have a crazy wobbly bent spline mesh come out the other side).

I had all the packages updated a week or so ago and I’m on 2019.4.0f1. Updating to absolute latest is a bit of a pain given the platform modules I need to install.

I hope this helps–is there anything further I can do to help debug this?

Thanks!

A

Ok - could you file a fogbugz with a repro for this? It looks like an entities foreach issue to me, and I’ll be able to point the right person at this.

Filed, Case 1263371

Hope that helps, happy to help track this down more. Have a few Linux and Mac gamers who would like to be able to play my otherwise-apparently-functioning-game :slight_smile:

FYI it still happens in 2020:

InvalidOperationException: This should have been initialized by code gen
at Unity.Jobs.IJobBurstScheduableExtensions.Schedule[T] (T jobData, Unity.Jobs.JobHandle dependsOn) [0x00019] in <87c53671be6e4e8abb32063fe03ecc46>:0
at Unity.Entities.ChunkIterationUtility.PreparePrefilteredChunkLists (System.Int32 unfilteredChunkCount, Unity.Entities.UnsafeMatchingArchetypePtrList archetypes, Unity.Entities.EntityQueryFilter filter, Unity.Jobs.JobHandle dependsOn, Unity.Jobs.LowLevel.Unsafe.ScheduleMode mode, Unity.Collections.NativeArray`1[System.Byte]& prefilterDataArray, System.Void*& deferredCountData) [0x000ba] in <8f05e390b45643d6b5043f19c0e40270>:0
at Unity.Entities.JobChunkExtensions.ScheduleInternal[T] (T& jobData, Unity.Entities.EntityQuery query, Unity.Jobs.JobHandle dependsOn, Unity.Jobs.LowLevel.Unsafe.ScheduleMode mode, System.Boolean isParallel) [0x00010] in <8f05e390b45643d6b5043f19c0e40270>:0
at Unity.Entities.JobChunkExtensions.Schedule[T] (T jobData, Unity.Entities.EntityQuery query, Unity.Jobs.JobHandle dependsOn) [0x00000] in <8f05e390b45643d6b5043f19c0e40270>:0
at Unity.Physics.Systems.ExportPhysicsWorld.OnUpdate () [0x0007c] in <8ccf44601ea14aac989b5ccb4bd97b6c>:0
at Unity.Entities.SystemBase.Update () [0x00041] in <8f05e390b45643d6b5043f19c0e40270>:0
at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x0006a] in <8f05e390b45643d6b5043f19c0e40270>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
Unity.Entities.ComponentSystemGroup:OnUpdate()
Unity.Entities.ComponentSystem:Update()
Unity.Entities.DummyDelegateWrapper:TriggerUpdate()