Skip to content

Commit 9ba30ad

Browse files
committed
GPU (Windows): add driver version fall back
1 parent 010b2c6 commit 9ba30ad

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/detection/gpu/gpu_windows.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
154154
else if (ffStrbufContainS(&gpu->vendor, "AMD") || ffStrbufContainS(&gpu->vendor, "ATI"))
155155
ffStrbufSetStatic(&gpu->vendor, FF_GPU_VENDOR_NAME_AMD);
156156
}
157+
if (gpu->driver.length == 0)
158+
ffRegReadStrbuf(hRegDriverKey, L"DriverVersion", &gpu->driver, NULL);
159+
if (gpu->dedicated.total == FF_GPU_VMEM_SIZE_UNSET)
160+
{
161+
if (!ffRegReadUint64(hRegDriverKey, L"HardwareInformation.qwMemorySize", &gpu->dedicated.total, NULL))
162+
{
163+
uint32_t memorySize = 0;
164+
if (ffRegReadUint(hRegDriverKey, L"HardwareInformation.MemorySize", &memorySize, NULL))
165+
gpu->dedicated.total = memorySize;
166+
}
167+
}
157168
}
158169
}
159170
}

0 commit comments

Comments
 (0)