Search Unity

Disable burst

Discussion in 'Entity Component System and C# Job system' started by jooleanlogic, Jan 11, 2019.

  1. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    177
    I get the following error in the console occasionally.
    I can't access the jobs menu cos I'm on linux (known bug).
    Is there some other way I can disable the burst compiler via config file or scripting define symbol?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    3,843
    I know there is, but I never really had to play with file directly.
    Someone will be better to answer that.
    However, what I would suggest, just create new project, and copy assets folder only to it.
    That would be the cleanest and safest way of doing things.
     
  3. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    177
    Thanks for reply Antypodish but I don't understand what you mean about copying the assets folder to a new project? Do you mean without burst installed somehow?
     
  4. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,123
    I don't really get what he's saying either.

    If you can't access menu you'll probably either need to look at source to see what toggling the menu buttons does and replicate the behaviour another way or just remove the burst tag using search/replace [BurstCompile] with //[BurstCompile] throughout the entire project.
     
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    3,843
    I mean, if something is broken in a project files, from what I understand, I would recreate new project, and install relevant packages again, hoping for fix. Then I can physically copy, or import asset folder. If that makes sense.

    Commenting out as per @tertle may be option, assuming this is reason for an issue.
     
  6. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    581
    Try to put [BurstDiscard]
     
  7. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    177
    Ah ok, thanks Antypodish.
    I'm trying to find out what's causing the exception though than avoid it.

    Thanks Wobes, I've already commented out my own burst jobs (only had two) so I think the exception is occurring within Unity's own burst jobs somewhere but perhaps related to me not cleaning something up.

    Thanks Tertle, that was a great idea. Didn't even occur to me.
    EditorPrefs.SetBool("BurstCompilation", false);
    The errors are random so will have to wait for it to pop up now.
     
    starikcetin and wobes like this.
  8. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    581
    Can I see the code of the jobs?
     
  9. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    201
    That's brilliant.
     
  10. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    177
    There's nothing out of the ordinary with the jobs worth printing. Just simple
    IJobProcessComponentData ones. E.g.
    Code (CSharp):
    1. [BurstCompile]
    2. struct Job : IJobProcessComponentData<Engine, RigidBody2D>
    3. {
    4.     public void Execute([ReadOnly] ref Engine engine, ref RigidBody2D rigidBody)
    5.     {
    6.         float2 force = engine.fwdVector * engine.thrust();
    7.         RigidBody2D.AddRelativeForce(ref rigidBody, ref force);
    8.     }
    9. }
    It's possible there's something wrong with my code somewhere, maybe the hybrid side of things, but I'm fairly certain it's just more linux gui errors as I get lots of those. This ones just hidden behind the burst compiler so I can't see it.
    I've disabled burst though so I'll find out soon enough.
     
  11. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    3,843
    I wonder, does burst comply with RigidBodies? Or Game Objects?
     
  12. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    177
    It's RigidBody2D, not Rigidbody2D. ;)
     
  13. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    3,843
    Sorry, but I don't get it?
     
  14. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    177
    Sorry Antypodish, my post was too subtle. :)
    I have my own RigidBody2D IComponentData with a captial B for Body which is different to Unity's Rigidbody2D MonoBehaviour which has a lowercase b for body.
     
  15. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    3,843
    wobes likes this.