diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-26 09:15:59 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-26 09:16:06 -0500 |
| commit | 32a04b17f9bf2304c8ca0d63dfb95a005317d79f (patch) | |
| tree | af19df2a040ee526ded2ee1310758e18053d3936 /docs/d3d12_vulkan.md | |
| parent | e6a82e72b2a9f3a99c9119df4ee5ede30b683b1b (diff) | |
| parent | a42bffdc3e0d30347eedb3c433405e9a141cc06b (diff) | |
Merge #1914 from kawaii-shakal: a pipeline cache for the offline cache's misses (RT-HEAVY-PIPELINE-CACHE)
Head a42bffdc3. The conflict in docs/d3d12_vulkan.md keeps main's session-cache cap (#1886) and #1914's heavy cache text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/d3d12_vulkan.md')
| -rw-r--r-- | docs/d3d12_vulkan.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md index 4b76d4aa5..a3c4ca38d 100644 --- a/docs/d3d12_vulkan.md +++ b/docs/d3d12_vulkan.md | |||
| @@ -2590,6 +2590,24 @@ Pipeline creation: | |||
| 2590 | Replacing part of the previous file would corrupt it. | 2590 | Replacing part of the previous file would corrupt it. |
| 2591 | `LEONIDA_PIPELINE_CACHE_BYTES` caps what a session adds, at a checkpoint or at teardown (an offline `pipeline_cache.bin` seed, which the driver hands back as part of the union, is not counted; 4 GiB by default, zero disables | 2591 | `LEONIDA_PIPELINE_CACHE_BYTES` caps what a session adds, at a checkpoint or at teardown (an offline `pipeline_cache.bin` seed, which the driver hands back as part of the union, is not counted; 4 GiB by default, zero disables |
| 2592 | the session file). | 2592 | the session file). |
| 2593 | The session file can't keep a crashed run's compiles: it is written at teardown and at the optional checkpoints | ||
| 2594 | below only. The heavy pipeline cache (RT-HEAVY-PIPELINE-CACHE, `runtime/src/heavy_pipeline_cache.h`) keeps the graphics ones; compute pipelines go to the per-pipeline journal | ||
| 2595 | described below. Every graphics build first asks the corpus cache with | ||
| 2596 | `VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT`. A pipeline the corpus doesn't have is built against a | ||
| 2597 | second cache, seeded from `pipeline_cache.heavy.bin` next to `pipeline_cache.bin`, so that cache holds only the | ||
| 2598 | corpus's misses. | ||
| 2599 | A build that takes at least `LEONIDA_HEAVY_PIPELINE_CACHE_MS` (500 by default) marks the heavy cache for writing. | ||
| 2600 | A thread of its own writes it whole: 3 s after the newest slow build, and no later than 20 s after the first unwritten | ||
| 2601 | one, through the same staging file and rename as the session cache. A crash therefore loses at most the last 20 s | ||
| 2602 | of slow builds, and the next launch starts with the rest. A write that fails, or whose | ||
| 2603 | `vkGetPipelineCacheData` returns anything but `VK_SUCCESS` (`VK_INCOMPLETE` means the cache grew after the size | ||
| 2604 | query, so the blob is truncated), leaves the previous file in place and the cache dirty: it is tried again 5 s | ||
| 2605 | later, the delay doubling with each failure in a row up to 2 min, so the cache is not left unsaved until teardown | ||
| 2606 | and a write that keeps failing does not spin. At device teardown the thread stops, and the cache is | ||
| 2607 | written if any build went into it. Fast builds are kept that way: without an offline seed every build is a miss, | ||
| 2608 | so they no longer reach `pipeline_cache.session.bin`. `LEONIDA_HEAVY_PIPELINE_CACHE_MS=0` turns the heavy cache off, and with it the | ||
| 2609 | `pipelineCreationCacheControl` feature unless `LEONIDA_PIPELINE_COMPILE=cache-only` asks for it. A cache-only create | ||
| 2610 | (`cache-only`) is left as it is. | ||
| 2593 | `LEONIDA_SKIP_COMPUTE=<part of a name>[,<part>...]` (`all`: every compute program) never builds the matching | 2611 | `LEONIDA_SKIP_COMPUTE=<part of a name>[,<part>...]` (`all`: every compute program) never builds the matching |
| 2594 | compute programs and drops their dispatches, direct and indirect; the first dropped dispatch of each is logged. | 2612 | compute programs and drops their dispatches, direct and indirect; the first dropped dispatch of each is logged. |
| 2595 | It is a way past a program that hangs the GPU while the program or its input is fixed, not a fix. | 2613 | It is a way past a program that hangs the GPU while the program or its input is fixed, not a fix. |