Repository navigation
Conversation
…hout driver optimization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A compute program of 400000 SPIR-V words or more is now created with
VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT(APS5_HUGE_SHADER_WORDSsets the limit, 0 turns it off), and the capture format accepts that flag so such a pipeline can still be captured and replayed.Why: a compute program captured from PPSA02429 (10 497 106 byte capture) is 2 624 211 SPIR-V words in one function of 321 blocks, and 99% of its instructions sit in five blocks. One block alone holds 447 491 instructions, a straight line of about 33 000 f32 subtractions (plus 1 500 multiplications and 1 000 additions) with no loop and no switch. Each float operation costs about 13 instructions because the emulated f32 denormal flush and NaN canonicalisation (the host has no f32 flush-to-zero mode on NVIDIA) wrap it, with bitcasts between them. The NVIDIA driver's compiler (
nvgpucomp64.dll) does not finish this pipeline in 4 minutes; an AMD Radeon 880M compiles it in about 2 minutes. The other four captured compute pipelines of the run are 3.9 KB to 110 KB.This is a mitigation, not yet shown to help on NVIDIA: whether the driver honours the flag as a faster compile is checked with the pipeline watch of #50. A follow-up in the recompiler can shrink the per-operation expansion (drop the NaN canonicalisation between chained float operations).
Tested
Unit test
agc_huge_shader_policy(limit and parsing). Not run against a game or an NVIDIA device.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryNeed help on this PR? Tag
@codesmith-botwith what you need.