radv: add radv_force_pstate_peak_gfx11_dgpu and enable it for Helldivers 2

This seems to definitely improve stability issues (random GPU hangs)
with Helldivers 2 on RDNA3 dGPUs. RDNA3 APUs and other generations
shouldn't be affected.

This is a workaround.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10584
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28260>
This commit is contained in:
Samuel Pitoiset
2024-02-28 16:53:36 +01:00
committed by Marge Bot
parent 99017891ca
commit 4d4b1820ca
5 changed files with 19 additions and 0 deletions
+6
View File
@@ -1067,6 +1067,12 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
if (result != VK_SUCCESS)
goto fail_cache;
if (device->physical_device->rad_info.gfx_level == GFX11 && device->physical_device->rad_info.has_dedicated_vram &&
device->instance->drirc.force_pstate_peak_gfx11_dgpu) {
if (!radv_device_acquire_performance_counters(device))
fprintf(stderr, "radv: failed to set pstate to profile_peak.\n");
}
*pDevice = radv_device_to_handle(device);
return VK_SUCCESS;
+4
View File
@@ -162,6 +162,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_RADV_FLUSH_BEFORE_TIMESTAMP_WRITE(false)
DRI_CONF_RADV_RT_WAVE64(false)
DRI_CONF_RADV_LEGACY_SPARSE_BINDING(false)
DRI_CONF_RADV_FORCE_PSTATE_PEAK_GFX11_DGPU(false)
DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(false)
DRI_CONF_RADV_OVERRIDE_GRAPHICS_SHADER_VERSION(0)
DRI_CONF_RADV_OVERRIDE_COMPUTE_SHADER_VERSION(0)
@@ -240,6 +241,9 @@ radv_init_dri_options(struct radv_instance *instance)
instance->drirc.legacy_sparse_binding = driQueryOptionb(&instance->drirc.options, "radv_legacy_sparse_binding");
instance->drirc.force_pstate_peak_gfx11_dgpu =
driQueryOptionb(&instance->drirc.options, "radv_force_pstate_peak_gfx11_dgpu");
instance->drirc.override_graphics_shader_version =
driQueryOptioni(&instance->drirc.options, "radv_override_graphics_shader_version");
instance->drirc.override_compute_shader_version =
+1
View File
@@ -419,6 +419,7 @@ struct radv_instance {
bool force_rt_wave64;
bool dual_color_blend_by_location;
bool legacy_sparse_binding;
bool force_pstate_peak_gfx11_dgpu;
bool clear_lds;
bool enable_dgc;
bool enable_khr_present_wait;
+4
View File
@@ -163,6 +163,10 @@ Application bugs worked around in this file:
<option name="radv_disable_ngg_gs" value="true" />
</application>
<application name="Helldivers 2" executable="helldivers2.exe">
<option name="radv_force_pstate_peak_gfx11_dgpu" value="true" />
</application>
<!-- OpenGL Game workarounds (zink) -->
<application name="Black Geyser: Couriers of Darkness" executable="BlackGeyser.x86_64">
<option name="radv_zero_vram" value="true" />
+4
View File
@@ -702,6 +702,10 @@
DRI_CONF_OPT_B(radv_legacy_sparse_binding, def, \
"Enable legacy sparse binding (with implicit synchronization) on the graphics and compute queue")
#define DRI_CONF_RADV_FORCE_PSTATE_PEAK_GFX11_DGPU(def) \
DRI_CONF_OPT_B(radv_force_pstate_peak_gfx11_dgpu, def, \
"Force the performance level to profile_peak (all clocks to the highest levels) for RDNA3 dGPUs")
/**
* Overrides for forcing re-compilation of pipelines when RADV_BUILD_ID_OVERRIDE is enabled.
* These need to be bumped every time a compiler bugfix is backported (up to 8 shader