mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 00:30:11 +01:00
radv: enable the global BO list by default
vkd3d-proton (DX12) and Zink (GL) have always been enabling features that require the global BO list to be enabled. Since DXVK 2.7+ (August 2025), it's also always enabled by default for DX9-11 games (because it requires BDA now). The global BO list used to decrease performance in the past mostly because of bad memory management in AMDGPU, but it seems the situation slightly improved since. Though, there might still some workloads that hit the issue, but I think it should be mostly good overall. This introduces RADV_DEBUG=nobolist to disable the global BO list when no features require it. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6957 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2331 Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35075>
This commit is contained in:
parent
df269714ef
commit
26c7f2fd6a
5 changed files with 44 additions and 38 deletions
|
|
@ -1422,6 +1422,8 @@ RADV driver environment variables
|
|||
disable dithering for alpha to coverage
|
||||
``nobinning``
|
||||
disable primitive binning
|
||||
``nobolist``
|
||||
disable the global BO list when no features require it
|
||||
``nocache``
|
||||
disable shaders cache
|
||||
``nocompute``
|
||||
|
|
@ -1536,8 +1538,6 @@ RADV driver environment variables
|
|||
|
||||
a comma-separated list of named flags, which do various things:
|
||||
|
||||
``bolist``
|
||||
enable the global BO list
|
||||
``cswave32``
|
||||
enable wave32 for compute shaders (GFX10+)
|
||||
``dccmsaa``
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ enum {
|
|||
RADV_DEBUG_NO_VIDEO = 1ull << 60,
|
||||
RADV_DEBUG_VALIDATE_VAS = 1ull << 61,
|
||||
RADV_DEBUG_DUMP_BO_HISTORY = 1ull << 62,
|
||||
RADV_DEBUG_NO_BO_LIST = 1ull << 63,
|
||||
RADV_DEBUG_DUMP_SHADERS = RADV_DEBUG_DUMP_VS | RADV_DEBUG_DUMP_TCS | RADV_DEBUG_DUMP_TES | RADV_DEBUG_DUMP_GS |
|
||||
RADV_DEBUG_DUMP_PS | RADV_DEBUG_DUMP_TASK | RADV_DEBUG_DUMP_MESH | RADV_DEBUG_DUMP_CS |
|
||||
RADV_DEBUG_DUMP_NIR | RADV_DEBUG_DUMP_ASM | RADV_DEBUG_DUMP_BACKEND_IR,
|
||||
|
|
@ -83,23 +84,22 @@ enum {
|
|||
enum {
|
||||
RADV_PERFTEST_LOCAL_BOS = 1u << 0,
|
||||
RADV_PERFTEST_DCC_MSAA = 1u << 1,
|
||||
RADV_PERFTEST_BO_LIST = 1u << 2,
|
||||
RADV_PERFTEST_CS_WAVE_32 = 1u << 3,
|
||||
RADV_PERFTEST_PS_WAVE_32 = 1u << 4,
|
||||
RADV_PERFTEST_GE_WAVE_32 = 1u << 5,
|
||||
RADV_PERFTEST_NO_SAM = 1u << 6,
|
||||
RADV_PERFTEST_SAM = 1u << 7,
|
||||
RADV_PERFTEST_NGGC = 1u << 8,
|
||||
RADV_PERFTEST_EMULATE_RT = 1u << 9,
|
||||
RADV_PERFTEST_RT_WAVE_64 = 1u << 10,
|
||||
RADV_PERFTEST_VIDEO_DECODE = 1u << 11,
|
||||
RADV_PERFTEST_DMA_SHADERS = 1u << 12,
|
||||
RADV_PERFTEST_TRANSFER_QUEUE = 1u << 13,
|
||||
RADV_PERFTEST_NIR_CACHE = 1u << 14,
|
||||
RADV_PERFTEST_RT_WAVE_32 = 1u << 15,
|
||||
RADV_PERFTEST_VIDEO_ENCODE = 1u << 16,
|
||||
RADV_PERFTEST_NO_GTT_SPILL = 1u << 17,
|
||||
RADV_PERFTEST_HIC = 1u << 18,
|
||||
RADV_PERFTEST_CS_WAVE_32 = 1u << 2,
|
||||
RADV_PERFTEST_PS_WAVE_32 = 1u << 3,
|
||||
RADV_PERFTEST_GE_WAVE_32 = 1u << 4,
|
||||
RADV_PERFTEST_NO_SAM = 1u << 5,
|
||||
RADV_PERFTEST_SAM = 1u << 6,
|
||||
RADV_PERFTEST_NGGC = 1u << 7,
|
||||
RADV_PERFTEST_EMULATE_RT = 1u << 8,
|
||||
RADV_PERFTEST_RT_WAVE_64 = 1u << 9,
|
||||
RADV_PERFTEST_VIDEO_DECODE = 1u << 10,
|
||||
RADV_PERFTEST_DMA_SHADERS = 1u << 11,
|
||||
RADV_PERFTEST_TRANSFER_QUEUE = 1u << 12,
|
||||
RADV_PERFTEST_NIR_CACHE = 1u << 13,
|
||||
RADV_PERFTEST_RT_WAVE_32 = 1u << 14,
|
||||
RADV_PERFTEST_VIDEO_ENCODE = 1u << 15,
|
||||
RADV_PERFTEST_NO_GTT_SPILL = 1u << 16,
|
||||
RADV_PERFTEST_HIC = 1u << 17,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
|||
|
|
@ -1197,20 +1197,26 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
|
|||
device->vk.sync = device->ws->get_sync_provider(device->ws);
|
||||
device->vk.copy_sync_payloads = pdev->ws->copy_sync_payloads;
|
||||
|
||||
/* With update after bind we can't attach bo's to the command buffer
|
||||
* from the descriptor set anymore, so we have to use a global BO list.
|
||||
*/
|
||||
device->use_global_bo_list = (instance->perftest_flags & RADV_PERFTEST_BO_LIST) ||
|
||||
device->vk.enabled_features.bufferDeviceAddress ||
|
||||
device->vk.enabled_features.descriptorIndexing ||
|
||||
device->vk.enabled_features.descriptorBindingUniformBufferUpdateAfterBind ||
|
||||
device->vk.enabled_features.descriptorBindingSampledImageUpdateAfterBind ||
|
||||
device->vk.enabled_features.descriptorBindingStorageImageUpdateAfterBind ||
|
||||
device->vk.enabled_features.descriptorBindingStorageBufferUpdateAfterBind ||
|
||||
device->vk.enabled_features.descriptorBindingUniformTexelBufferUpdateAfterBind ||
|
||||
device->vk.enabled_features.descriptorBindingStorageTexelBufferUpdateAfterBind ||
|
||||
device->vk.enabled_features.descriptorBindingUpdateUnusedWhilePending ||
|
||||
device->vk.enabled_features.descriptorBindingPartiallyBound;
|
||||
/* Enable the global BO list by default. */
|
||||
/* TODO: Remove the per cmdbuf BO list tracking after few Mesa releases if no blockers. */
|
||||
device->use_global_bo_list = !pdev->info.is_virtio;
|
||||
|
||||
/* Disable it for debugging purposes if no features require it. */
|
||||
if (instance->debug_flags & RADV_DEBUG_NO_BO_LIST) {
|
||||
if (!device->vk.enabled_features.bufferDeviceAddress && !device->vk.enabled_features.descriptorIndexing &&
|
||||
!device->vk.enabled_features.descriptorBindingUniformBufferUpdateAfterBind &&
|
||||
!device->vk.enabled_features.descriptorBindingSampledImageUpdateAfterBind &&
|
||||
!device->vk.enabled_features.descriptorBindingStorageImageUpdateAfterBind &&
|
||||
!device->vk.enabled_features.descriptorBindingStorageBufferUpdateAfterBind &&
|
||||
!device->vk.enabled_features.descriptorBindingUniformTexelBufferUpdateAfterBind &&
|
||||
!device->vk.enabled_features.descriptorBindingStorageTexelBufferUpdateAfterBind &&
|
||||
!device->vk.enabled_features.descriptorBindingUpdateUnusedWhilePending &&
|
||||
!device->vk.enabled_features.descriptorBindingPartiallyBound) {
|
||||
device->use_global_bo_list = false;
|
||||
} else {
|
||||
fprintf(stderr, "radv: Can't disable the global BO list because some features require it!\n");
|
||||
}
|
||||
}
|
||||
|
||||
radv_init_shader_arenas(device);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ static const struct debug_control radv_debug_options[] = {{"nofastclears", RADV_
|
|||
{"novideo", RADV_DEBUG_NO_VIDEO},
|
||||
{"validatevas", RADV_DEBUG_VALIDATE_VAS},
|
||||
{"bo_history", RADV_DEBUG_DUMP_BO_HISTORY},
|
||||
{"nobolist", RADV_DEBUG_NO_BO_LIST},
|
||||
{NULL, 0}};
|
||||
|
||||
const char *
|
||||
|
|
@ -105,7 +106,6 @@ radv_get_debug_option_name(int id)
|
|||
|
||||
static const struct debug_control radv_perftest_options[] = {{"localbos", RADV_PERFTEST_LOCAL_BOS},
|
||||
{"dccmsaa", RADV_PERFTEST_DCC_MSAA},
|
||||
{"bolist", RADV_PERFTEST_BO_LIST},
|
||||
{"cswave32", RADV_PERFTEST_CS_WAVE_32},
|
||||
{"pswave32", RADV_PERFTEST_PS_WAVE_32},
|
||||
{"gewave32", RADV_PERFTEST_GE_WAVE_32},
|
||||
|
|
|
|||
|
|
@ -185,8 +185,8 @@ radv_amdgpu_winsys_get_sync_provider(struct radeon_winsys *rws)
|
|||
static uint64_t
|
||||
radv_amdgpu_winsys_filter_perftest_flags(uint64_t perftest_flags)
|
||||
{
|
||||
return perftest_flags & (RADV_PERFTEST_NO_GTT_SPILL | RADV_PERFTEST_LOCAL_BOS | RADV_PERFTEST_NO_SAM |
|
||||
RADV_PERFTEST_SAM | RADV_PERFTEST_BO_LIST);
|
||||
return perftest_flags &
|
||||
(RADV_PERFTEST_NO_GTT_SPILL | RADV_PERFTEST_LOCAL_BOS | RADV_PERFTEST_NO_SAM | RADV_PERFTEST_SAM);
|
||||
}
|
||||
|
||||
VkResult
|
||||
|
|
@ -223,9 +223,9 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags,
|
|||
++ws->refcount;
|
||||
}
|
||||
|
||||
if (is_virtio && (perftest_flags & (RADV_PERFTEST_BO_LIST | RADV_PERFTEST_LOCAL_BOS))) {
|
||||
if (is_virtio && (perftest_flags & RADV_PERFTEST_LOCAL_BOS)) {
|
||||
/* virtio doesn't support VM_ALWAYS_VALID, so disable options that requires it. */
|
||||
fprintf(stderr, "localbos and bolist options are not supported values for RADV_PERFTEST with virtio.\n");
|
||||
fprintf(stderr, "RADV_PERFTEST=localbos is not supported with virtio.\n");
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue