File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -4621,6 +4621,29 @@ static void ggml_vk_instance_init() {
46214621 }
46224622 }
46234623
4624+ // Remove any unsupported devices
4625+ size_t num_unsupported = 0;
4626+ for (size_t i = 0; i < vk_instance.device_indices.size();) {
4627+ vk::PhysicalDevice vkdev = devices[vk_instance.device_indices[i]];
4628+
4629+ VkPhysicalDeviceFeatures2 device_features2;
4630+ device_features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
4631+
4632+ VkPhysicalDeviceVulkan11Features vk11_features;
4633+ vk11_features.pNext = nullptr;
4634+ vk11_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
4635+ device_features2.pNext = &vk11_features;
4636+
4637+ vkGetPhysicalDeviceFeatures2(vkdev, &device_features2);
4638+ if (!vk11_features.storageBuffer16BitAccess) {
4639+ vk_instance.device_indices.erase(vk_instance.device_indices.begin() + i);
4640+ num_unsupported++;
4641+ } else
4642+ i++;
4643+ }
4644+ if (num_unsupported > 0)
4645+ GGML_LOG_DEBUG("ggml_vulkan: Removed %zu unsupported Vulkan devices.\n", vk_instance.device_indices.size());
4646+
46244647 if (vk_instance.device_indices.empty()) {
46254648 GGML_LOG_INFO("ggml_vulkan: No devices found.\n");
46264649 return;
You can’t perform that action at this time.
0 commit comments