@@ -50,12 +50,20 @@ const char* ffDrmDetectRadeon(const FFGPUOptions* options, FFGPUResult* gpu, con
50
50
if (ioctl (fd , DRM_IOCTL_RADEON_GEM_INFO , & gemInfo ) >= 0 && gemInfo .vram_visible > 0 )
51
51
{
52
52
gpu -> dedicated .total = gemInfo .vram_visible ;
53
+ gpu -> shared .total = gemInfo .gart_size ;
54
+
53
55
uint64_t memSize ;
54
56
if (ioctl (fd , DRM_IOCTL_RADEON_INFO , & (struct drm_radeon_info ) {
55
57
.request = RADEON_INFO_VRAM_USAGE , // uint64_t
56
58
.value = (uintptr_t ) & memSize ,
57
59
}) >= 0 )
58
60
gpu -> dedicated .used = memSize ;
61
+
62
+ if (ioctl (fd , DRM_IOCTL_RADEON_INFO , & (struct drm_radeon_info ) {
63
+ .request = RADEON_INFO_GTT_USAGE , // uint64_t
64
+ .value = (uintptr_t ) & memSize ,
65
+ }) >= 0 )
66
+ gpu -> shared .used = memSize ;
59
67
}
60
68
}
61
69
@@ -126,16 +134,13 @@ const char* ffDrmDetectAmdgpu(const FFGPUOptions* options, FFGPUResult* gpu, con
126
134
struct amdgpu_heap_info heapInfo ;
127
135
if (ffamdgpu_query_heap_info (handle , AMDGPU_GEM_DOMAIN_VRAM , 0 , & heapInfo ) >= 0 )
128
136
{
129
- if (gpu -> type == FF_GPU_TYPE_DISCRETE )
130
- {
131
- gpu -> dedicated .total = heapInfo .heap_size ;
132
- gpu -> dedicated .used = heapInfo .heap_usage ;
133
- }
134
- else
135
- {
136
- gpu -> shared .total = heapInfo .heap_size ;
137
- gpu -> shared .used = heapInfo .heap_usage ;
138
- }
137
+ gpu -> dedicated .total = heapInfo .heap_size ;
138
+ gpu -> dedicated .used = heapInfo .heap_usage ;
139
+ }
140
+ if (ffamdgpu_query_heap_info (handle , AMDGPU_GEM_DOMAIN_GTT , 0 , & heapInfo ) >= 0 )
141
+ {
142
+ gpu -> shared .total = heapInfo .heap_size ;
143
+ gpu -> shared .used = heapInfo .heap_usage ;
139
144
}
140
145
}
141
146
0 commit comments