diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 17:11:38 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 17:11:38 -0500 |
| commit | ca9e45dbd136feae14936ffbbe300d18bcda48c7 (patch) | |
| tree | d6cad81523cd0cbdd774b9d6c1c597584055d1ec /docs | |
| parent | b8c925002c6b4a6bfb5cfad6e7cc60ce2414586e (diff) | |
| parent | d3b8251bc390418cdbc1f2d30727b6b31d889cfa (diff) | |
Merge main into pe-inspect-linux-classes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/d3d12_vulkan.md | 27 | ||||
| -rw-r--r-- | docs/pipeline_check.md | 2 |
2 files changed, 25 insertions, 4 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md index 6b5820c02..ce1a5f7be 100644 --- a/docs/d3d12_vulkan.md +++ b/docs/d3d12_vulkan.md | |||
| @@ -2439,9 +2439,7 @@ Pipeline creation: | |||
| 2439 | is when each is compiled alone, so a PSO released meanwhile waits for the submission. The workers have ended before | 2439 | is when each is compiled alone, so a PSO released meanwhile waits for the submission. The workers have ended before |
| 2440 | the session cache is read at device teardown. `LEONIDA_PIPELINE_THREADS=<n>` sets the workers: unset, half the | 2440 | the session cache is read at device teardown. `LEONIDA_PIPELINE_THREADS=<n>` sets the workers: unset, half the |
| 2441 | logical processors and at most 8; `0` compiles each pipeline on the submitting thread where `prepare()` meets it. | 2441 | logical processors and at most 8; `0` compiles each pipeline on the submitting thread where `prepare()` meets it. |
| 2442 | Graphics pipelines of 1 MiB of SPIR-V or more, and compute pipelines over 128 KiB (`LEONIDA_SERIAL_BIG_COMPILES`), | 2442 | Large pipelines (below) are compiled within a memory budget, and the variants of one PSO one after another. |
| 2443 | are compiled one after another beside the smaller ones, because a compile takes the driver some hundred bytes of | ||
| 2444 | memory for each byte of SPIR-V ([pipeline_check.md](pipeline_check.md)); so are the variants of one PSO. | ||
| 2445 | `LEONIDA_ASYNC_PIPELINES=1` is not changed: its builds stay on the compile worker. Measured with synthetic programs | 2443 | `LEONIDA_ASYNC_PIPELINES=1` is not changed: its builds stay on the compile worker. Measured with synthetic programs |
| 2446 | never compiled before and the warm-up off (RTX 3080, NVIDIA 621.24, Windows 11, 16 logical processors, 8 workers, | 2444 | never compiled before and the warm-up off (RTX 3080, NVIDIA 621.24, Windows 11, 16 logical processors, 8 workers, |
| 2447 | three runs each): the first submission of 192 graphics pipelines takes 126 to 143 ms instead of 861 to 882, of 192 | 2445 | three runs each): the first submission of 192 graphics pipelines takes 126 to 143 ms instead of 861 to 882, of 192 |
| @@ -2449,6 +2447,29 @@ Pipeline creation: | |||
| 2449 | holds about 50 MiB more (the driver keeps memory for each thread that compiles). One `VkPipelineCache` is enough: one | 2447 | holds about 50 MiB more (the driver keeps memory for each thread that compiles). One `VkPipelineCache` is enough: one |
| 2450 | cache per thread, merged, was about as fast. Tested by `pipeline_workers`, `replay_pipeline_compiles` and | 2448 | cache per thread, merged, was about as fast. Tested by `pipeline_workers`, `replay_pipeline_compiles` and |
| 2451 | `d3d12_pipeline_workers`. | 2449 | `d3d12_pipeline_workers`. |
| 2450 | - Large pipelines: a compile takes the driver some hundred bytes of memory for each byte of SPIR-V | ||
| 2451 | ([pipeline_check.md](pipeline_check.md), "Limiting concurrent compilation of large modules"), so compute modules over | ||
| 2452 | 128 KiB and graphics pipelines of 1 MiB or more compile side by side only while their estimates (512 bytes for each | ||
| 2453 | byte of SPIR-V) fit a budget: three quarters of the smaller of the free RAM and the room under the commit limit, read | ||
| 2454 | again whenever a place at the gate (`runtime/src/large_module_gate.h`, one for the process) is given or returned. One | ||
| 2455 | always gets in when none is, so a pipeline larger than the budget compiles alone. An estimate counts in full until | ||
| 2456 | the compile ends, although the driver has taken part of it by then. They get in in the order they came; while the | ||
| 2457 | first in line does not fit, the next behind it that does may pass, as long as all that have passed it would fit the | ||
| 2458 | budget together with it, so that a stream of small ones does not keep it out. The ones a submission waits for (and | ||
| 2459 | those of `LEONIDA_ASYNC_PIPELINES`) go before the warm-up's, which take a quarter of the budget at most and none while | ||
| 2460 | a submission that has large ones is compiling on its workers. A thread that waits for its place holds no PSO's lock, | ||
| 2461 | and one that has a place waits for none. `PipelineCompiles::build` gives a submission | ||
| 2462 | as many jobs for large ones as its smallest could be in at once, largest first; where the next one does not fit, the | ||
| 2463 | job compiles small ones in the meantime. `LEONIDA_SERIAL_BIG_COMPILES=1` compiles them one after another instead, as | ||
| 2464 | before there was a budget, `=0` has no limit, `LEONIDA_BIG_COMPILE_BUDGET_MB` fixes the budget. Measured with | ||
| 2465 | synthetic integer modules never compiled before and the warm-up off (RTX 3080, NVIDIA 621.24, Ryzen 7 5800X3D, 8 | ||
| 2466 | workers and the submitting thread, three alternating runs each): the first submission of 16 modules of 256 KiB takes | ||
| 2467 | 0.8 s instead of 4.0 to 4.8 s, 16 of 512 KiB 2.0 to 2.2 s instead of 10.2 to 11.4, 15 of 1 MiB 5.8 to 6.1 s instead | ||
| 2468 | of 29.2 to 31.2, 12 of 0.5 to 2 MiB 8.0 to 10.5 s instead of 38.9 to 39.9. While the 15 of 1 MiB compile, private | ||
| 2469 | memory peaks 656 to 676 MiB over what it was, instead of 140 to 147 (one compile takes 85 to 131 bytes for each byte | ||
| 2470 | of SPIR-V here, and the driver keeps memory for each thread that compiles). With a budget of 1536 MiB, two at once, | ||
| 2471 | they take 18.5 s and peak 202 MiB over. Not measured: other drivers, and the title. Tested by `big_compile_gate`, | ||
| 2472 | `replay_pipeline_compiles` and `d3d12_big_compute`. | ||
| 2452 | 2473 | ||
| 2453 | **Open:** whether the game uses `D3D12_PIPELINE_STATE_STREAM_DESC` for mesh/RT and which subobject types appear. | 2474 | **Open:** whether the game uses `D3D12_PIPELINE_STATE_STREAM_DESC` for mesh/RT and which subobject types appear. |
| 2454 | The trace will enumerate them. | 2475 | The trace will enumerate them. |
diff --git a/docs/pipeline_check.md b/docs/pipeline_check.md index d5d76cb93..47e3a409c 100644 --- a/docs/pipeline_check.md +++ b/docs/pipeline_check.md | |||
| @@ -256,7 +256,7 @@ acceptance only. | |||
| 256 | 256 | ||
| 257 | A SPIR-V module larger than 4 MiB is "large". [#884](https://github.com/ItsNotRexed/Leonida/issues/884) | 257 | A SPIR-V module larger than 4 MiB is "large". [#884](https://github.com/ItsNotRexed/Leonida/issues/884) |
| 258 | showed why that matters: several compiles that each needed gigabytes of host RAM ran at the same time. Large | 258 | showed why that matters: several compiles that each needed gigabytes of host RAM ran at the same time. Large |
| 259 | modules now share a memory budget (`runtime/test/large_module_gate.h`): each one reserves 512 bytes of RAM per | 259 | modules now share a memory budget (`runtime/src/large_module_gate.h`): each one reserves 512 bytes of RAM per |
| 260 | SPIR-V byte, and they enter the driver while their reservations fit three quarters of the memory available when | 260 | SPIR-V byte, and they enter the driver while their reservations fit three quarters of the memory available when |
| 261 | the run starts, up to `--jobs` of them. One large module always gets in when none is compiling, so a module | 261 | the run starts, up to `--jobs` of them. One large module always gets in when none is compiling, so a module |
| 262 | bigger than the whole budget still compiles, alone among the large ones. Small modules are never held back. On | 262 | bigger than the whole budget still compiles, alone among the large ones. Small modules are never held back. On |