From a326f0884d50f2c8c2143e4c4f17146e47643cea Mon Sep 17 00:00:00 2001 From: Michael Vigovsky Date: Thu, 17 Oct 2024 17:13:48 +0300 Subject: [PATCH] Add Vulkan device validation to Net::load_param_bin --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 36958b59b0e..32b5b2abd60 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1677,7 +1677,7 @@ int Net::load_param_bin(const DataReader& dr) if (opt.use_vulkan_compute) { if (!d->vkdev) d->vkdev = get_gpu_device(); - if (!d->vkdev) opt.use_vulkan_compute = false; // no vulkan device, fallback to cpu + if (!d->vkdev || !d->vkdev->is_valid()) opt.use_vulkan_compute = false; // no valid vulkan device, fallback to cpu } if (opt.use_vulkan_compute) {