Don't crash on available devices if we can't even create an instance.

This commit is contained in:
Adam Treat 2023-09-16 12:17:29 -04:00
parent 703ef9c125
commit 0631ea363c
2 changed files with 9 additions and 2 deletions

View file

@ -131,7 +131,7 @@ static std::string ggml_vk_getVendorName(uint32_t vendorID) {
std::vector<ggml_vk_device> ggml_vk_available_devices(size_t memoryRequired) {
std::vector<ggml_vk_device> results;
if (!komputeManager()->hasVulkan())
if (!komputeManager()->hasVulkan() || !komputeManager()->hasInstance())
return results;
std::vector<vk::PhysicalDevice> physicalDevices = komputeManager()->listDevices();