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

Bug d3d11: failed to create 2D texture shader resource view

Discussion in 'Unity Build Automation' started by oTaijjo, Nov 21, 2022.

  1. oTaijjo

    oTaijjo

    Joined:
    Nov 3, 2019
    Posts:
    30
    Hi, I'm building via Cloud Build and always get the following errors that prevent a successful build.
    When building from my windows machine, everything works out fine.

    Code (CSharp):
    1. Aborting batchmode due to fatal error:
    2. 71: [2022-11-21T15:13:11Z - Unity] ERROR: d3d11: failed to create 2D texture shader resource view id=1818 [D3D error was 8007000e]
    3. 72: [2022-11-21T15:13:11Z - Unity] d3d11: failed to create 2D texture shader resource view id=1818 [D3D error was 8007000e]
    4. 73: [2022-11-21T15:13:11Z - Unity] ERROR: d3d11: failed to create 2D texture shader resource view id=1815 [D3D error was 8007000e]
    5. 74: [2022-11-21T15:13:11Z - Unity] d3d11: failed to create 2D texture shader resource view id=1815 [D3D error was 8007000e]
    6. 75: [2022-11-21T15:13:11Z - Unity] ERROR: Could not allocate memory: System out of memory!
    7. 76: [2022-11-21T15:13:11Z - Unity] Fatal Error! Could not allocate memory: System out of memory!
    8. 77: [2022-11-21T15:13:11Z - Unity]   ERROR: LoadModule, GetLastError: 'Unknown error [-529697949]' (Address: 0000000000000000)
    Any Help or leads would be greatly appreciated
     
  2. oTaijjo

    oTaijjo

    Joined:
    Nov 3, 2019
    Posts:
    30
    I've went through the logs again and want to provide more details.

    Apparently the system runs out of memory after opening too many of our scenes. We got about 65 Scenes potentially containing an amount of 4K assets. Our game, when build is 2GB and the Project is about 10GB. Would this be enough to exceed Cloud Build's memory?

    I'm building for Windows 64 in Unity 2022.1.20f1

    Here's the first occurance of the "out of memory" and the d3d11 errors:
    Code (CSharp):
    1. 4595: [2022-11-21T15:12:49Z - Unity] Opening scene 'Assets/BLE/Gameplay/LevelsSinners/Envy/Envy1.unity'
    2. 4596: [2022-11-21T15:12:49Z - Unity] Unloading 72 Unused Serialized files (Serialized files now loaded: 0)
    3. 4597: [2022-11-21T15:13:05Z - Unity] Loaded scene 'Assets/BLE/Gameplay/LevelsSinners/Envy/Envy1.unity'
    4. 4598: [2022-11-21T15:13:05Z - Unity]     Deserialize:            57.263 ms
    5. 4599: [2022-11-21T15:13:05Z - Unity]     Integration:            15410.817 ms
    6. 4600: [2022-11-21T15:13:05Z - Unity]     Integration of assets:  0.038 ms
    7. 4601: [2022-11-21T15:13:05Z - Unity]     Thread Wait Time:       0.022 ms
    8. 4602: [2022-11-21T15:13:05Z - Unity]     Total Operation Time:   15468.141 ms
    9. 4603: [2022-11-21T15:13:07Z - Unity] Unloading 9290 unused Assets / (12.9 MB). Loaded Objects now: 36093.
    10. 4604: [2022-11-21T15:13:07Z - Unity] Memory consumption went from 15.15 GB to 15.14 GB.
    11. 4605: [2022-11-21T15:13:07Z - Unity] Total: 2366.632500 ms (FindLiveObjects: 1207.831400 ms CreateObjectMapping: 56.774500 ms MarkObjects: 537.579000 ms  DeleteObjects: 564.441000 ms)
    12. 4606: [2022-11-21T15:13:07Z - Unity]
    13. 4607: Aborting batchmode due to fatal error:
    14. 4608: Could not allocate memory: System out of memory!
    15. 4609: Trying to allocate: 22369648B with 16 alignment. MemoryLabel: Texture
    16. 4610: Allocation happened at: Line:69 in C:\buildslave\unity\build\Runtime\Utilities\dynamic_array.h
    17. 4611: Memory overview
    18. 4612: [ ALLOC_TEMP_TLS ] used: 899566B | peak: 0B | reserved: 55771136B
    19. 4613: [ ALLOC_MEMORYPROFILER ] used: 4280088B | peak: 4295448B | reserved: 5242880B
    20. 4614: [ ALLOC_DEFAULT ] used: 256467136B | peak: 0B | reserved: 360722432B
    21. 4615: [ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 2097152B
    22. 4616: [ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 2097152B
    23. 4617: [ ALLOC_TEMP_JOB_4_FRAMES (JobTemp) ] used: 2200003B | peak: 0B | reserved: 134217728B
    24. 4618: [ ALLOC_TEMP_JOB_ASYNC (Background) ] used: 0B | peak: 0B | reserved: 19922944B
    25. 4619: [ ALLOC_GFX ] used: 15922056533B | peak: 0B | reserved: 15992877056B
    26. 4620: [ ALLOC_CACHEOBJECTS ] used: 124928660B | peak: 0B | reserved: 682283008B
    27. 4621: [ ALLOC_TYPETREE ] used: 10820952B | peak: 0B | reserved: 23068672B
    28. 4622: [ ALLOC_PROFILER ] used: 511376B | peak: 528256B | reserved: 16777216B
    29. 4623: [ ALLOC_PROFILER_EDITOR ] used: 0B | peak: 0B | reserved: 0B
    30. 4624: UnityEditor.CloudBuild.Builder:Build ()
    31. 4625: [2022-11-21T15:13:11Z - Unity] ERROR: d3d11: failed to create 2D texture shader resource view id=1818 [D3D error was 8007000e]
     
  3. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    291
    I recommend opening up a support ticket via the cloud build dashboard so that one of our customer service reps can jump in and try to take a deeper look.
     
  4. oTaijjo

    oTaijjo

    Joined:
    Nov 3, 2019
    Posts:
    30
    Thank you, I did that.
     
  5. bearcoree

    bearcoree

    Joined:
    Mar 8, 2016
    Posts:
    72
    Heya, we are seeing the same issue. Did you find a solution?
     
  6. bearcoree

    bearcoree

    Joined:
    Mar 8, 2016
    Posts:
    72
    The fix for us was to switch the cloud build operating system to macos for our windows build.
     
  7. oTaijjo

    oTaijjo

    Joined:
    Nov 3, 2019
    Posts:
    30
    Hi, as mentioned I've opened a support ticket directly over Unity Gaming Services. The reply I got there was that we seem to use a lot of 4K textures, which we do, because our game is developed for 4K screens. (The project is about 10GB in size, a finished build is about 2GB)

    Long story short: The cloud builders don't have enough memory to handle our project and I have to find another solution.

    @bearcoree How am I configuring a build to build for windows but use MacOs? There's only one dropdown in the Configuration.
     
  8. bearcoree

    bearcoree

    Joined:
    Mar 8, 2016
    Posts:
    72
    Heya, for me it's in the basic build settings:
     
  9. oTaijjo

    oTaijjo

    Joined:
    Nov 3, 2019
    Posts:
    30
    Yeah, that's the dropdown I mean. Isn't that the setting for which platform you're building. So in your case you're building for OSX with a build that just has "Windows" in its name, but the result is a Mac build?

    I have another configuration with basically the same, but this dropdown set to Mac. After 6 hours of building, I've cancelled that build since builds usually don't take this long and every minute is costing us.
     
  10. bearcoree

    bearcoree

    Joined:
    Mar 8, 2016
    Posts:
    72
    This is the OS of the machine that builds your game, not the build target. Mac builds take significantly longer, but don't show the issue for us.
     
  11. oTaijjo

    oTaijjo

    Joined:
    Nov 3, 2019
    Posts:
    30
    We decided to not use Cloud build for our game now.

    Still, out of curiosity:
    If the "Builder Operating System" dropdown only sets the OS used for building, where is the setting to set the actual build target?
     
  12. bearcoree

    bearcoree

    Joined:
    Mar 8, 2016
    Posts:
    72
    When you create a new build configuration, the first selection you make is the build target platform.
    upload_2022-12-20_13-27-57.png
     
  13. oTaijjo

    oTaijjo

    Joined:
    Nov 3, 2019
    Posts:
    30
    Thank you! This totally slipped my perception!