Skip to content

Commit 115108b

Browse files
committed
GPU (Linux): detect core usage when libamdgpu is not available
1 parent 154f9f4 commit 115108b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/detection/gpu/gpu_linux.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ static void pciDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu,
253253
gpu->shared.used = value;
254254
}
255255
}
256+
257+
ffStrbufSubstrBefore(pciDir, pciDirLen);
258+
ffStrbufAppendS(pciDir, "/gpu_busy_percent");
259+
if (ffReadFileBuffer(pciDir->chars, buffer) && (value = ffStrbufToUInt(buffer, 0)))
260+
gpu->coreUsage = (double) value;
256261
}
257262
}
258263

0 commit comments

Comments
 (0)