Search Unity

Question vulkan graphic api cause out of memory.

Discussion in 'Universal Render Pipeline' started by dujimache, Mar 24, 2021.

  1. dujimache

    dujimache

    Joined:
    Dec 17, 2011
    Posts:
    89
    we are using a ttf font, when build with opengl es graphic api, we captured the memory at runtime on Android device. The font atlas texture's size is 8Mb.
    but if we build with vulkan graphic api, the font atlas texture's size is more than 200 mb at runtime.

    the unity version is unity 2020.2.1.f1
     
  2. KangLan

    KangLan

    Joined:
    Jun 19, 2021
    Posts:
    2
    is solved?
     
  3. KangLan

    KangLan

    Joined:
    Jun 19, 2021
    Posts:
    2
    It may be caused by multi-threaded rendering?
     
  4. Roobubba

    Roobubba

    Joined:
    Nov 5, 2015
    Posts:
    29
    I just tried switching my compute-shader-driven raymarching game to vulkan (wanted to put a linux build out), and I found memory usage for buffers significantly higher for vulkan than dx11 - to the point where a large level that loads fine on my 4GB 980 causes an out of memory crash on vulkan. I got renderdoc captures from the first loading frame and the second frame (which is immediately before the crash on the vulkan build) and here are the summaries, showing far higher buffer memory allocation in vulkan.

    The texture memory usage is the same between dx11 and vulkan in this shot, with render textures actually slightly less in vulkan, but a whopping 1.2GB difference in the buffer memory allocation!

    DX11:
    Stats for LoadingScreenBeforeDX11NoCrash_00.rdc.

    File size: 138.91MB (604.88MB uncompressed, compression ratio 4.35:1)
    Persistent Data (approx): 2.81MB, Frame-initial data (approx): 463.91MB

    *** Summary ***

    Draw calls: 1678
    Dispatch calls: 0
    API calls: 13441
    Index/vertex bind calls: 3445
    Constant bind calls: 472
    Sampler bind calls: 142
    Resource bind calls: 994
    Shader set calls: 302
    Blend set calls: 65
    Depth/stencil set calls: 13
    Rasterization set calls: 1506
    Resource update calls: 3213
    Output set calls: 56
    API: Draw/Dispatch call ratio: 8.01013

    71 Textures - 131.96 MB (131.95 MB over 32x32), 44 RTs - 463.88 MB.
    Avg. tex dimension: 621.148x485.296 (922.353x768.941 over 32x32)
    109 Buffers - 5.93 MB total 0.78 MB IBs 5.14 MB VBs.
    601.76 MB - Grand total GPU buffer + texture load.

    -----------------------------------------------------------------

    Stats for LoadingScreenBeforeDX11NoCrash_01.rdc.

    File size: 151.12MB (3644.82MB uncompressed, compression ratio 24.12:1)
    Persistent Data (approx): 1016.14MB, Frame-initial data (approx): 463.91MB

    *** Summary ***

    Draw calls: 1670
    Dispatch calls: 1
    API calls: 13414
    Index/vertex bind calls: 3429
    Constant bind calls: 473
    Sampler bind calls: 142
    Resource bind calls: 1002
    Shader set calls: 303
    Blend set calls: 65
    Depth/stencil set calls: 13
    Rasterization set calls: 1502
    Resource update calls: 3208
    Output set calls: 60
    API: Draw/Dispatch call ratio: 8.02753

    71 Textures - 131.96 MB (131.95 MB over 32x32), 44 RTs - 463.88 MB.
    Avg. tex dimension: 621.148x485.296 (922.353x768.941 over 32x32)
    118 Buffers - 2032.54 MB total 0.78 MB IBs 5.14 MB VBs.
    2628.38 MB - Grand total GPU buffer + texture load.
    Vulkan:

    Stats for LoadingScreenBeforeCrash_00.rdc.

    File size: 134.66MB (550.46MB uncompressed, compression ratio 4.09:1)
    Persistent Data (approx): 14.77MB, Frame-initial data (approx): 535.01MB

    *** Summary ***

    Draw calls: 1642
    Dispatch calls: 0
    API calls: 4275
    API: Draw/Dispatch call ratio: 2.60353

    71 Textures - 131.95 MB (131.95 MB over 32x32), 45 RTs - 368.96 MB.
    Avg. tex dimension: 644.423x503.346 (922.353x768.941 over 32x32)
    87 Buffers - 16.79 MB total 4.66 MB IBs 8.14 MB VBs.
    517.70 MB - Grand total GPU buffer + texture load.

    -----------------------------------------------------------------

    Stats for LoadingScreenBeforeCrash_01.rdc.

    File size: 237.29MB (5793.46MB uncompressed, compression ratio 24.41:1)
    Persistent Data (approx): 4294.30MB, Frame-initial data (approx): 1498.47MB

    *** Summary ***

    Draw calls: 1658
    Dispatch calls: 1
    API calls: 4362
    API: Draw/Dispatch call ratio: 2.62929

    71 Textures - 131.95 MB (131.95 MB over 32x32), 45 RTs - 368.96 MB.
    Avg. tex dimension: 644.423x503.346 (922.353x768.941 over 32x32)
    99 Buffers - 3230.50 MB total 4.66 MB IBs 8.14 MB VBs.
    3731.41 MB - Grand total GPU buffer + texture load.
     
  5. Roobubba

    Roobubba

    Joined:
    Nov 5, 2015
    Posts:
    29
  6. lang_fox

    lang_fox

    Joined:
    May 19, 2014
    Posts:
    13
    We have the same problem.
     
  7. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
  8. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    144
    Same in 2022.2.5, Vulkan or DX12. Nothing has improved in 2 years and I'm still stuck with DX11.