Using the Vulkan backend on dolphin-emu, I suddenly noticed that it was complaining that it couldn't initialize the Vulkan backend. I bisected to 6521d4a659b911bb86d979564de03665616a671e, which is the cause.
Actually, 90819abb56f6b1a0cd4946b13b6caf24fb46e500 ~ `radv: fix descriptor pool allocation size` is where the fun starts. It crashes dolphin-emu with "Failed to create Vulkan command buffers" It is 6521d4a659b911bb86d979564de03665616a671e that cause problems with dolphin-emu initializing Vulkan in the first place.
> It is 6521d4a659b911bb86d979564de03665616a671e that cause problems with dolphin-emu initializing Vulkan in the first place. Actually, no, ignore this...
So, when does the problem start exactly?
As soon as I click play for any of the games in dolphin-emu's game list, which is when it starts the renderer. I can provide a backtrace from dolphin-emu, if it helps any.
I meant what commit. Are you sure it's 90819abb56f6b1a0cd4946b13b6caf24fb46e500 ? That seems quite weird. Yes, please attach a backtrace.
Backtrace: https://paste.kde.org/pnt3dlvpx
Created attachment 141639 [details] [review] test Please try this patch. Does it abort?
Hi, I am just passing by. I have found the following piece of code in Dolphin source code [1]: VkDescriptorPoolCreateInfo pool_create_info = {VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, nullptr, 0, 100000, // tweak this static_cast<u32>(ArraySize(pool_sizes)), pool_sizes}; maxSets is being set to 100000, which might be the source of this problem. I like the comment next to it :) [1] https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp#L97
No change... :/
Is this potentially a dolphin-emu bug, then?
I ran dolphin-emu, and decided to log any errors (why didn't I think of this previously...): 43:00:797 VideoBackends/Vulkan/VulkanLoader.cpp:314 E[Video]: (CreateCommandBuffers) vkCreateDescriptorPool failed: (-1: VK_ERROR_OUT_OF_HOST_MEMORY) 43:00:797 Common/MsgHandler.cpp:92 E[MASTER]: Warning: Failed to create Vulkan command buffers
Created attachment 141640 [details] [review] possible fix Well, dolphin tries to allocate a TON of memory for one descriptor pool. It allocates 16262320 bytes for one set... And they are 100000. That explains the OOM error. The attached patch might help but this should be reported to the Dolphin guys because it's definitely too bad. Let me know if that helps.
Your patch doesn't help, unfortunately. Probably best if I report this bug to dolphin-emu, then.
Yeah, dolphin allocates too much memory. Anyway we should use a 64-bit unsigned integer. Closing.
It turns out it really was a problem on mesa side. I think we should change the resolution of the bug.
You are right, a revert of 90819abb56f6b1a0cd4946b13b6caf24fb46e500 has been pushed.
Can you explain why it was a bug in Mesa? Just trying to understand why the change broke things.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.