Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2019.3.4: crashes on 32GB w/ out of memory AFTER Texture Atlas baking ( similar to Issue 1200814)

Discussion in '2D' started by spacefrog, Mar 9, 2020.

  1. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    I gots some serious out of mem crashing issues since i updated my project to 2019.3.4 ( from 2019.2 ). It mostly looks like the following ( closed issue ) which is fixed in Unity 2020
    https://issuetracker.unity3d.com/is...ing-indefinitely-when-building-sprite-atlases
    IMHO it's unevitable to backport such crashing issues to 2019.3 !

    When building , unity crashes right after its done baking the texture atlases. Memory usage suddenly jumps up to the whole system memory available ( which is 32 Gb in my case ). While on 2019.2 i was able to work around the increasing memory requirements for atlas building by increasing my swapfile size , this does'nt work any longer on 2019.3.4F1. We have some big multipage altasses to bake and this bug alone hinders us to upgrade our project to 2019.3.4F1 from 2019.2 ( which now will not get any updates any longer )
    The editor log shows some texture DX11 texture load errors, related to the source textures which are up to 8k. As it seems, unity crashes when loading such texture after the atlas build ( atlas size is limited to 4k textures )
    The edit log shows a big list of such entries and final says something like CRASH!!!
    d3d11: failed to create 2D texture id=1621 width=7996 height=4908 mips=1 dxgifmt=28 [D3D error was 8007000e]
    (Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/TexturesD3D11.cpp Line: 580)

    d3d11: failed to create 2D texture shader resource view id=1621 [D3D error was 80070057]
    (Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/TexturesD3D11.cpp Line: 530)

    d3d11: Failed to create 2D texture in GfxDeviceD3D11
    (Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/TexturesD3D11.cpp Line: 689)
     
    Last edited: Mar 10, 2020
  2. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Just wanted to add:
    even when initialising the sprite bake from script ( SpriteAtlasUtility.PackAllAtlases() ) the crash happens near the end when its almost done. This time the whole machine locked up because of no memory available, and i had to soft reset it
    I immediately started SpriteAtlasUtility.PackAllAtlases() again after i rebooted and loaded the project and this time it did't find any atlas to rebake, thus i think all baking went fine, but it's something right after unity finishes the bake which causes the crash
     
    Last edited: Mar 9, 2020
  3. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
  4. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Hey thx Daniel for the response.
    Ironically - just when i read your post unity crashed another time because of this issue, taking the webbrowser with it .
    I'll submit a report later, trying to isolate the crash to a certain atlas before ....
     
  5. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Okay .. some further details i could isolate:
    * the memory explosion/crash happens not during the actual bake, but while in the stage where the progress bar says "saving sprite atlas assets", so maybe its something in the file/image compression ?

    * its not a specific atlas that crashes but the crash happens when baking several large atlases in sequence ( either by build or via script )

    and another question:
    Why are atlases still baked when i have '"include in build" set to disable ?
    I disabled that flag on all of the atlases, but still at build time they are baked ... sounds a bit unlogical to me ...
     
  6. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Okay .. submitted a bug report ... waiting for the Issue ID and will post it here ...
     
  7. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    638
    Hi, thanks for the feedback. Right now, as Atlases can be used dynamically through Late-binding with Asset bundles or through Resources and also Variants require Master Atlases to be packed even if "not Included", all Atlases are packed generally. We will consider adding an additional step to check for all above criteria and ignore packing if possible. Thanks.
     
  8. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    sadly i havent heard back anything till now on the bug entry, so i cant post a case id .. it hasent been entered in the issue tracker till now. Could i share the fogbugz id with any of you unity people in PM ? I certainly dont want to share the fogbugz id publicly here ...

    For the project i had to rewind back to 2019.2 and the crash does'nt happen any longer ... as expected
     
  9. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Sure, you can PM me the Fogbugz ID and we can take a look from there
     
  10. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    So ... i could repro the whole crashes in a small repro project with only the spritesheets and atlas definitions and have uploaded the repro project using the bugreporter....
    In the meanwhile i could repro the bug using 2019.3.3f1, 2019.3.4f1, 2019.3.5f1 and the beta 2020.1.0b1 ( i did'nt test it on earlier 2019.3 versions than 2019.3.3f1 )
    Still only 2019.2 versions don't show the bug and let me actualy create builds without crashing
    Hope this helps identifying the problem finally and get it fixed so that i at the end can update the project to Unity 2019.3
     
  11. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    So ... my original report was closed because no repo project attached and QA could'nt repo
    I uploaded two new reports ( this time INCLUDING a small repo project ) about the same problem ( silly enough the bugreporter can't ADD an upload to an existing Case ID , so i had to create new reports which of course got two fresh ID's)
    Please please have a look at it ... its a serious crash bug affecting projects with large sprite tilesets and sprite atlasses
    My repo project is stripped down a lot only having a fraction off the original sprite sheets and still shows the crash 100% each build
     
  12. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    Hi,

    We are experiencing exactly the same issue. Is there already any update on this? Or is there atleast an existing issue report now?

    Thanks!
     
  13. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Hello, could you also send us a bug report (with the affected project attached if possible)

    It might provide us with more information regarding this issue.
     
  14. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    I accidentally found a way to bypass this issue.
    1. Edit > Project Settings > Editor > Set Sprite Packer Mode to "Enabled for builds(Legacy Sprite Packer)"
    2. Make build.
    3. Edit > Project Settings > Editor > Set Sprite Packer Mode back to "Always Enabled"
    4. Make build.
     
  15. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Ha joris , i missed your bypass tip ... will try for sure

    in the meantime, finally the issue got accepted and is available here
    https://issuetracker.unity3d.com/is...aking-when-not-enough-disk-space-is-available

    please vote to pump the priority for a fix !

    PS: cant imagine wy the available system disk space got into the description ( of course the swapfile will grow out of bounds and might fill your system disk with such a nasty memory leaking bug, but it still it IS primarily a RAM issue, not an available system disk space issue.. )
     
  16. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Sadly does'nt work for me ...still crashes
     
  17. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    638
    @spacefrog Many thanks for the repro project. We have identified the issue and implemented a fix and are testing it thoroughly.

    Apologies for the inconvenience caused. Would post an update as soon as this gets published and backported to other versions. Thanks.
     
    JorisEertink and spacefrog like this.
  18. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Great to hear !
    Thanks a lot for keeping me updated ...
     
  19. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    Any update on this matter?
     
  20. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Man ... i so hoped that the fix will be in 2019.3.10f1 ... but issue is still open :(
    mentioned as first "known issue" in the known issues section of the release notes
     
  21. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    638
    Quick update. The fix has been submitted and hopefully should be available in the following releases :

    2019.3 2019.3.11f1
    2020.1 2020.1.0b7
    2020.2 2020.2.0a8

    Will update as soon as they are published. Thanks .
     
    JorisEertink and spacefrog like this.
  22. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    christmas is coming early this year :)
     
  23. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    Man I was so excited, have been refreshing the releases page every hour since last week.
    Saw the release today, only to find out that it is still crashing...
     
  24. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    FYI, it only crashes when you have RGBA PVRTC as the compression format on the variants.
     
  25. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Just did the first test run building for windows on the new build ( 2019.3.11F1 ) and it did not crash for me ( we dont use variants ATM )
    have to test on the full project just to be sure , but things are looking good for me
     
  26. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    638
    I believe the issue with out of memory has been fixed in 2019.3.11f1 and the PVRTC is a separate issue that only happens on variants which we will be looking at. As a workaround please set the Master Atlas as Uncompressed RGBA32bit and use PVRTC for variants. Please let us know if this workaround helps.

    Also please note that if you are using Master/Variant setups, its always recommended to set Master to uncompressed (no pixel loss) and set variants to any compressed/uncompressed formats. This also speeds up variant packing.
     
    spacefrog and JorisEertink like this.
  27. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    Thanks I will try it out and let you know!
     
  28. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Okay .. everything looking good - full project builds without crashes ( win and android )
    have to wait for the console modules to test on them too ( NSW mainly )

    Update: Everything looking good still waiting for NSW module to appear to test

    Update2: baking works for NSW too , so i'm very happy right now and will update the project over the next days . Thanks a lot !
     
    Last edited: Apr 30, 2020
  29. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    I believe the issue with out of memory has been fixed in 2019.3.11f1 and the PVRTC is a separate issue that only happens on variants which we will be looking at. As a workaround please set the Master Atlas as Uncompressed RGBA32bit and use PVRTC for variants. Please let us know if this workaround helps.

    Hey @Venkify , I tried this out but unfortunately it does not work. It reduces the crash rate from 100% to 50% though :D.
    Still hoping this could be resolved in the near future, for now we also decided to disable our variant atlasses.
     
  30. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    638
    Thanks for updating. The PVRTC issue has also been fixed and I am hoping to get the backports done as early as possible. Will keep this thread posted. Thanks for your patience.
     
    AakashDP and JorisEertink like this.
  31. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Seems the issue has again reappeared in Unity 2020.1.b10
    havent tested 2019.3.15f1 but i strongly do hope that it hasn't been reintroduced again there

    Will test a bit and report back if found out more ...