Skip to content

Commit e0ae1ac

Browse files
committed
GPU (Intel): adds comments
1 parent e0d141e commit e0ae1ac

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/detection/gpu/gpu_intel.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,18 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe
6666
}
6767

6868
uint32_t deviceCount = 0;
69-
if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, NULL)) {
69+
// ctlEnumerateDevices MUST be called with deviceCount = 0 and devices = NULL first,
70+
// otherwise it will be silently ignored and return CTL_RESULT_SUCCESS with deviceCount and devices unmodified.
71+
// VERY STRANGE BEHAVIOR
72+
if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, NULL) != CTL_RESULT_SUCCESS) {
7073
return "ctlEnumerateDevices(NULL) failed";
7174
}
7275
if (deviceCount == 0) {
7376
return "No Intel graphics adapter found";
7477
}
7578

7679
FF_AUTO_FREE ctl_device_adapter_handle_t* devices = malloc(deviceCount * sizeof(*devices));
77-
if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, devices)) {
80+
if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, devices) != CTL_RESULT_SUCCESS) {
7881
return "ctlEnumerateDevices(devices) failed";
7982
}
8083

0 commit comments

Comments
 (0)