GPU: fix clock frequency detection and overall tidy

This commit is contained in:
李通洲
2023-12-20 19:09:18 +08:00
committed by 李通洲
parent b2236cc046
commit adc506d2b3
9 changed files with 29 additions and 22 deletions
+5 -1
View File
@@ -100,7 +100,11 @@ const char* ffDetectNvidiaGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverR
nvmlData.ffnvmlDeviceGetNumGpuCores(device, result.coreCount);
if (result.frequency)
nvmlData.ffnvmlDeviceGetClockInfo(device, NVML_CLOCK_GRAPHICS, result.frequency);
{
uint32_t clockMHz;
if (nvmlData.ffnvmlDeviceGetClockInfo(device, NVML_CLOCK_GRAPHICS, &clockMHz) == NVML_SUCCESS)
*result.frequency = clockMHz / 1000.;
}
return NULL;
}