Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Vulkan UseTexture() and CreateResource() crashes

Discussion in 'Android' started by joshuacwilde, Sep 3, 2022.

  1. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    692
    It seems we are getting multiple crashes related to Vulkan.

    Are these known errors? I have no idea what is causing them as it happens at different times, after playing for a while.

    We don't get any crashes on GL ES, but consistent crashes on Vulkan. We would really like to use Vulkan though for the performance benefits.

    Code (CSharp):
    1. Native StackTrace:
    2.  
    3. Thread 0 (crashed)
    4. 0   libunity.so                        0x00000070f6e0954c vk::Texture::UseTexture(vk::CommandBuffer*, unsigned int, VkSampler_T*) const
    5. 1   libunity.so                        0x00000070f6e16430 vk::DescriptorState::BindTexture(vk::Texture*, unsigned int, vk::CommandBuffer*)
    6. 2   libunity.so                        0x00000070f6e3f0d8 VKImmediateContext::SetTextures(int, GfxTextureParam const*, vk::ImageManager&, vk::CommandBuffer*)
    7. 3   libunity.so                        0x00000070f6f4c090 GpuProgram::ApplyTextureParameters(unsigned char const*, GfxDevice&, ShaderType)
    8. 4   libunity.so                        0x00000070f6de82a0 VKGpuProgram::ApplyGpuProgram(GpuProgramParameters const&, vk::ConstantBufferState&, unsigned char const*, vk::PreTransform)
    9. 5   libunity.so                        0x00000070f6e3ef4c VKImmediateContext::SetShaders(vk::FrameNumbers const&, VKGpuProgram*, GpuProgramParameters const*, unsigned char const*)
    10. 6   libunity.so                        0x00000070f6c4d244 ShaderLab::ShaderState::ApplyShaderState(unsigned int, ShaderPropertySheet const*, ShaderPassContext const&, ShaderKeywordSet const&, Shader*, ShaderLab::Pass*, bool*, ShaderLab::SubPrograms*, DeviceRenderStateBlock const*, int, int) const
    11. 7   libunity.so                        0x00000070f6c4d058 ShaderLab::Pass::ApplyPass(unsigned int, ShaderPropertySheet const*, ShaderPassContext&, Shader*, int, int, bool*, ShaderLab::GrabPasses const*, ShaderLab::SubPrograms*, DeviceRenderStateBlock const*)
    12. 8   libunity.so                        0x00000070f6c20cd8 ApplyMaterialPassWithCache(SharedMaterialData const&, ShaderPassContext&, Shader*, ShaderLab::Pass*, int, int, bool, ShaderLab::GrabPasses const*, ShaderLab::SubPrograms*, DeviceRenderStateBlock const*)
    13. 9   libunity.so                        0x00000070f6c20d7c ApplyMaterialPassAndKeywordsWithCache(SharedMaterialData const&, ShaderPassContext&, Shader*, ShaderLab::Pass*, int, int, bool, ShaderLab::GrabPasses const*, ShaderLab::SubPrograms*, DeviceRenderStateBlock const*)
    14. 10  libunity.so                        0x00000070f6eccc98 BatchRenderer::ApplyShaderPass(ShaderPassContext&, SharedMaterialData const*, Shader*, BatchRenderer::PassInfo&, BatchingFlags, bool, bool, ShaderLab::GrabPasses const*, DeviceRenderStateBlock const*)
    15. 11  libunity.so                        0x00000070f6ed1120 ForwardShaderRenderLoop::StartRenderJobs(JobFence&, bool, bool, ShaderPassContext&)
    16. 12  libunity.so                        0x00000070f6dfa5b8 GfxDeviceVKBase::ExecuteAsyncSetup(GfxDeviceAsyncCommand*)
    17. 13  libunity.so                        0x00000070f6befc14 JobQueue::Exec(JobInfo*, long long, int, bool)
    18. 14  libunity.so                        0x00000070f6beff14 JobQueue::ExecuteJobFromHighPriorityStack(bool)
    19. 15  libunity.so                        0x00000070f6bf00f8 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*)
    20. 16  libunity.so                        0x00000070f6bef660 JobQueue::WorkLoop(void*)
    21. 17  libunity.so                        0x00000070f6c85644 Thread::RunThreadWrapper(void*)
    22. 18  libc.so                            0x00000071ebe797b8 <symbols missing for uuid: 2499da84be20422da3f6f4b7cdc59990>
    23. 19  libc.so                            0x00000071ebe19050 <symbols missing for uuid: 2499da84be20422da3f6f4b7cdc59990>


    Code (CSharp):
    1. Native StackTrace:
    2.  
    3. Thread 0 (crashed)
    4. 0   libunity.so                        0x00000077cbb67e84 vk::DataBuffer::CreateResource()
    5. 1   libunity.so                        0x00000077cbb68640 vk::DataBuffer::Update(void const*, vk::CommandBuffer*, vk::ScratchBuffer*, vk::FrameNumbers const&, unsigned long, unsigned long)
    6. 2   libunity.so                        0x00000077cc0e9994 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&)
    7. 3   libunity.so                        0x00000077cc0ed694 GfxDeviceWorker::RunExt(ThreadedStreamBuffer&)
    8. 4   libunity.so                        0x00000077cc0e53cc GfxDeviceWorker::RunGfxDeviceWorker(void*)
    9. 5   libunity.so                        0x00000077cb9b7644 Thread::RunThreadWrapper(void*)
    10. 6   libc.so                            0x0000007b53ef2e94 <symbols missing for uuid: 0f39fc790debeef5bc191987ab30a3f5>
    11. 7   libc.so                            0x0000007b53e8f4b0 <symbols missing for uuid: 0f39fc790debeef5bc191987ab30a3f5>
    12.  
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    What Unity version?
    If you are on the latest available 2020 or 2021 lts make a big report for the crash
     
  3. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    692
    2020.3.36. This is the only report we get (from the Unity Dashboard).
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    If it's 1 user it might just be bad drivers or a random crash
     
  5. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    692
    I wish that were the case, but it happens from multiple people on different devices, and I really doubt it is bad drivers. Probably just a buggy unity implementation. It's a pretty new flagship device. Snapdragon 865+
     
  6. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    I can’t remember seeing a crash in UseTexture. You could try to disable GraphicsJobs.

    Crashes in DataBuffer::CreateResource were fairly common but mainly in Editor and in general when running low on GPU memory.
    Probably not exactly what you have.
     
    joshuacwilde likes this.
  7. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    692
    Just wanted to follow up and say that did appear to fix the issue, thanks!
     
  8. FuhaoXie

    FuhaoXie

    Joined:
    Nov 18, 2016
    Posts:
    26
    I meet the same crash 2020.3.40
     
  9. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    If you can reproduce make a bug report
     
  10. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    103
    I might have the same crash with unclear error log in 2021.2 and 21.3. But graphics jobs don't help. I simply switch from DX11 to Vulkan and my editor crashes at start 100% of the time in a large scene. Works in a tiny scene though.
    It looks like Vulkan doubles my RAM and VRAM usage compared to DX11 so this might be the cause. I submitted a report but couldn't attach my 100GB project.
    ========== OUTPUTTING STACK TRACE ==================

    0x00007FF7B164B684 (Unity) vk::DataBuffer::CreateResource
    0x00007FF7B164D423 (Unity) vk::DataBuffer::Initialize
    0x00007FF7B161503A (Unity) GfxDeviceVK::InitializeBufferInternal
    0x00007FF7B2B0B0E3 (Unity) GfxDeviceWorker::RunCommand
    0x00007FF7B2B0E0BD (Unity) GfxDeviceWorker::RunExt
    0x00007FF7B2B0E1D8 (Unity) GfxDeviceWorker::RunGfxDeviceWorker
    0x00007FF7B1222EC7 (Unity) Thread::RunThreadWrapper
    0x00007FFBC85A7034 (KERNEL32) BaseThreadInitThunk
    0x00007FFBC9BC26A1 (ntdll) RtlUserThreadStart

    ========== END OF STACKTRACE ===========
     
  11. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    103
    Last edited: Oct 14, 2022
  12. FirstAfterGod2501

    FirstAfterGod2501

    Joined:
    Apr 22, 2023
    Posts:
    1
    same issue at 2022.3.8f