From 5ec87b6b2f6309ddd7685e52dec19789b592d8a8 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Sat, 3 Aug 2024 16:19:58 -0300 Subject: [PATCH] Fix: On Linux this was returning VK_INCOMPLETE because it had 2 GPUs so the assert failed --- source/backend/vulkan/component/VulkanDevice.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/backend/vulkan/component/VulkanDevice.cpp b/source/backend/vulkan/component/VulkanDevice.cpp index 6fdf965d8..79175277a 100644 --- a/source/backend/vulkan/component/VulkanDevice.cpp +++ b/source/backend/vulkan/component/VulkanDevice.cpp @@ -25,9 +25,8 @@ VulkanDevice::VulkanDevice(std::shared_ptr instance, const std:: uint32_t gpuCount = 0; CALL_VK(mInstance->enumeratePhysicalDevices(gpuCount, nullptr)); MNN_ASSERT(0 != gpuCount); - VkPhysicalDevice tmpGpus[1] = {nullptr}; - gpuCount = 1; - CALL_VK(mInstance->enumeratePhysicalDevices(gpuCount, tmpGpus)); + std::vector tmpGpus(gpuCount); + CALL_VK(mInstance->enumeratePhysicalDevices(gpuCount, tmpGpus.data())); MNN_ASSERT(nullptr != tmpGpus[0]); mPhysicalDevice = tmpGpus[0];