diff options
author | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2020-09-23 03:04:27 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-02-23 09:47:01 -0800 |
commit | 4889cd7345ecbea4703ff15bd8b9409ae816f93c (patch) | |
tree | d2a1b2d274430bbffec111df71ae286d26491fc2 | |
parent | 3ef16ec38b783fd59f4e6f320ac21c738e641c84 (diff) |
radv: Improve spilling on discrete GPUs.
The linked bug gets better performance and I personally verified
better spilling performance on HZD so let us make this step for now.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3183
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3698
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6833>
(cherry picked from commit 862b6a9a97ad9c47c14dbc76ea892293573c746f)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index 6d72b40c17e..16eab5abd73 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -8815,7 +8815,7 @@ "description": "radv: Improve spilling on discrete GPUs.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c index 7685c88274d..4f32783692e 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c @@ -406,9 +406,17 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws, * GTT(RAM) usage, which is shared with the OS, allow VRAM * placements too. The idea is not to use VRAM usefully, but * to use it so that it's not unused and wasted. + * + * Furthermore, even on discrete GPUs this is beneficial. If + * both GTT and VRAM are set then AMDGPU still prefers VRAM + * for the initial placement, but it makes the buffers + * spillable. Otherwise AMDGPU tries to place the buffers in + * VRAM really hard to the extent that we are getting a lot + * of unnecessary movement. This helps significantly when + * e.g. Horizon Zero Dawn allocates more memory than we have + * VRAM. */ - if (!ws->info.has_dedicated_vram) - request.preferred_heap |= AMDGPU_GEM_DOMAIN_GTT; + request.preferred_heap |= AMDGPU_GEM_DOMAIN_GTT; } if (initial_domain & RADEON_DOMAIN_GTT) |