Shaders loading repeatedly with big lag spikes #3122

Open
opened 2026-12-02 12:18:13 +00:00 by sernartar · 4 comments
sernartar commented 2026-12-02 12:18:13 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by sernartar on 2026-12-02T12:18:13Z.


What happens

Shaders keep loading like every second causing a big lag spike before returning to normal

Commit

2026-12-02

System

Windows 11, Intel Core i5-12600KF, NVIDIA RTX 4060 Ti (8GB VRAM), 32GB RAM

Where

shaders

Command and steps

Hi I'm not sure if there's a setting I missed or if this is a bug Every so often shaders appear to be loading which causes one big lag spike and then things go back to normal I already have all pipelines and shaders ready/warmed up it happens repeatedly during gameplay.

Otherwise, amazing work on the project!

Output

Could not find a log file. I checked the expected log directory from the documentation, but no log file was generated there, and no error message appears when the lag spikes occur.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6744530808 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3122). Originally posted by [sernartar](https://github.com/sernartar) on 2026-12-02T12:18:13Z. --- ### What happens Shaders keep loading like every second causing a big lag spike before returning to normal ### Commit 2026-12-02 ### System Windows 11, Intel Core i5-12600KF, NVIDIA RTX 4060 Ti (8GB VRAM), 32GB RAM ### Where shaders ### Command and steps Hi I'm not sure if there's a setting I missed or if this is a bug Every so often shaders appear to be loading which causes one big lag spike and then things go back to normal I already have all pipelines and shaders ready/warmed up it happens repeatedly during gameplay. Otherwise, amazing work on the project! ### Output ```text Could not find a log file. I checked the expected log directory from the documentation, but no log file was generated there, and no error message appears when the lag spikes occur. ```
fuzer322 commented 2026-12-02 12:26:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by fuzer322 on 2026-12-02T12:26:25Z.


I got the same problem on Ryzen 7800x3d RTX 4070 ti

изображение
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345341478 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3122#issuecomment-7345341478). Originally posted by [fuzer322](https://github.com/fuzer322) on 2026-12-02T12:26:25Z. --- I got the same problem on Ryzen 7800x3d RTX 4070 ti <img width="845" height="334" alt="изображение" src="https://github.com/user-attachments/assets/16a3b7f5-e95f-469f-b163-897f2727471a" />
Ihavesmallpp commented 2026-12-02 12:31:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by Ihavesmallpp on 2026-12-02T12:31:21Z.


I have the same problem, 4060ti i7-14700f

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345464853 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3122#issuecomment-7345464853). Originally posted by [Ihavesmallpp](https://github.com/Ihavesmallpp) on 2026-12-02T12:31:21Z. --- I have the same problem, 4060ti i7-14700f
Dash-Tale commented 2026-12-02 13:37:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by Dash-Tale on 2026-12-02T13:37:16Z.


same problem, 5700X3D RTX 4070

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7347170456 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3122#issuecomment-7347170456). Originally posted by [Dash-Tale](https://github.com/Dash-Tale) on 2026-12-02T13:37:16Z. --- same problem, 5700X3D RTX 4070
fiestorra commented 2026-12-02 14:54:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T14:54:25Z.


What you are seeing has a name in this repository, and it is not a setting you missed: it is the title's pipelines being compiled the first time a place is reached.

d3d12/crates/leonida-gpu/src/pipeline/known.rs opens with the numbers:

The title creates 84,000 pipelines while it loads and draws with some 2,000 of them; which ones is known from earlier runs (library), and those are made during loading. One met for the first time (a place never seen, or everything after a change of the translator or of the driver) is compiled when a draw wants it.

That compile is what freezes the picture for a second or two - the driver's compiler runs on the frame that first asks for it. findings.md counts it too: runs where "270-660 s of a session were full of frames over 200 ms, almost all while new pipelines were made".

What to do about it

In the launcher, Settings: "Precompile every pipeline (-PrecompileAll)", together with "Prepare shaders before starting". It makes them ahead of the run instead of during it - and it is very long the first time (that is the launcher saying so, not me), which is exactly why it is not the default.

From a command line, the two steps are:

scripts\play-nvidia.ps1 -Exe <your package> -SeriesS -PrecompileAll -Log

and, for the pipelines a session met, the next session makes them during loading because they are in the book (known-pipelines.bin, appended as they are found, so a crash does not lose them).

What tells whether it is working

With -Log, in %LOCALAPPDATA%\Leonida\logs\play-*.log:

  • shader preparation 64.5 s on a first start, 0.0 s on later ones - if it is never 0.0, the cache is being thrown away and that is worth a report;
  • host mesh pipeline / first bind lines during play: each one is a pipeline compiled while you wait;
  • pipelines made - loaded - in the launcher's telemetry line.

If you paste the tail of that log with a few of those lines around a spike, I can say whether it is pipelines, textures or something else - none of the four reports here has a log yet, and the logs are what turn this from "it stutters" into a number.

AI-assisted: yes - DeepSeek v4.1 (flash).

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7349341920 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3122#issuecomment-7349341920). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T14:54:25Z. --- **What you are seeing has a name in this repository, and it is not a setting you missed: it is the title's pipelines being compiled the first time a place is reached.** `d3d12/crates/leonida-gpu/src/pipeline/known.rs` opens with the numbers: > The title creates 84,000 pipelines while it loads and draws with some 2,000 of them; which ones is known from earlier runs (`library`), and those are made during loading. **One met for the first time (a place never seen, or everything after a change of the translator or of the driver) is compiled when a draw wants it.** **That compile is what freezes the picture for a second or two** - the driver's compiler runs on the frame that first asks for it. **`findings.md` counts it too**: runs where "270-660 s of a session were full of frames over 200 ms, almost all while new pipelines were made". ## What to do about it **In the launcher, Settings**: **"Precompile every pipeline (-PrecompileAll)"**, together with "Prepare shaders before starting". **It makes them ahead of the run instead of during it** - and it is **very long the first time** (that is the launcher saying so, not me), which is exactly why it is not the default. **From a command line**, the two steps are: ```powershell scripts\play-nvidia.ps1 -Exe <your package> -SeriesS -PrecompileAll -Log ``` and, for the pipelines a session met, **the next session makes them during loading** because they are in the book (`known-pipelines.bin`, appended as they are found, so a crash does not lose them). ## What tells whether it is working **With `-Log`**, in `%LOCALAPPDATA%\Leonida\logs\play-*.log`: - **`shader preparation 64.5 s`** on a first start, **`0.0 s`** on later ones - if it is never 0.0, the cache is being thrown away and that *is* worth a report; - **`host mesh pipeline` / `first bind` lines during play**: each one is a pipeline compiled while you wait; - **`pipelines made - loaded -`** in the launcher's telemetry line. **If you paste the tail of that log with a few of those lines around a spike**, I can say whether it is pipelines, textures or something else - **none of the four reports here has a log yet, and the logs are what turn this from "it stutters" into a number.** **AI-assisted:** yes - DeepSeek v4.1 (flash). Written with an AI assistant.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy#3122
No description provided.