From a94edf52e28ce6309b1e046a0fa10ebceeda7b48 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Mon, 16 Feb 2026 21:54:48 +0100 Subject: [PATCH] Don't abort if Vulkan is not available --- dashboard/qml/Main.qml | 2 +- dashboard/vulkan_info.cpp | 19 +++++++++++++------ dashboard/vulkan_info.h | 5 +++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/dashboard/qml/Main.qml b/dashboard/qml/Main.qml index 41d579a8..3b1b7612 100644 --- a/dashboard/qml/Main.qml +++ b/dashboard/qml/Main.qml @@ -193,7 +193,7 @@ Kirigami.ApplicationWindow { text: Settings.flatpak ? i18n("Vulkan drivers cannot be found, you may need to run \"flatpak update\"") : i18n("Vulkan drivers cannot be found") type: Kirigami.MessageType.Warning showCloseButton: true - visible: DashboardSettings.show_system_checks && VulkanInfo.type == VulkanInfo.SoftGPU + visible: DashboardSettings.show_system_checks && (VulkanInfo.type == VulkanInfo.SoftGPU || VulkanInfo.type == VulkanInfo.NoGPU) } Kirigami.InlineMessage { diff --git a/dashboard/vulkan_info.cpp b/dashboard/vulkan_info.cpp index 16a85636..ca2ec45f 100644 --- a/dashboard/vulkan_info.cpp +++ b/dashboard/vulkan_info.cpp @@ -24,14 +24,21 @@ vulkan_info::vulkan_info() { - vk::raii::Context context; + try + { + vk::raii::Context context; - vk::ApplicationInfo app_info{"WiVRn dashboard", 1, "No engine", 1, VK_API_VERSION_1_1}; - vk::InstanceCreateInfo instance_info{vk::InstanceCreateFlags{0}, &app_info}; - vk::raii::Instance vulkan{context, instance_info}; + vk::ApplicationInfo app_info{"WiVRn dashboard", 1, "No engine", 1, VK_API_VERSION_1_1}; + vk::InstanceCreateInfo instance_info{vk::InstanceCreateFlags{0}, &app_info}; + vk::raii::Instance vulkan{context, instance_info}; - auto devices = vulkan.enumeratePhysicalDevices(); - set_info(choose_device(devices)); + auto devices = vulkan.enumeratePhysicalDevices(); + set_info(choose_device(devices)); + } + catch (std::runtime_error & e) + { + qCritical() << "Failed to get vulkan info: " << e.what(); + } } static vulkan_info::gpu_type cast_type(vk::PhysicalDeviceType type) diff --git a/dashboard/vulkan_info.h b/dashboard/vulkan_info.h index 97b3f3a5..271c5420 100644 --- a/dashboard/vulkan_info.h +++ b/dashboard/vulkan_info.h @@ -41,6 +41,7 @@ public: SoftGPU, VirtGPU, OtherGPU, + NoGPU, }; Q_ENUM(gpu_type) @@ -51,8 +52,8 @@ public: QString m_driverId; QString m_driverVersion; - uint32_t m_driverVersionCode; - gpu_type m_type; + uint32_t m_driverVersionCode{}; + gpu_type m_type = NoGPU; vk::raii::PhysicalDevice & choose_device(std::vector & devices); void set_info(vk::raii::PhysicalDevice & device);