<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">Hi,</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I am in the process of trying to bring-up Vulkan based application on a new distro of linux based on Automotive Grade Linux (AGL) with Xserver running on a Raspberry Pi 4, but receiving memory based errors. I can run the applications and Vulkan demos on Raspbian
on the same hardware so I know this is purely a software issue. I believe I'm missing either a library, or some initialization/config. I'm using Yocto to build the distro and have it setup to compile mesa with native Vulkan support (-Dvulkan-drivers=broadcom)
<div><br>
</div>
<div>When I run my custom application I get this error:</div>
<div>memory wait for map failed</div>
<div>[2020.06.29-03.11.55:019][ 0]LogVulkanRHI: Error: VulkanRHI::vkCreateDescriptorPool(Device->GetInstanceHandle(), &PoolInfo, VULKAN_CPU_ALLOCATOR, &DescriptorPool) failed, VkResult=-2</div>
<div> at /home/ken/source/UnrealEngine/Engine/Source/Runtime/VulkanRHI/Private/VulkanPendingState.cpp:723
</div>
<div> with error VK_ERROR_OUT_OF_DEVICE_MEMORY</div>
<div>It throws VK_ERROR_OUT_OF_DEVICE_MEMORY which seems misleading because this is an 8GB Pi and the same application can run on Raspbian. The first line points me back to v3dv_bo.c:</div>
<div><br>
</div>
<div>v3dv_bo_map(struct v3dv_device *device, struct v3dv_bo *bo, uint32_t size)</div>
<div>{</div>
<div> assert(bo && size <= bo->size);</div>
<div><br>
</div>
<div> bool ok = v3dv_bo_map_unsynchronized(device, bo, size);</div>
<div> if (!ok)</div>
<div> return false;</div>
<div><br>
</div>
<div> const uint64_t infinite = 0xffffffffffffffffull;</div>
<div> ok = v3dv_bo_wait(device, bo, infinite);</div>
<div> if (!ok) {</div>
<div> fprintf(stderr, "memory wait for map failed\n"); // This is the line that prints, so the wait has failed?</div>
<div> return false;</div>
<div> }</div>
<div><br>
</div>
<div> return true;</div>
<div>}</div>
<div><br>
</div>
<div>What could be missing library or configuration-wise that would prevent the buffer object from succeeding?
</div>
<div><br>
</div>
<div>I'm trying the Vulkan demos in parallel and when I attempt to run vkcube, I get this error:</div>
<div># vkcube</div>
<div>Selected GPU 0: V3D 4.2, type: 1</div>
<div>memory wait for map failed</div>
<div>failed to map command list buffer</div>
<div>memory wait for map failed</div>
<div>failed to map command list buffer</div>
<div>memory wait for map failed</div>
<div>failed to map command list buffer</div>
<div>vkcube: /usr/src/debug/vulkan-tools/1.2.169.0-r0/git/cube/cube.c:1338: demo_prepare_buffers: Assertion `!err' failed.</div>
<div>Aborted</div>
<div><br>
</div>
<div>That line number points back to this in cube.c:</div>
<div> err = demo->fpCreateSwapchainKHR(demo->device, &swapchain_ci, NULL, &demo->swapchain);</div>
<div> assert(!err);</div>
<div>// note: fpCreateSwapchainKHR is a pointer to vkCreateSwapchainKHR</div>
<div><br>
</div>
<div>So this issue appears to be with creating the swapchain. Swapchain as an extension appears to be included/enabled:</div>
<div>Device Extensions: count = 6</div>
<div>----------------------------</div>
<div>...</div>
<div> VK_KHR_swapchain : extension revision 68</div>
<div> </div>
<div><br>
</div>
<div><br>
</div>
<div>I initially followed this tutorial for the testing applications on Raspbian:</div>
<div>https://github.com/rdeioris/UnrealOnRPI4</div>
<div>And I believe I pulled all the requirements/dependencies (libdrm, libxcb, etc) from that tutorial into my new AGL distro and their versions match or exceed those in Raspbian.
</div>
<div><br>
</div>
<div><br>
</div>
<div>From vulkaninfo:</div>
<div># vulkaninfo </div>
<div>==========</div>
<div>VULKANINFO</div>
<div>==========</div>
<div>Vulkan Instance Version: 1.2.168</div>
<div>Instance Extensions: count = 9</div>
<div>==============================</div>
<div> VK_EXT_debug_report : extension revision 9</div>
<div> VK_EXT_debug_utils : extension revision 2</div>
<div> VK_KHR_display : extension revision 23</div>
<div> VK_KHR_external_memory_capabilities : extension revision 1</div>
<div> VK_KHR_get_physical_device_properties2 : extension revision 1</div>
<div> VK_KHR_get_surface_capabilities2 : extension revision 1</div>
<div> VK_KHR_surface : extension revision 25</div>
<div> VK_KHR_xcb_surface : extension revision 6</div>
<div> VK_KHR_xlib_surface : extension revision 6</div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Regards,</div>
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">Ken Snyder</span><br>
</div>
</body>
</html>