From 115108b3f10248b699eaeae874b5c98008b8ea20 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sat, 10 May 2025 20:57:31 +0800 Subject: [PATCH] GPU (Linux): detect core usage when libamdgpu is not available --- src/detection/gpu/gpu_linux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 560a3abf7..42dd18621 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -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; } }