Repository navigation
D3D12.X: retry driver-rejected compute PSOs without DXC GVN (#756) - #1398
KarolKurzyna wants to merge 3 commits into
Conversation
|
Review from the DXC-memory lane: the design is right — default GVN path untouched, one retry with |
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
732d3a5 to
2b73d16
Compare
Addresses review feedback from @pickles976 on xcl-dev#1398: - Return both DXIL disk-cache keys (default GVN build -> `-opt-disable gvn` build) via `WithoutGvn` and log them whenever a compute PSO is retried or refused. - Capture the first non-empty line of any D3D12 debug-layer error emitted on the calling thread (or fall back to Windows' formatted HRESULT) and include it in `translated_compute_pso` and `Pipelines::make` retry/failure logs. Assisted-by: Google Antigravity (Gemini 4 Neon)
|
@pickles976 Thanks for the review — addressed both asks in
Re-verified on @futurepro62 Thank you for running and posting the RTX 5070 Ti verification report as well! |
|
Test report for Tested
Two points from the review, both checked here
Not tested
AI use
|
|
Verified head
Clean build and full test suite pass on RTX 5080. |
…in-place vtables Integrates 16 upstream PRs (ivall#1380, ivall#1383, ivall#1384, ivall#1395, ivall#1398, ivall#1400, ivall#1404, ivall#1405, ivall#1419, ivall#1420, ivall#1421, ivall#1423, ivall#1424, ivall#1427, ivall#1428, ivall#1429) on top of the Linux/Proton fork, plus three Proton/vkd3d-proton fixes caught during verification: - Recompiler (ivall#1428): flatten IO_GROUP_LIMIT early-return in compute shaders so vkd3d-proton v3.1 dxil-spirv accepts the emitted CFG. - D3D12.X (ivall#1395 + ivall#867): skip UnadoptGuard on in-place-patched vtables and restore native vtables in runner::submit_list when a prior test adopted the singleton ID3D12Device. - Tests: match Wine centered default in window_position_modes. Verified under GE-Proton11-14 (RX 9060 XT / RADV): - gpu_sparse_vram_descriptors_buffers_and_xmem + gpu_valu_float_and_int + window_position_modes: 3 passed, 0 failed - Broad sweep (present, real, sparse, clamp, dstorage, gpu_valu, gpu_typed_buffer): 82 passed, 0 failed, 1 ignored, 0 skipped - 2.5 min retail title run (XCL_MEM_LIMIT=12G): 3,000+ frames at 30.0 fps, 6.0-6.1 GB flat committed RAM, 6.4 GB local VRAM, 0 DS failures.
Addresses two review points from @erickbobd on xcl-dev#1398: - Guard `-opt-disable gvn` retries on `first_elapsed <= 5 s` (`NO_GVN_RETRY_MAX_REFUSAL`) in both `translated_compute_pso` and `Pipelines::make`, resetting `started` around uncached fallback driver compiles so slow multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile. - Strengthen `dxil_cache_with_extra_flags_round_trip` with a GVN-sensitive HLSL compute shader and `assert_ne!(default_dxil, nogvn_dxil)`, plus `runner::skip_test("no DXC")` when DXC is absent. Assisted-by: Google Antigravity (Gemini 4 Neon)
|
@erickbobd Thank you for running the end-to-end verification on
Re-verified on RTX 3070 Ti ( @mastrr9 Thanks as well for verifying |
|
Independent Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32) test report on latest head Tested
Regression run PR head ( Not tested: debug build, AI use: Antigravity ( |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Update: re-tested on the rebased head a0f2cc6 (on
Test report on AMD (RDNA2, Windows driver) for 58bfd73, this PR's head, unmodified. As far as I can see in the thread, it is the first AMD run of it. Short version: the suite passes apart from three known RDNA2 failures that are not from this PR. The two programs the AMD driver refused in my earlier whole-pack Tested
Not tested
AI use
|
58bfd73 to
a0f2cc6
Compare
Addresses review feedback from @pickles976 on xcl-dev#1398: - Return both DXIL disk-cache keys (default GVN build -> `-opt-disable gvn` build) via `WithoutGvn` and log them whenever a compute PSO is retried or refused. - Capture the first non-empty line of any D3D12 debug-layer error emitted on the calling thread (or fall back to Windows' formatted HRESULT) and include it in `translated_compute_pso` and `Pipelines::make` retry/failure logs. Assisted-by: Google Antigravity (Gemini 4 Neon)
Addresses two review points from @erickbobd on xcl-dev#1398: - Guard `-opt-disable gvn` retries on `first_elapsed <= 5 s` (`NO_GVN_RETRY_MAX_REFUSAL`) in both `translated_compute_pso` and `Pipelines::make`, resetting `started` around uncached fallback driver compiles so slow multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile. - Strengthen `dxil_cache_with_extra_flags_round_trip` with a GVN-sensitive HLSL compute shader and `assert_ne!(default_dxil, nogvn_dxil)`, plus `runner::skip_test("no DXC")` when DXC is absent. Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Rebased onto @LocranKing @DavidM1911 @RodrigoTorreao thank you for the independent verifications on RTX 3060 Ti and RX 6750 XT! On #680 interop on
Re-verified on
|
|
@KarolKurzyna I re-tested the rebased head
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this. |
…direct DXIL) Brings in upstream xcl-dev#680 (descriptor-heap memory windows without per-access switches, with switch fallback) and xcl-dev#1426 (direct RDNA2 -> DXIL backend behind XCL_DIRECT_DXIL=1 / XCL_DIRECT_DXIL=all, bypassing HLSL and DXC). Retains xcl-dev#1398 no-GVN retry, xcl-dev#1410 wave64 logging, and xcl-dev#1428 folded X dispatch group limit alongside xcl-dev#680 and xcl-dev#1426.
Addresses review feedback from @pickles976 on xcl-dev#1398: - Return both DXIL disk-cache keys (default GVN build -> `-opt-disable gvn` build) via `WithoutGvn` and log them whenever a compute PSO is retried or refused. - Capture the first non-empty line of any D3D12 debug-layer error emitted on the calling thread (or fall back to Windows' formatted HRESULT) and include it in `translated_compute_pso` and `Pipelines::make` retry/failure logs. Assisted-by: Google Antigravity (Gemini 4 Neon)
Addresses two review points from @erickbobd on xcl-dev#1398: - Guard `-opt-disable gvn` retries on `first_elapsed <= 5 s` (`NO_GVN_RETRY_MAX_REFUSAL`) in both `translated_compute_pso` and `Pipelines::make`, resetting `started` around uncached fallback driver compiles so slow multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile. - Strengthen `dxil_cache_with_extra_flags_round_trip` with a GVN-sensitive HLSL compute shader and `assert_ne!(default_dxil, nogvn_dxil)`, plus `runner::skip_test("no DXC")` when DXC is absent. Assisted-by: Google Antigravity (Gemini 4 Neon)
a0f2cc6 to
85ca7be
Compare
|
@RodrigoTorreao Thanks for re-testing Rebased onto Main
Re-verified on
|
) NVIDIA D3D12 drivers can fail CreateComputePipelineState with E_OUTOFMEMORY (0x8007000E) when DXC's GVN pass merges descriptor heap handles into `phi %dx.types.Handle`, as diagnosed by @psuedo-tty in Keep the fast GVN-optimized DXIL build on the primary path and retry once with `-opt-disable gvn` only when the driver rejects the PSO: - Key DXC's disk cache on extra compiler flags (`cache_key_for_toolchain_extra`) so fallback DXIL is cached on disk without overwriting default entries. - Add `console_to_dxil_without_gvn` / `console_to_dxil_in_without_gvn` bypassing `ShaderCache` and the `translated` memory cache, and skip recompiling >8 MB HLSL already compiled at `-O0`. - Retry once on driver failure in `translated_compute_pso` (reusing the driver blob cache path) and in `xcl shaders --pipelines` (`Pipelines::make`). Fixes xcl-dev#756. Part of xcl-dev#1269. Assisted-by: Google Antigravity (Gemini 4 Neon)
Addresses review feedback from @pickles976 on xcl-dev#1398: - Return both DXIL disk-cache keys (default GVN build -> `-opt-disable gvn` build) via `WithoutGvn` and log them whenever a compute PSO is retried or refused. - Capture the first non-empty line of any D3D12 debug-layer error emitted on the calling thread (or fall back to Windows' formatted HRESULT) and include it in `translated_compute_pso` and `Pipelines::make` retry/failure logs. Assisted-by: Google Antigravity (Gemini 4 Neon)
Addresses two review points from @erickbobd on xcl-dev#1398: - Guard `-opt-disable gvn` retries on `first_elapsed <= 5 s` (`NO_GVN_RETRY_MAX_REFUSAL`) in both `translated_compute_pso` and `Pipelines::make`, resetting `started` around uncached fallback driver compiles so slow multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile. - Strengthen `dxil_cache_with_extra_flags_round_trip` with a GVN-sensitive HLSL compute shader and `assert_ne!(default_dxil, nogvn_dxil)`, plus `runner::skip_test("no DXC")` when DXC is absent. Assisted-by: Google Antigravity (Gemini 4 Neon)
85ca7be to
834ea6d
Compare
|
Rebased onto #1524 interop on
Re-verified on
|
Part of #1269 (addresses the DXC GVN compute PSO refusal pattern originally reported in #756, following @psuedo-tty's analysis of
phi %dx.types.Handletriggers under DXC GVN, @pickles976's review on logging cache keys and driver refusal reasons, and @erickbobd's review and verification).What is in it
-opt-disable gvnwhen the driver refusesCreateComputePipelineStateon a translated console compute shader (crates/xcl/src/hle/d3d12x/real.rs,crates/xcl/src/shaders.rs), bounded to fast refusals (<= 5 sviaNO_GVN_RETRY_MAX_REFUSAL) so multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile.cache_key_for_toolchain_extra/cache_key_with_extra(crates/xcl/src/gpu/recomp/dxc.rs) so fallback DXIL is cached on disk without overwriting default entries.console_to_dxil_without_gvnandconsole_to_dxil_in_without_gvnreturningWithoutGvn(crates/xcl/src/gpu/recomp/pso.rs), bypassingShaderCacheand thetranslatedmemory cache and short-circuiting shaders over 8 MB HLSL (already compiled at-O0).driver_cacheon the retry DXIL, skips the second driver call if the fallback DXIL is byte-identical, and logs both DXIL disk-cache keys (<gvn_key> -> <no_gvn_key>) plus the first line of the driver rejection message (retained D3D12 debug-layer error on the calling thread or formattedHRESULT) in bothtranslated_compute_pso_onceandxcl shaders --pipelines(Pipelines::make).main(b9b6ea6, PR Shaders: speed up translated pipeline compiles and add PSO measurements #1524driver_compile_identified/huge_pso_bytes+ PR gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426/Direct DXIL: memory windows through the descriptor heap (XCL_HEAP_WINDOWS) #1693 Direct DXIL + PR Recompiler: memory windows from the descriptor heap (no per-access switch) #680 heap windows):compile_console_shaderpreserves Direct DXIL routing whilecompile_console_shader_with_extraserves the HLSL-opt-disable gvnretry path,translated_compute_pso_onceroutes both attempts throughdriver_compile_identified(soNO_GVN_RETRY_MAX_REFUSALmeasures driver-only compile time excluding slot wait time), and the no-GVN retry stays guarded by!HEAP_WINDOW_OOM.with(|o| o.get())sowith_switch_fallbackrunsin_switch_formfirst on heap-windowE_OUTOFMEMORY.Tested
26300.9974), Intel Core i5-14600K, NVIDIA GeForce RTX 3070 Ti (8192 MiB, driver621.24/32.0.16.2124, SM 6.6, wave32),rustc 1.100.0(stable-x86_64-pc-windows-msvc),dxcompiler 1.9.2602.17 (21d28f72)/dxil 1.9.2602.17(Windows SDK10.0.26100.0)..\scripts\test.ps1) on commit834ea6d74f651df876542f034d54ca5b1aafbe97: 898 passed, 0 failed, 42 ignored across 20 workspace/integration test runs (unittests src\lib.rs:849 passed, 0 failed, 22 ignored;GPU tests skipped on this adapter: 2 (no wave64), 1 (no heap windows), 1 (cannot disable the driver cache (Windows Developer Mode is required): ... 0x887A002D); zero warnings in modified files), including:gpu::recomp::dxc::cache_tests::cache_key_tracks_extra_dxc_flags(passed)gpu::recomp::dxc::cache_tests::dxil_cache_with_extra_flags_round_trip(passed; compiles a GVN-sensitive HLSL shader via live DXC with and without["-opt-disable", "gvn"], asserts distinct cache entries anddefault_dxil != nogvn_dxil, and skips withrunner::skip_test("no DXC")if absent)hle::d3d12x::real::compute_pso_retry_tests::compute_pso_success_skips_no_gvn_retry(passed)hle::d3d12x::real::compute_pso_retry_tests::compute_pso_refusal_retries_without_gvn(passed)hle::d3d12x::real::compute_pso_retry_tests::compute_pso_slow_refusal_skips_no_gvn_retry(passed; verifies> 5 srefusals skip recompile/retry and<= 5 sstill retries)hle::d3d12x::real::compute_pso_retry_tests::compute_pso_refusal_skips_second_driver_call_when_dxil_unchanged(passed)hle::d3d12x::real::compute_pso_retry_tests::compute_pso_refusal_propagates_failure_when_retry_fails(passed)hle::d3d12x::real::compute_pso_retry_tests::first_error_line_picks_first_non_empty_trimmed_line(passed)hle::d3d12x::real::compute_pso_retry_tests::format_driver_rejection_prefers_retained_first_line_and_falls_back_to_hresult(passed)hle::d3d12x::real::big_compile_tests::*(8 passed, 0 failed)$env:XCL_HEAP_WINDOWS = "1"; cargo test -p xcl --test gpu_compute_e2e -- --nocapture) on834ea6d74f651df876542f034d54ca5b1aafbe97: 4 passed, 0 failed, 0 ignored, includingheap_window_out_of_memory_falls_back_to_the_switch_form(D3D12.X: the driver ran out of memory on a pipeline with heap windows – building it in the switch form (1 so far)).cargo build --release -p xcl) succeeded cleanly after commit834ea6d74f651df876542f034d54ca5b1aafbe97with zero warnings in modified files.Regression run
Baseline (
main, warm DXIL/driver cache):This branch (
834ea6d74f651df876542f034d54ca5b1aafbe97, warm DXIL/driver cache):Not tested
wave64hardware pathsgpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_maskandgpu::recomp::tests::gpu_wave32_program_in_wave64_hardwareskipped on this adapter:no wave64),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(skipped: Windows Developer Mode not enabled to toggle driver cache), andXCL_SAMPLE_*sample-asset tests (not set locally).-opt-disable gvnfallback on this machine (RTX 3070 Ti, driver621.24builds the title's compute PSOs cleanly; see@erickbobd's--pipelinesverification on RTX 5070 Ti617.14and@LocranKing/@DavidM1911/@mastrr9/@RodrigoTorreaoreports below).AI use
Implemented, tested, and drafted with Google Antigravity (Gemini 4 Neon); all unit tests, workspace tests, release build, and
xcl-smokeruns were executed locally on the hardware listed above.