GPU (Linux): detect core usage when libamdgpu is not available

This commit is contained in:
Carter Li
2025-05-10 20:57:31 +08:00
parent 154f9f462b
commit 115108b3f1
+5
View File
@@ -253,6 +253,11 @@ static void pciDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu,
gpu->shared.used = value;
}
}
ffStrbufSubstrBefore(pciDir, pciDirLen);
ffStrbufAppendS(pciDir, "/gpu_busy_percent");
if (ffReadFileBuffer(pciDir->chars, buffer) && (value = ffStrbufToUInt(buffer, 0)))
gpu->coreUsage = (double) value;
}
}