Skip to content

Commit

Permalink
kompute : ignore exceptions in ggml_vk_available_devices (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Van Bortel <[email protected]>
  • Loading branch information
cebtenzzre committed Jan 24, 2024
1 parent cad72e1 commit 76474a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ggml-kompute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,15 @@ std::vector<ggml_vk_device> ggml_vk_available_devices(size_t memoryRequired) {
if (!komputeManager()->hasVulkan() || !komputeManager()->hasInstance())
return results;

std::vector<vk::PhysicalDevice> physicalDevices = komputeManager()->listDevices();
uint32_t deviceCount = physicalDevices.size();
std::vector<vk::PhysicalDevice> physicalDevices;
try {
physicalDevices = komputeManager()->listDevices();
} catch (vk::SystemError & err) {
std::cerr << __func__ << ": ignoring Vulkan exception: " << err.what() << "\n";
return results;
}

uint32_t deviceCount = physicalDevices.size();
if (deviceCount == 0)
return results;

Expand Down

0 comments on commit 76474a7

Please sign in to comment.