Mesa (main): radv: remove the radv_report_apu_as_dgpu workaround for Red Dead Redemption 2

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 11 06:35:43 UTC 2022


Module: Mesa
Branch: main
Commit: 30846f15966ab7801963ea95025ba0a4aa1541f9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=30846f15966ab7801963ea95025ba0a4aa1541f9

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Jul  8 15:49:16 2022 +0200

radv: remove the radv_report_apu_as_dgpu workaround for Red Dead Redemption 2

This workaround looks actually broken. We added it in the past
because otherwise the game would just report 3GiB of video memory
(ie. size of GTT on SD). Though, with this workaround enabled, the
game explodes in memory easily.

One theory is that because we fake integrated GPUs as discrete GPUS,
and because we report 6GiB of VRAM (ie. driver redistributes memory
for small carveout), the game thinks there is 6GiB of VRAM only and
then keep allocating stuff.

People reported that the memory explosion is gone without this
workaround applied and I confirmed this myself.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17421>

---

 src/amd/vulkan/00-radv-defaults.conf | 4 ----
 src/amd/vulkan/radv_device.c         | 6 +-----
 src/amd/vulkan/radv_private.h        | 1 -
 src/util/driconf.h                   | 4 ----
 4 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/amd/vulkan/00-radv-defaults.conf b/src/amd/vulkan/00-radv-defaults.conf
index 10ea1af1874..a86c66871f3 100644
--- a/src/amd/vulkan/00-radv-defaults.conf
+++ b/src/amd/vulkan/00-radv-defaults.conf
@@ -118,10 +118,6 @@ Application bugs worked around in this file:
             <option name="radv_disable_dcc" value="true" />
         </application>
 
-        <application name="RDR2" application_name_match="Red Dead Redemption 2">
-            <option name="radv_report_apu_as_dgpu" value="true" />
-        </application>
-
         <application name="Resident Evil Village" application_name_match="re8.exe">
             <option name="radv_invariant_geom" value="true" />
         </application>
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 2080c76fb55..fe6752ff841 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -986,7 +986,6 @@ static const driOptionDescription radv_dri_options[] = {
       DRI_CONF_RADV_SPLIT_FMA(false)
       DRI_CONF_RADV_DISABLE_TC_COMPAT_HTILE_GENERAL(false)
       DRI_CONF_RADV_DISABLE_DCC(false)
-      DRI_CONF_RADV_REPORT_APU_AS_DGPU(false)
       DRI_CONF_RADV_REQUIRE_ETC2(false)
       DRI_CONF_RADV_DISABLE_ANISO_SINGLE_LEVEL(false)
       DRI_CONF_RADV_DISABLE_SINKING_LOAD_INPUT_FS(false)
@@ -1033,9 +1032,6 @@ radv_init_dri_options(struct radv_instance *instance)
    instance->zero_vram =
       driQueryOptionb(&instance->dri_options, "radv_zero_vram");
 
-   instance->report_apu_as_dgpu =
-      driQueryOptionb(&instance->dri_options, "radv_report_apu_as_dgpu");
-
    instance->disable_aniso_single_level =
       driQueryOptionb(&instance->dri_options, "radv_disable_aniso_single_level");
 
@@ -1961,7 +1957,7 @@ radv_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
 
    VkPhysicalDeviceType device_type;
 
-   if (pdevice->rad_info.has_dedicated_vram || pdevice->instance->report_apu_as_dgpu) {
+   if (pdevice->rad_info.has_dedicated_vram) {
       device_type = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU;
    } else {
       device_type = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 8afe9edbfda..95034773a75 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -364,7 +364,6 @@ struct radv_instance {
    bool disable_tc_compat_htile_in_general;
    bool disable_shrink_image_store;
    bool absolute_depth_bias;
-   bool report_apu_as_dgpu;
    bool disable_aniso_single_level;
    bool zero_vram;
    bool disable_sinking_load_input_fs;
diff --git a/src/util/driconf.h b/src/util/driconf.h
index ad4826abf8d..e5d15943b81 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -566,10 +566,6 @@
    DRI_CONF_OPT_B(radv_disable_dcc, def, \
                   "Disable DCC for color images")
 
-#define DRI_CONF_RADV_REPORT_APU_AS_DGPU(def) \
-   DRI_CONF_OPT_B(radv_report_apu_as_dgpu, def, \
-                  "Report APUs as discrete GPUs instead of integrated GPUs")
-
 #define DRI_CONF_RADV_REQUIRE_ETC2(def)                                        \
   DRI_CONF_OPT_B(radv_require_etc2, def,                                       \
                  "Implement emulated ETC2 on HW that does not support it")



More information about the mesa-commit mailing list