Skip to content

anv: Use vma_heap for descriptor pool host allocations

Pre-patch, anv_descriptor_pool used a free list for host allocations that never merged adjacent free blocks. If the pool only allocated fixed-sized blocks, then this would not be a problem. But the pool allocations are variable-sized, and this caused over half of the pool's memory to be consumed by unusable free blocks in some workloads.

Replacing the free list with util_vma_heap, which does merge adjacent free blocks, fixes the memory explosion in the target workload.

Tested with a ChromeOS internal TensorFlow benchmark, provided by package 'tensorflow', running with its OpenCL backend on clvk.

  cmdline: benchmark_model --graph=mn2.tflite --use_gpu=true --min_secs=60
  gpu: adl
  memory footprint from start of benchmark:
    before: init=132.691MB max=227.684MB
    after:  init=134.988MB max=134.988MB

Reported-by: Romaric Jodin rjodin@google.com

Edited by Lina Versace

Merge request reports