diff --git a/docs/envvars.rst b/docs/envvars.rst index cdd9cec057f..cdafb21f8c5 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -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`` diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h index 453235fd714..f3c700307d3 100644 --- a/src/amd/vulkan/radv_debug.h +++ b/src/amd/vulkan/radv_debug.h @@ -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 { diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 4e3ef3d8c6d..3dcbdbed80b 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -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); diff --git a/src/amd/vulkan/radv_instance.c b/src/amd/vulkan/radv_instance.c index faa4a8e598f..66595b3e92c 100644 --- a/src/amd/vulkan/radv_instance.c +++ b/src/amd/vulkan/radv_instance.c @@ -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}, diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index 1190c5cbdc6..2e2e6954e23 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -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; }