Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Any way to set Vulkan GPU memory size by script?

Discussion in 'General Graphics' started by alexandre-fiset, Dec 13, 2023.

  1. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    717
    Hi,

    We have a few users encountering weird crashes while playing our game. On DX11, it crashes 100% of the time at a certain point, spamming "d3d11: failed to create buffer".

    The crash dump, as detailed in this thread, is not really helpful... but then in Vulkan, we noticed that the SystemInfo.graphicsMemorySize prints 512 mb, and then the log spams "Vulkan - Suboptimal memory type used for image because of low memory".

    That computer I debugged on has an AMD Ryzen 5 5500U with Radeon Graphics with 8gb of shared memory. I then wondered, how is Unity determining the amount of VRAM to be allocated for running the title?

    Shouldn't Unity use Vulkan Memory Allocator API and expose some parameters in the editor to customize how it functions?

    512 mb is very low vram even for a low end CPU. We should be able to crank it up 4 gb.