Search Unity

Official Burst for standalone players

Discussion in 'Burst' started by xoofx, Jul 10, 2018.

  1. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Could you give us more details about the CPU used on your machine? (ideally CPU-Z report for supported CPU features)
     
  2. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Here's that info. Again, what's most weird is that it WAS working fine on this computer, but now crashes. Thanks!

    cpu.png
     
  3. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    118
    Would you be able to try to narrow down the job that is failing and post the assembler and IR from the inspector for the job in question?
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Sure....how do I do that?

    The only thing we're using Burst for is Vegetation Studio Pro -- does that help?
     
  5. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Probably not there is 50+ jobs of most types IJob, IJobParallellFor, IJobParalellForBatch, filter, deferred etc doing calculations.

    Would not help narrow down the compiler issue.
     
  6. TheJavierD

    TheJavierD

    Joined:
    Jan 6, 2017
    Posts:
    51
    Hello,

    We were using Jobs/Burst in our Magic Leap (Lumin OS) project up until 2019.1

    After updating to 2019.2 it refuses to compile

    Lumin is Android based I thought, maybe you guys forgot to flip a switch?, It was working before as far as I understand, please don't take this away from us.

    the error is:

    BuildFailedException: Burst compiler (1.1.2) failed running

    Burst requires in order to build a standalone player for Lumin with ARMV8A_AARCH64
    NativeLinker is not supported for this platform

    Thanks!
     
    Last edited: Aug 5, 2019
  7. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    FWIW, I started receiving the "Burst requires Visual Studio" error message today when building for Windows x86_64 Standalone. I've built successfully with Burst in my project for a year now, but started getting this error when building after updating from Windows 10 v1803 to Windows v1809 (The October 2018 Windows release.)

    I tried a few things (rebooting, downgrading Burst just in case it was an issue in the latest version), but I kept getting the error. Ultimately, based on advice in this thread, I fully uninstalled VS 2019 Community edition, and fully reinstalled it. That got my build working again. I included the "Desktop Development with c++" when reinstalling VS.

    What's a bit strange is that I'm pretty confident I had never installed "Desktop Development with c++" before when installing Visual Studio, yet it worked fine. Perhaps some changes between Windows 10 versions (1803 vs 1809) resulted in certain dependencies no longer being available on my machine, necessitating the "Desktop Development with c++" tools. I'm not sure.

    Anyway, in case anyone else hits this issue, in at least one case, fully reinstalling VS with "Desktop Development with c++" got me up and running again.
     
  8. Grizmu

    Grizmu

    Joined:
    Aug 27, 2013
    Posts:
    131
    Couldn't get the Burst 1.1.2 to compile with the Visual Studio 2017, even with it having all of the necessary modules installed.

    The problem got fixed when I've modified VS2019, which i've had around, to also have "Desktop Development with c++", though I haven't used it for Unity projects. Seems that burst checks only the newest installation of the VS for the requirements.
     
  9. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    So in order to work with Burst you need VS? You can't use Burst with a different IDE like Jetbrains Rider?
    Oh and is it possible to use Burst now for Nintendo Switch?
     
  10. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    No, I can use Rider fine. I actually recommend it as an editor. You just need to have a particular part of VS installed (which is easiest if you just install it with editor.)
     
  11. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    118
    Can you confirm which android ndk is being used? (Editor Preferences)
    Also which burst version ?
     
  12. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    118
    phobos2077 likes this.
  13. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Thanks for pointing out that table of toolchain requirements.

    I see that there's no macOS "Target Player Platform" associated with any Windows "Editor Host Platforms". Does that mean that in order to create a macOS build of a game that uses Burst, it's necessary to actually build it on Apple hardware, as it requires XCode to exist on the build machine? In which case, it's not possible to create a macOS build of the game on Windows hardware if "Mac Build Support (Mono)" is included as one of the installed Unity modules? If so, is that the long term plan, or is this a temporary issue? It seems pretty terrible if Burst is solely responsible for not being able to create macOS builds on Windows hardware. (Unless I've misunderstood the table you've linked.)
     
  14. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
  15. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Thanks, I'm glad I know that. I'll just planCome to think of it, I created a macOS build of my game some time ago, and it didn't fail to build. But looking over the Burst User Guide page linked above, it reads:

    So, I take it that the macOS Build I created would have generally worked, but it would have been as if I'd simply removed [BurstCompile] from all my jobs?
     
  16. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    118
    Correct
     
    dgoyette likes this.
  17. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Burst make build fail while it is disabled!

    upload_2019-8-15_14-12-38.png

    How to disable burst at all?
     
  18. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    118
    Hmm, that should work, under ProjectSettings there should be one or more BurstAotSettings_xxxx.json files, can you verify that value for disabled is true for the particular platform you are trying to compile for, e.g.

    "DisableBurstCompilation": true
     
    JesOb likes this.
  19. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    118
    For those with SSE related crashes (@gecko & @xVergilx) - I've identified the cause of these issues, we have a fix, but i don't have an ETA on a new package yet.
     
    xVergilx likes this.
  20. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Yes that was the problem :)
    So Bug is Unity dont write into these files when you change inspector values (we Build linux standalone from windows).
    Only manual write to file actually help :)
     
  21. Lee_Hammerton

    Lee_Hammerton

    Unity Technologies

    Joined:
    Jul 26, 2018
    Posts:
    118
    I've logged an issue, but i`m wondering if its possible that you don't have the Lumin SDK installed? Prior to 2019.2 burst errors would not cause the build to fail, so its possible this was missed?
    I noticed Lumin is not specifically called out in our documentation for AOT requirements too, so I've made a note to get that updated too.
     
  22. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    OK we will try out.
    Thanks for advice :)
    We definitely dont have Lumin SDK :)
     
  23. TheJavierD

    TheJavierD

    Joined:
    Jan 6, 2017
    Posts:
    51
    Thanks Lee!, if we could use Burst in Lumin OS it would be amazing!.

    Things are definitely properly configured for Lumin OS builds, in 2019.1 we had burst enabled and it appeared to work. Once we tried to update to 2019.2 it stopped letting us build just like I mentioned.

    We can still use the Job system in 2019.2 if we disable burst, but if it actually worked it would be super!.
     
  24. Deleted User

    Deleted User

    Guest

  25. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Hmm I thought this was generally meant to work now and my generic systems/jobs seem to work fine for me with burst. Do you have a sample for the situation that is crashing? Platform? IL2CPP or mono?
     
    Last edited: Aug 20, 2019
  26. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    The issue that json file does not be modified via project setting is very annoying. I hope that issue should be fixed soon.
     
  27. Deleted User

    Deleted User

    Guest

    It is not crashing for me but it does not get compiled in standalone build just because T is unknown at compile time. So what happens is that Burst does not know that it should be compiled. A job is getting created by Activator through reflection but getting compiled in Editor just because Editor uses JIT, but to build a standalone Burst uses AOT compilation. I would want to somehow tell Burst that these jobs need to be burst compiled in AOT or have JIT support in standalone build.
     
    Last edited by a moderator: Aug 20, 2019
  28. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Oh you're using Activator. Yeah that's a whole different pile of worms.
     
  29. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    @wobes - have you tried registering the concrete implementations of the generic type? I believe this is required if T is related to generic component types. Have you tried using the Preserve attribute on the Jobs as well, to force them to not be stripped?

    See
    PreserveAttribute
    and
    RegisterGenericComponentTypeAttribute
     
  30. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    I don't think stripping is the issue, it has to be explicitly defined at compile time so that burst can compile it.

    RegisterGenericComponentTypeAttribute only works for generic unity components and simply adds them to the type manager.

    Code (CSharp):
    1.  
    2. // Register ComponentData concrete generics
    3. foreach (var registerGenericComponentTypeAttribute in
    4.    assembly.GetCustomAttributes<RegisterGenericComponentTypeAttribute>())
    5. {
    6.    var type = registerGenericComponentTypeAttribute.ConcreteType;
    7.  
    8.    if (typeof(IComponentData).IsAssignableFrom(type) ||
    9.        typeof(ISharedComponentData).IsAssignableFrom(type) ||
    10.        typeof(IBufferElementData).IsAssignableFrom(type))
    11.    {
    12.        componentTypeSet.Add(type);
    13.    }
    14. }
    15.  
    If he simply inherited the systems instead of using Activator it'd work fine as well but it sounds like he wants to dynamically create systems using activator which just isn't supported (and I suspect might never be supported.)
     
    Last edited: Aug 20, 2019
    jlreymendez and Deleted User like this.
  31. Soaryn

    Soaryn

    Joined:
    Apr 17, 2015
    Posts:
    328
    EDIT: I have managed to resolve my issue, but I had to manually install the Windows 10 SDK. That seems a little inconsistent with the rest of Unity, so hopefully that will be resolved later?

    It would seem I am having an issue with the "Burst requires Visual Studio" as well.
    Version: Unity 2019.3.0a11
    Build Target: Windows

    Attempted adding the module via the unity Hub, but the window flashes up then closes, so no conclusion if it actually installed.

    Visual studio 2019 is installed, though I use Rider for my development.
     
    Last edited: Aug 21, 2019
  32. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Burst does not support today to have generic abstraction around job.schedule, so all jobs scheduled need to have an explicit usage of their type.
     
  33. DongJoy

    DongJoy

    Joined:
    Jan 25, 2018
    Posts:
    1
    May you tell me when support Accuracy/Precision?
     
  34. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Not sure to fully understand the question but have you checked the documentation about FloatPrecision and FloatMode?
     
  35. Danistmein

    Danistmein

    Joined:
    Nov 15, 2018
    Posts:
    82
    Hi,

    When I use Burst 0.2.4-preview.23 to compile. These errors occurred. Can you give me some threads?

     
  36. GaryT_01000111

    GaryT_01000111

    Joined:
    Aug 4, 2017
    Posts:
    13
    Hi
    I tried building using burst but it doesn't build.

    The console shows "BuildFailedException: Burst compiler (1.1.2) failed running"
     
  37. GaryT_01000111

    GaryT_01000111

    Joined:
    Aug 4, 2017
    Posts:
    13
    Never mind that, it was because the windows username has a space. Tried it on another machine and it worked.
    Any way I can have it work with the space? I don't want to change the username as it's a shared laptop and I don't want to mess with other's things.
     
  38. Danistmein

    Danistmein

    Joined:
    Nov 15, 2018
    Posts:
    82
    When I updated the the Burst and ECS, this error has gone.
     
  39. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    We fixed this bug recently - the fix will be in the next 1.2 preview release, which will hopefully be out later this week.
     
    GaryT_01000111 likes this.
  40. jlreymendez

    jlreymendez

    Joined:
    Dec 11, 2012
    Posts:
    5
    Is generic abstraction part of burst's roadmap?
    I just found out about this after testing my development build.
     
  41. Deleted User

    Deleted User

    Guest

    Thank you so much for your talk at Unite Copenhagen, tips were very useful.
    I would like to vote up for generics. Is there any way for Burst to detect Activator.CreateInstance(typeof(T<>).MakeGenericType()) calls before build?

    For now the only solution is to explicitly initialize Job<T> somewhere in code.
     
    Last edited by a moderator: Oct 16, 2019
  42. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Not on the short term, something we will work on next year, but can't give any ETA
     
  43. GaryT_01000111

    GaryT_01000111

    Joined:
    Aug 4, 2017
    Posts:
    13
    Thanks for the info. I'll definitely check it out.
     
  44. slime73

    slime73

    Joined:
    May 14, 2017
    Posts:
    107
    Is there a timeline for Switch support?
     
    JesseSTG likes this.
  45. amarcolina

    amarcolina

    Joined:
    Jun 19, 2014
    Posts:
    65
    To what extent is `BurstCompiler.CompileFunctionPointer` supported in standalone players right now? Everything seems to work fine in editor for me, but I can't get anything to compile properly in standalone builds. I've tried on the latest versions of Burst on 2019.1, 2019.2, and 2019.3.
     
  46. pcysl5edgo

    pcysl5edgo

    Joined:
    Jun 3, 2018
    Posts:
    65
    Burst Compiler does not correctly process the managed dll whose file name is different from its assembly name.
    It throws an AssemblyResolutionException.
     
  47. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Yes, this is not supported
     
    pcysl5edgo likes this.
  48. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    It depends what you are trying to compile. If your function pointer is compiled through a generic abstraction, it won't be able to be discovered by burst standalone build (see this discussion My personal feedback of the full DOTS spectrum)
     
    amarcolina likes this.
  49. pcysl5edgo

    pcysl5edgo

    Joined:
    Jun 3, 2018
    Posts:
    65
    Thank you for your official answer.
     
  50. amarcolina

    amarcolina

    Joined:
    Jun 19, 2014
    Posts:
    65
    Hmm, I'm not using generics at all. This piece of code is enough to throw a
    Burst failed to compile the given delegate
    exception in a built player, although it works fine in the editor.

    Code (CSharp):
    1. void Start() {
    2.     BurstCompiler.CompileFunctionPointer<AddValue>(Add1);
    3. }
    4.  
    5. public delegate int AddValue(int value);
    6.  
    7. [BurstCompile]
    8. public static int Add1(int value) {
    9.     return value + 1;
    10. }