As part of the 2018.2 release of Unity, we are pleased to release an official preview of the burst package with support for standalone players (i.e AOT mode of burst) which is only working with 2018.2+
This version **0.2.4-preview.20** is now accessible from the package manager:
There is a documentation available through the burst package. This is an early preview. We expect to give more insights on how to better use burst to improve the performance of your games.
Support for standalone players
When building a player, burst will compile a single dynamic library for all the burst jobs in your game. Depending on the platform, the dynamic library will be output to a different folder (on Windows, it is in the path Data/Plugins/lib_burst_generated.dll)
This library will be loaded by the Job system runtime on the first job compiled by burst.
The settings to enable the compilation are controlled by the Jobs/burst menu, the same way than for the editor.
In a future iteration, these settings will be moved to proper settings per platform/player.
Supported platforms
This release is supporting the following platforms for standalone players:
Windows
MacOS
Linux
Xbox One
PS4
Android (ARM v7 and v8+)
iOS (ARM v7 and v8+)
Note that most platforms using Intel x64 processors should be working quite flawlessly. For the mobile platforms, this is something really new and you might encounter bugs for these platforms. Please let us know by reporting them via the Help menu and select Report a bug.
Known issues
We still have a few known issues with this release for standalone players support:
Accuracy/Precision are currently not supported
The target CPU is currently hardcoded per platform (e.g SSE4 for Windows 64 bits)
These issues will be resolved in a future release of burst.
Please note also that the latest release of ECS 0.0.12-preview.8 is not using this version of burst. A new version of ECS will be published in the coming days with the latest burst.
Not for this version unfortunately. There are a few issues that prevented to release this feature in this release. Can’t tell exactly when these will be resolved.
Does it work with jobs outside of the ECS? I successfully used the job system for procedural Generation and now I want to experiment with the burst compiler as well. I added the package and put the [BurstCompile] attribute over a job struct, but it can’t compile as it can’t find the attribute. The only attribute found is BurstDiscard.
I’m on 2018.2 and use the incremental compiler and assembly definition files.
Burst can be used without ECS. You need to include the Burst package in the package manager.
(ECS package automatically includes a dependency on Burst)
Thanks for the answer, but like I said, I have the package already installed from the package manager. The file is even there in the project browser, but even with including “Unity.Burst” the compiler can’t seem to find the attribute. The Editor Tools coming with the Burst package seem to run fine though. I can open the Burst Job Inspector and so on. I simply can’t compile any jobs, as the BurstCompile attribute is not recognized for some weird reason. I have the suspicion it might be related to assembly definition files, but I am not sure.
Any ETA on when the assemblies from packages will be available in the selection menu for references? Right now, in order to add a dependency to Unity.Burst, you have to open the asmdef file in a text editor.
Ah that makes sense, thank you. I already thought about doing that, but as it didn’t show up in the drop down menu, I thought it might not be the case. Thank you very much!
Thanks, and good idea! However, even after installing the sdk and vc++ I still get this error.I am on windows 10, VS2017, Unity 2018.2.2f1 and on Burst 0.2.4-preview.23
System.NotSupportedException: Burst compilation for standalone, is only supported with a suitable compiler tool chain. (C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
Visual Studio 2010 with C++ compilers and Windows 7 SDK (it cannot build C++ code because it is not installed)
Visual Studio 2010 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir" in the registry
Windows 7 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder" in the registry
Visual Studio 2013 with C++ compilers and Windows 8.1 SDK (it cannot build C++ code because it is not installed)
Visual Studio 2013 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\12.0_Config\InstallDir" in the registry
Windows 8.1 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1\InstallationFolder" in the registry
Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)
Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
Visual Studio 2017 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)
Visual Studio 2017 installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
).
at Burst.Compiler.IL.Aot.AotLinker.Link(IEnumerable`1 objFiles, String outPath)
at Burst.Compiler.IL.Aot.AotCompiler.Link(Module module, AotCompilerOptions compilerOptions)
at Burst.Bcl.Program.Main(String[ ] args)
I don’t remember the defaults, but perhaps the CLI (command line interface) is also necessary?
Did you add the IL2CPP Windows build target inside Unitys installer?
Other than that, try a restart of Windows
@ : does posting “internal errors” reported in the console when using Burst help you? Such as :
C:\buildslave\unity\build\Runtime\Jobs\Managed\IJobParallelForTransform.cs(32,13): error: Internal compiler error while processing function `System.Void UnityEngine.Jobs.IJobParallelForTransformExtensions/TransformParallelForLoopStruct`1::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)`
While compiling job: System.Void UnityEngine.Jobs.IJobParallelForTransformExtensions/TransformParallelForLoopStruct`1<treePartWobbling>::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)
Compiler exception: Burst.Compiler.IL.Syntax.BuilderException: Internal compiler error while processing function `System.Void UnityEngine.Jobs.IJobParallelForTransformExtensions/TransformParallelForLoopStruct`1::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)` ---> System.InvalidOperationException: Unable to find interface method `System.Void UnityEngine.Jobs.IJobParallelForTransform::Execute(System.Int32,UnityEngine.Jobs.TransformAccess)` from type `treePartWobbling`
at Burst.Compiler.IL.Syntax.ILBuilder.DevirtualizeMethod (Mono.Cecil.TypeReference thisType, Mono.Cecil.MethodReference methodReference, Burst.Compiler.IL.Syntax.GenericContext& thisContext) [0x00147] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.Syntax.ILBuilder.Call (Mono.Cecil.Cil.Instruction inst, Mono.Cecil.MethodReference methodReference, Burst.Compiler.IL.Syntax.ILExpression thisArgument) [0x000c6] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.Syntax.ILBuilder.ProcessInstruction (Mono.Cecil.Cil.Instruction inst) [0x003d6] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.Syntax.ILBuilder.ProcessInstructions () [0x00074] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
--- End of inner exception stack trace ---
at Burst.Compiler.IL.Syntax.ILBuilder.ThrowInternalError (System.Exception ex) [0x0002d] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.Syntax.ILBuilder.ProcessInstructions () [0x001de] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.Syntax.ILBuilder.ProcessFunctionBody () [0x000b7] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.Syntax.ILBuilder.Visit (Burst.Compiler.IL.Syntax.MethodBinding binding) [0x00099] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.ILVisitor.PrepareFunctionInternal (Burst.Compiler.IL.Syntax.MethodBinding methodBinding) [0x00065] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.ILVisitor.PrepareFunction (Burst.Compiler.IL.Syntax.MethodBinding methodBinding) [0x00000] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
at Burst.Compiler.IL.ILVerifier.PrepareFunction (Burst.Compiler.IL.Syntax.MethodBinding methodBinding) [0x00000] in <a2ed9824c1aa48fdb9ed369837529c5f>:0
using UnityEngine;
using UnityEngine.Jobs;
using Unity.Collections;
using Unity.Burst;
[BurstCompile]
public struct treePartWobbling : IJobParallelForTransform {
[ReadOnly]
public Vector3 rotationAxis;
[ReadOnly]
public float elongation;
void IJobParallelForTransform.Execute(int index, TransformAccess transform)
{
transform.rotation *= Quaternion.AngleAxis(elongation, rotationAxis);
}
}