diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index 47665e2f11c..1c8a850d822 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -1331,12 +1331,21 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info) info->wave64_vgpr_alloc_granularity = 4; } - if (info->family == CHIP_GFX1100 || info->family == CHIP_GFX1101) - info->num_physical_wave64_vgprs_per_simd = 768; - else if (info->gfx_level >= GFX10) + /* Some GPU info was broken before DRM 3.45.0. */ + if (info->drm_minor >= 45 && device_info.num_shader_visible_vgprs) { + /* The Gfx10 VGPR count is in Wave32, so divide it by 2 for Wave64. + * Gfx6-9 numbers are in Wave64. + */ + if (info->gfx_level >= GFX10) + info->num_physical_wave64_vgprs_per_simd = device_info.num_shader_visible_vgprs / 2; + else + info->num_physical_wave64_vgprs_per_simd = device_info.num_shader_visible_vgprs; + } else if (info->gfx_level >= GFX10) { info->num_physical_wave64_vgprs_per_simd = 512; - else + } else { info->num_physical_wave64_vgprs_per_simd = 256; + } + info->num_simd_per_compute_unit = info->gfx_level >= GFX10 ? 2 : 4; /* BIG_PAGE is supported since gfx10.3 and requires VRAM. VRAM is only guaranteed