From e0ae1ac1a234bc9f6b4bc53e32703c03d77a78f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 27 Jun 2026 09:15:39 +0800 Subject: [PATCH] GPU (Intel): adds comments --- src/detection/gpu/gpu_intel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/detection/gpu/gpu_intel.c b/src/detection/gpu/gpu_intel.c index 474f79839..04025b36c 100644 --- a/src/detection/gpu/gpu_intel.c +++ b/src/detection/gpu/gpu_intel.c @@ -66,7 +66,10 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe } uint32_t deviceCount = 0; - if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, NULL)) { + // ctlEnumerateDevices MUST be called with deviceCount = 0 and devices = NULL first, + // otherwise it will be silently ignored and return CTL_RESULT_SUCCESS with deviceCount and devices unmodified. + // VERY STRANGE BEHAVIOR + if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, NULL) != CTL_RESULT_SUCCESS) { return "ctlEnumerateDevices(NULL) failed"; } if (deviceCount == 0) { @@ -74,7 +77,7 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe } FF_AUTO_FREE ctl_device_adapter_handle_t* devices = malloc(deviceCount * sizeof(*devices)); - if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, devices)) { + if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, devices) != CTL_RESULT_SUCCESS) { return "ctlEnumerateDevices(devices) failed"; }