From 1d6b33bf76af503f4b782913b75c0ac49d46f34b Mon Sep 17 00:00:00 2001 From: CCob Date: Fri, 17 Apr 2020 09:41:42 +0100 Subject: [PATCH] Fix issue where platform can return no devices OpenCL platforms can exist without any devices, continue to next platform instead of erroring --- worker/opencl_info.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/worker/opencl_info.go b/worker/opencl_info.go index 7731109..32134b5 100644 --- a/worker/opencl_info.go +++ b/worker/opencl_info.go @@ -20,6 +20,9 @@ func GetAvailableDevices() (shared.DeviceMap, error) { for _, platform := range platforms { devices, err := platform.GetDevices(opencl.DeviceTypeAll) if err != nil { + if err == opencl.ErrDeviceNotFound { + continue + } return nil, err } @@ -39,5 +42,9 @@ func GetAvailableDevices() (shared.DeviceMap, error) { } } + if len(devs) == 0 { + return nil, opencl.ErrDeviceNotFound + } + return devs, nil }