google / google/filament

[vulkan] non-uniform UMA platforms run out of memory

Open
#9,333 12 comments 1 reaction 2 assignees Claimed by @phoenixxxx View on GitHub
linux vulkan
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 14h
Merged PRs (30d)
83

Description

**Describe the bug**
Mesa Vulkan GPU drivers that use non-uniform UMA run out of memory prematurely. It appears that vkmemalloc only sees 8MB of available memory for these platforms. Failures show up differently depending on the GPU stack:

* ARM Mali (Mesa panthor) - segfault
* RaspberryPi5 - `MESA: error: Failed to allocate device memory for BO`

The solution requires moving `vkmemalloc` to v3.1.0+.

**To Reproduce**
(On RaspberryPi5)
Steps to reproduce the behavior:
1. git clone https://github.com/meta-flutter/workspace-automation.git
2. cd workspace-automation
3. ./flutter_workspace.py --enable=filament
4. source ./setup_env.sh
5. cd app/tcna-packages/packages/filament_scene/example/
6. flutter run -d desktop-homescreen

**Expected behavior**
Use all available memory on platform.

**Logs**
```
MESA: error: Failed to allocate device memory for BO
Postcondition
in VulkanTexture:416
reason: Unable to allocate image memory. error=-2
```

**Desktop (please complete the following information):**
- OS: Linux
- GPU: V3D 7.1.7.0
- Backend: Vulkan

**Additional context**
```
VkPhysicalDeviceMemoryProperties:
=================================
memoryHeaps: count = 1
memoryHeaps[0]:
size = 2087280640 (0x7c696000) (1.94 GiB)
budget = 2087280640 (0x7c696000) (1.94 GiB)
usage = 0 (0x00000000) (0.00 B)
flags: count = 1
MEMORY_HEAP_DEVICE_LOCAL_BIT
memoryTypes: count = 1
memoryTypes[0]:
heapIndex = 0
propertyFlags = 0x0007: count = 3
MEMORY_PROPERTY_DEVICE_LOCAL_BIT
MEMORY_PROPERTY_HOST_VISIBLE_BIT
MEMORY_PROPERTY_HOST_COHERENT_BIT
usable for:
IMAGE_TILING_OPTIMAL:
color images
FORMAT_D16_UNORM
FORMAT_X8_D24_UNORM_PACK32
FORMAT_D32_SFLOAT
FORMAT_D24_UNORM_S8_UINT
(non-sparse)
IMAGE_TILING_LINEAR:
color images
(non-sparse)
```
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/362
https://github.com/dolphin-emu/dolphin/pull/12875

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.