From 8a338675c67b8a7f3c4a8bca272b3b89850c6fd4 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 14 Feb 2024 16:54:50 +0000 Subject: [PATCH] radv: enable GS_FAST_LAUNCH=2 by default for RDNA3 APUs (Phoenix) GS_FAST_LAUNCH=1 shouldn't be used on GFX11 but it's still needed for dGPUs (eg. NAVI31) because it destroys performance for unknown reasons. On RDNA3 APUs, GS_FAST_LAUNCH=2 seems to be required for working mesh shaders and performance is fine. There is possibly a firmware bug on APUs that would explain why GS_FAST_LAUNCH=1 doesn't work on Phoenix. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10583 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10397 Cc: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: (cherry picked from commit 6894692d270f7c49b1e4cb2d15dad94de4e3acb0) --- .pick_status.json | 2 +- docs/envvars.rst | 2 +- src/amd/vulkan/radv_device.c | 13 +++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index fe559b8cc70..deec463d46f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3094,7 +3094,7 @@ "description": "radv: enable GS_FAST_LAUNCH=2 by default for RDNA3 APUs (Phoenix)", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/docs/envvars.rst b/docs/envvars.rst index 300f2cd40e1..a6af0532467 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -1357,7 +1357,7 @@ RADV driver environment variables ``video_decode`` enable experimental video decoding support ``gsfastlaunch2`` - use GS_FAST_LAUNCH=2 for Mesh shaders (GFX11+) + use GS_FAST_LAUNCH=2 for Mesh shaders (GFX11+ dGPUs only) .. envvar:: RADV_TEX_ANISO diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 261cf4f6856..61dd5ebc791 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1001,8 +1001,17 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr device->pbb_allowed = device->physical_device->rad_info.gfx_level >= GFX9 && !(device->instance->debug_flags & RADV_DEBUG_NOBINNING); - device->mesh_fast_launch_2 = (device->instance->perftest_flags & RADV_PERFTEST_GS_FAST_LAUNCH_2) && - device->physical_device->rad_info.gfx_level >= GFX11; + /* GS_FAST_LAUNCH=2 mode is supposed to be used on GFX11 but it turns + * out it has severe impact on performance for unknown reasons (tested on + * NAVI31 dGPU). It's disabled by default. + * + * On RDNA3 APUs (Phoenix) it turns GS_FAST_LAUNCH=1 doesn't work at all, + * and using mode2 fixes everything without any performance impact. + */ + device->mesh_fast_launch_2 = ((device->instance->perftest_flags & RADV_PERFTEST_GS_FAST_LAUNCH_2) && + device->physical_device->rad_info.gfx_level >= GFX11) || + device->physical_device->rad_info.family == CHIP_GFX1103_R1 || + device->physical_device->rad_info.family == CHIP_GFX1103_R2; device->disable_trunc_coord = device->instance->drirc.disable_trunc_coord;