protonscr

test_execute_indirect_state_predication failing on Anv

vkd3dclosed
HansKristian-Work/vkd3d-proton#2312 · opened 2025-01-27 by llandwerlin-intel · updated 2025-01-29 · 3 comments · github
Lllandwerlin-intel 2025-01-27 github

Software information

This is just running one of the test :

INTEL_DEBUG=shader-print VKD3D_TEST_FILTER=test_execute_indirect_state_predication ./build/tests/d3d12

System information

Log files

 INTEL_DEBUG=shader-print VKD3D_TEST_FILTER=test_execute_indirect_state_predication ./build/tests/d3d12
6a612:info:vkd3d_instance_apply_application_workarounds: Program name: "d3d12" (hash: a10b6499944cd875)
6a612:info:vkd3d_instance_deduce_config_flags_from_environment: shader_cache is used, global_pipeline_cache is enforced.
6a612:info:vkd3d_config_flags_init_once: VKD3D_CONFIG=''.
6a612:info:vkd3d_get_vk_version: vkd3d-proton - applicationVersion: 2.14.1.
6a612:info:vkd3d_instance_init: vkd3d-proton - build: 36a0d92265c4118+.
6a612:info:vkd3d_memory_info_decide_hvv_usage: Topology: UMA-like topology.
6a612:info:vkd3d_memory_info_upload_hvv_memory_properties: Topology: HVV usage is allowed, using DEVICE_LOCAL | HOST_COHERENT for UPLOAD.
6a612:info:vkd3d_global_descriptor_buffer_init: Small descriptor heap detected, falling back to MUTABLE_SINGLE_SET.
6a612:info:vkd3d_bindless_state_get_bindless_flags: Enabling single descriptor set path for MUTABLE.
6a612:info:vkd3d_bindless_state_get_bindless_flags: Enabling fast paths for advanced ExecuteIndirect() graphics and compute (EXT_dgc).
6a612:info:vkd3d_bindless_state_get_bindless_flags: Device supports VK_EXT_mutable_descriptor_type.
6a612:info:d3d12_device_caps_init_shader_model: Enabling support for SM 6.6.
6a612:info:d3d12_device_caps_init_shader_model: Enabling support for SM 6.7.
6a612:info:d3d12_device_caps_init_shader_model: Enabling support for SM 6.8.
6a612:fixme:d3d12_device_caps_init_feature_options1: TotalLaneCount = 1024, may be inaccurate.
6a612:info:vkd3d_pipeline_library_init_disk_cache: Attempting to load disk cache from: vkd3d-proton.cache.
d3d12:676: Driver name: Intel open-source Mesa driver, driver info: Mesa 25.0.0-devel (git-27fb0a5f42).
6a617:info:vkd3d_pipeline_library_disk_thread_main: Performing async setup of stream archive ...
6a617:info:vkd3d_pipeline_library_disk_cache_merge: No write cache exists. No need to merge any disk caches.
6a617:info:vkd3d_pipeline_library_disk_cache_initial_setup: Merging pipeline libraries took 0.015 ms.
6a617:info:vkd3d_pipeline_library_disk_cache_initial_setup: Mapping read-only cache took 0.013 ms.
6a617:info:d3d12_pipeline_library_read_blob_stream_format: Device teardown request received, stopping parse early.
6a617:info:vkd3d_pipeline_library_disk_cache_initial_setup: Parsing stream archive took 0.007 ms.
6a617:info:vkd3d_pipeline_library_disk_thread_main: Done performing async setup of stream archive.
d3d12: ======== test_execute_indirect_state_predication begin ========
6a612:info:vkd3d_get_vk_version: vkd3d-proton - applicationVersion: 2.14.1.
6a612:info:vkd3d_instance_init: vkd3d-proton - build: 36a0d92265c4118+.
6a612:info:vkd3d_memory_info_decide_hvv_usage: Topology: UMA-like topology.
6a612:info:vkd3d_memory_info_upload_hvv_memory_properties: Topology: HVV usage is allowed, using DEVICE_LOCAL | HOST_COHERENT for UPLOAD.
6a612:info:vkd3d_global_descriptor_buffer_init: Small descriptor heap detected, falling back to MUTABLE_SINGLE_SET.
6a612:info:vkd3d_bindless_state_get_bindless_flags: Enabling single descriptor set path for MUTABLE.
6a612:info:vkd3d_bindless_state_get_bindless_flags: Enabling fast paths for advanced ExecuteIndirect() graphics and compute (EXT_dgc).
6a612:info:vkd3d_bindless_state_get_bindless_flags: Device supports VK_EXT_mutable_descriptor_type.
6a612:info:d3d12_device_caps_init_shader_model: Enabling support for SM 6.6.
6a612:info:d3d12_device_caps_init_shader_model: Enabling support for SM 6.7.
6a612:info:d3d12_device_caps_init_shader_model: Enabling support for SM 6.8.
6a612:fixme:d3d12_device_caps_init_feature_options1: TotalLaneCount = 1024, may be inaccurate.
6a612:info:vkd3d_pipeline_library_init_disk_cache: Attempting to load disk cache from: vkd3d-proton.cache.
6a61c:info:vkd3d_pipeline_library_disk_thread_main: Performing async setup of stream archive ...
6a61c:info:vkd3d_pipeline_library_disk_cache_merge: No write cache exists. No need to merge any disk caches.
6a61c:info:vkd3d_pipeline_library_disk_cache_initial_setup: Merging pipeline libraries took 0.013 ms.
6a61c:info:vkd3d_pipeline_library_disk_cache_initial_setup: Mapping read-only cache took 0.020 ms.
6a61c:info:vkd3d_pipeline_library_disk_cache_initial_setup: Parsing stream archive took 0.038 ms.
6a61c:info:vkd3d_pipeline_library_disk_thread_main: Done performing async setup of stream archive.
test_execute_indirect_state_predication:2152: Test failed: Iteration 0, draw output 127: expected {0, 40960, 2560, 2560}, got {0, 40960, 2560, 0}.
test_execute_indirect_state_predication:2152: Test failed: Iteration 1, draw output 127: expected {0, 40960, 2560, 2560}, got {0, 40960, 2560, 0}.
Maximum DGC time: 1447795.052 us.
Minimum DGC time: 2.865 us.
Average DGC time: 251.256 us.
d3d12: ======== test_execute_indirect_state_predication end ==========
d3d12: 790 tests executed (2 failures, 0 successful todo, 0 skipped, 0 todo, 0 bugs).
Zzmike maintainer 2025-01-27 github

Testing this on ANV (ICL says hi) I hit a driver bug assert(stats[stat_idx].sends == sends_count_expectation);

#5  0x00007fffd4f60e36 in compile_shader (device=0x599a00, libanv=0x5595f0, shader_name=ANV_INTERNAL_KERNEL_GENERATED_GFX_COMMANDS_STEP1_FRAGMENT, 
    stage=MESA_SHADER_FRAGMENT, name=0x7fffffffb0e0 "anv-generated-gfx-cmd1-fragment", hash_key=0x7fffffffb0e0, hash_key_size=40, sends_count_expectation=124)
    at ../src/intel/vulkan/anv_internal_kernels.c:201
#6  0x00007fffd4f61b93 in anv_device_get_internal_shader (device=0x599a00, name=ANV_INTERNAL_KERNEL_GENERATED_GFX_COMMANDS_STEP1_FRAGMENT, 
    out_bin=0x7fffffffb7c8) at ../src/intel/vulkan/anv_internal_kernels.c:416
#7  0x00007fffd55c43e0 in preprocess_gfx_sequences (cmd_buffer=0x945140, cmd_buffer_state=0x937e90, layout=0x8a69d0, indirect_set=0x0, info=0x7fffffffbe10, 
    kernel_name=ANV_INTERNAL_KERNEL_GENERATED_GFX_COMMANDS_STEP1_FRAGMENT) at ../src/intel/vulkan/genX_cmd_dgc.c:92
#8  0x00007fffd55c9fcd in gfx11_CmdPreprocessGeneratedCommandsEXT (commandBuffer=0x945140, pGeneratedCommandsInfo=0x7fffffffbe10, stateCommandBuffer=0x937e90)
    at ../src/intel/vulkan/genX_cmd_dgc.c:735
#9  0x00007ffff79b51cd in d3d12_command_list_execute_indirect_state_template_dgc (list=0x8a1c40, signature=0x89ff50, max_command_count=128, 
    arg_buffer=0x8acec0, arg_buffer_offset=0, count_buffer=0x0, count_buffer_offset=0) at ../libs/vkd3d/command.c:13914
[#10](/issue/HansKristian-Work/vkd3d-proton/10) 0x00007ffff79b59aa in d3d12_command_list_ExecuteIndirect (iface=0x8a1c40, command_signature=0x89ff50, max_command_count=128, arg_buffer=0x8acec0, 
    arg_buffer_offset=0, count_buffer=0x0, count_buffer_offset=0) at ../libs/vkd3d/command.c:14081
[#11](/issue/HansKristian-Work/vkd3d-proton/11) 0x000000000044b738 in ID3D12GraphicsCommandList_ExecuteIndirect (This=0x8a1c40, command_signature=0x89ff50, max_command_count=128, arg_buffer=0x8acec0, 
    arg_buffer_offset=0, count_buffer=0x0, count_buffer_offset=0) at libs/vkd3d-common/libvkd3d_common.a.p/vkd3d_d3d12.h:8509
[#12](/issue/HansKristian-Work/vkd3d-proton/12) 0x00000000004558dc in test_execute_indirect_state_predication () at ../tests/d3d12_command.c:2064
[#13](/issue/HansKristian-Work/vkd3d-proton/13) 0x00000000004b9f90 in vkd3d_run_test (name=0x375430 "test_execute_indirect_state_predication", test_pfn=0x455017 <test_execute_indirect_state_predication>)
    at ../include/private/vkd3d_test.h:399
[#14](/issue/HansKristian-Work/vkd3d-proton/14) 0x00000000004bb28f in vkd3d_test_main (argc=1, argv=0x7fffffffd428) at ../tests/d3d12_tests.h:147
[#15](/issue/HansKristian-Work/vkd3d-proton/15) 0x00000000004b9e4b in main (argc=1, argv=0x7fffffffd428) at ../include/private/vkd3d_test.h:315
Lllandwerlin-intel 2025-01-28 github

I remember this failing everywhere but it's passing on Meteorlake.

I can also make it pass on Tigerlake by inserting some printf shaders before preprocess/execute.

So it looks like a caching issue, not sure if driver side or application side. Will dig further and update with the findings.

Lllandwerlin-intel 2025-01-29 github

It was an Anv bug due to internal compute state not dirtied after generation shaders. Sorry for the noise.