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

This commit is contained in:
Carter Li committed 2025-05-10 20:57:51 +08:00
1 parent 154f9f462b
commit 115108b3f1
1 file changed
+5
+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;
}
}