From 68fd21d0e460e5ae12f2a7097ec13d2f8c2a64de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 19 Jun 2025 22:00:48 +0800 Subject: [PATCH] GPU (Linux): fix an issue which vram_usage is bigger t han vram_visible --- src/detection/gpu/gpu_drm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/detection/gpu/gpu_drm.c b/src/detection/gpu/gpu_drm.c index f03d393ae..34a2e2ae9 100644 --- a/src/detection/gpu/gpu_drm.c +++ b/src/detection/gpu/gpu_drm.c @@ -47,9 +47,10 @@ const char* ffDrmDetectRadeon(const FFGPUOptions* options, FFGPUResult* gpu, con if (options->driverSpecific) { struct drm_radeon_gem_info gemInfo; - if (ioctl(fd, DRM_IOCTL_RADEON_GEM_INFO, &gemInfo) >= 0 && gemInfo.vram_visible > 0) + if (ioctl(fd, DRM_IOCTL_RADEON_GEM_INFO, &gemInfo) >= 0) { - gpu->dedicated.total = gemInfo.vram_visible; + // vram_usage can be bigger than vram_usage, so we use vram_size here + gpu->dedicated.total = gemInfo.vram_size; gpu->shared.total = gemInfo.gart_size; uint64_t memSize;