Support custom shader/pipeline cache directory (e.g., VICTORY_CACHE_DIR) / 支持自定义着色器与管线缓存目录 #810

Closed
opened 2026-11-28 06:41:01 +00:00 by github-bot · 5 comments
Owner

@⁠Txd2475066993 on GitHub · 2026-11-28 06:35 UTC · original

你好!非常感谢你对这个项目的开发与维护。

目前 victory 默认将着色器(shader)和管线(pipeline)缓存存放在 C 盘的 %LOCALAPPDATA%\victory 目录下。在进行着色器预加载后,该目录体积很容易增长到 10GB 以上。由于 C 盘通常是容量相对紧张的系统盘,大体积缓存很容易占满空间。

考虑到项目中已经使用了 VICTORY_ADAPTER、VICTORY_EARLY_DEPTH 等环境变量进行配置,能否增加一个环境变量(例如 VICTORY_CACHE_DIR 或 VICTORY_DATA_DIR)来允许用户自定义缓存存放路径?

建议逻辑:

当设置了 VICTORY_CACHE_DIR(或 VICTORY_DATA_DIR)时,将编译好的着色器/管线缓存保存到指定目录。

未设置时,保持当前的默认行为(使用 %LOCALAPPDATA%\victory)。

(可选) 体积较小的 .log 日志文件可继续留在 %LOCALAPPDATA%\victory\logs 或随自定义目录存放;同时如果能在文档中简单说明驱动或版本更新后哪些旧缓存文件可以安全清理,对用户排查空间占用会更有帮助。

感谢考虑这个建议!

Hi! Thanks for your great work on this project.

Currently, victory stores its shader and pipeline caches under %LOCALAPPDATA%\victory on the C: drive. When preloading shaders, this cache directory easily grows to 10+ GB. Since the C: drive is usually the system drive with limited storage space, large shader caches can quickly fill it up.

Since the project already uses environment variables like VICTORY_ADAPTER and VICTORY_EARLY_DEPTH, would it be possible to add an environment variable (such as VICTORY_CACHE_DIR or VICTORY_DATA_DIR) to customize the storage location?

Suggested behavior:

If VICTORY_CACHE_DIR (or VICTORY_DATA_DIR) is set, store the compiled shader/pipeline caches in that path.

If unset, keep the current default behavior (%LOCALAPPDATA%\victory).

(Optional) Keep lightweight .log files in %LOCALAPPDATA%\victory\logs or place them alongside the custom directory, and briefly document which files can be safely cleaned up after driver/build updates.

Thanks for considering this!

**@⁠Txd2475066993** on GitHub · 2026-11-28 06:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/810) 你好!非常感谢你对这个项目的开发与维护。 目前 victory 默认将着色器(shader)和管线(pipeline)缓存存放在 C 盘的 %LOCALAPPDATA%\victory 目录下。在进行着色器预加载后,该目录体积很容易增长到 10GB 以上。由于 C 盘通常是容量相对紧张的系统盘,大体积缓存很容易占满空间。 考虑到项目中已经使用了 VICTORY_ADAPTER、VICTORY_EARLY_DEPTH 等环境变量进行配置,能否增加一个环境变量(例如 VICTORY_CACHE_DIR 或 VICTORY_DATA_DIR)来允许用户自定义缓存存放路径? 建议逻辑: 当设置了 VICTORY_CACHE_DIR(或 VICTORY_DATA_DIR)时,将编译好的着色器/管线缓存保存到指定目录。 未设置时,保持当前的默认行为(使用 %LOCALAPPDATA%\victory)。 (可选) 体积较小的 .log 日志文件可继续留在 %LOCALAPPDATA%\victory\logs 或随自定义目录存放;同时如果能在文档中简单说明驱动或版本更新后哪些旧缓存文件可以安全清理,对用户排查空间占用会更有帮助。 感谢考虑这个建议! Hi! Thanks for your great work on this project. Currently, victory stores its shader and pipeline caches under %LOCALAPPDATA%\victory on the C: drive. When preloading shaders, this cache directory easily grows to 10+ GB. Since the C: drive is usually the system drive with limited storage space, large shader caches can quickly fill it up. Since the project already uses environment variables like VICTORY_ADAPTER and VICTORY_EARLY_DEPTH, would it be possible to add an environment variable (such as VICTORY_CACHE_DIR or VICTORY_DATA_DIR) to customize the storage location? Suggested behavior: If VICTORY_CACHE_DIR (or VICTORY_DATA_DIR) is set, store the compiled shader/pipeline caches in that path. If unset, keep the current default behavior (%LOCALAPPDATA%\victory). (Optional) Keep lightweight .log files in %LOCALAPPDATA%\victory\logs or place them alongside the custom directory, and briefly document which files can be safely cleaned up after driver/build updates. Thanks for considering this!
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 06:41:01 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 06:35 UTC · original

Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-28 06:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/810#issuecomment-7235394007) Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Author
Owner

@⁠kibagami-nc on GitHub · 2026-11-28 06:46 UTC · original

Both already exist, and so does a third that moves everything at once.

  • VICTORY_HOME: everything of ours goes there, including settings, logs, caches, saves and downloads. For a full C: drive this is the simplest:
    setx VICTORY_HOME D:\victory
    
  • VICTORY_CACHE_DIR: only the caches move (translated shaders, pipelines, the prepared game images):
    setx VICTORY_CACHE_DIR D:\victory-cache
    
  • VICTORY_DATA_DIR: the same for the data folder (saves). It must not be inside the cache folder.

setx takes effect in programs started after it, so open a new window or sign in again first. The same paths can also go in victory.toml as cache_dir and data_dir; the environment variables win over the file.

When started directly, victory.exe follows all three. The script launchers keep VICTORY_CACHE_DIR and VICTORY_DATA_DIR. They dropped VICTORY_HOME until #774.

On cleaning up: the cache folder holds only things that are made again when missing. Deleting it is safe; the next start just takes longer while it translates again. Your saves are in the data folder, not in the cache.

**@⁠kibagami-nc** on GitHub · 2026-11-28 06:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/810#issuecomment-7235513351) Both already exist, and so does a third that moves everything at once. - **`VICTORY_HOME`**: everything of ours goes there, including settings, logs, caches, saves and downloads. For a full C: drive this is the simplest: ``` setx VICTORY_HOME D:\victory ``` - **`VICTORY_CACHE_DIR`**: only the caches move (translated shaders, pipelines, the prepared game images): ``` setx VICTORY_CACHE_DIR D:\victory-cache ``` - **`VICTORY_DATA_DIR`**: the same for the data folder (saves). It must not be inside the cache folder. `setx` takes effect in programs started after it, so open a new window or sign in again first. The same paths can also go in `victory.toml` as `cache_dir` and `data_dir`; the environment variables win over the file. When started directly, victory.exe follows all three. The script launchers keep `VICTORY_CACHE_DIR` and `VICTORY_DATA_DIR`. They dropped `VICTORY_HOME` until #774. On cleaning up: the cache folder holds only things that are made again when missing. Deleting it is safe; the next start just takes longer while it translates again. Your saves are in the data folder, not in the cache.
github-bot changed title from [Feature Request] Support custom shader/pipeline cache directory (e.g., VICTORY_CACHE_DIR) / 支持自定义着色器与管线缓存目录 to Support custom shader/pipeline cache directory (e.g., VICTORY_CACHE_DIR) / 支持自定义着色器与管线缓存目录 2026-11-28 21:37:31 +00:00
Author
Owner

@⁠hussainmussa on GitHub · 2026-11-29 08:46 UTC · original

/claim

As said above, the settings exist in the code (VICTORY_CACHE_DIR, VICTORY_DATA_DIR, VICTORY_HOME, and cache_dir / data_dir in victory.toml), but the README only names VICTORY_HOME. I'll send a README change that documents them, which one wins, and where the cache folder is by default (also asked in #496).

Written with help from Claude.

**@⁠hussainmussa** on GitHub · 2026-11-29 08:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/810#issuecomment-7253325575) /claim As said above, the settings exist in the code (`VICTORY_CACHE_DIR`, `VICTORY_DATA_DIR`, `VICTORY_HOME`, and `cache_dir` / `data_dir` in `victory.toml`), but the README only names `VICTORY_HOME`. I'll send a README change that documents them, which one wins, and where the cache folder is by default (also asked in #496). Written with help from Claude.
Author
Owner

@⁠kalberts0089-hash on GitHub · 2026-11-29 09:23 UTC · original

@⁠Txd2475066993 thanks for the request. kibagami-nc covered the variables. Here's the cleanup part you asked about, with what changed in v2026.11.29.01:

  • Clearing after an update or a driver change: victory.exe clear-shaders, or "CLEAR SHADER CACHE (RESTARTS THE GAME)" in the F1 menu, deletes <cache_dir>\shaders and <cache_dir>\pipelines. It leaves images, the translated title, which is slow to make again. Settings, saves and logs aren't touched (apps/victory/src/play.rs:252-264).
  • The pipeline library no longer grows forever: every translator change stored its pipelines under new names next to the old ones. One library held 80,703 pipelines in 4.78 GB, and the run loaded 986 of them. Now, once the library passes VICTORY_LIBRARY_KEEP_MB (default 1024), it is rebuilt at the end of a run with only the pipelines that run used (crates/victory-gpu/src/pipeline/library.rs:1160-1168).
  • Play-VIctory.cmd now follows VICTORY_HOME too (4b5cc03d). Before, it put cache-pareto back on C:.

Two things no VICTORY_* variable moves:

  • The NVIDIA driver's own shader cache, %LOCALAPPDATA%\NVIDIA\DXCache, which keeps the pipelines a preload warms up. Its size limit is NVIDIA Control Panel > Manage 3D settings > Shader Cache Size. Disk Cleanup's "DirectX Shader Cache" clears it.
  • A tiny advisor-shown\<build> marker, always under %LOCALAPPDATA%\victory (crates/victory-gpu/src/host/panel.rs:708).
**@⁠kalberts0089-hash** on GitHub · 2026-11-29 09:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/810#issuecomment-7253735589) @⁠Txd2475066993 thanks for the request. kibagami-nc covered the variables. Here's the cleanup part you asked about, with what changed in v2026.11.29.01: - **Clearing after an update or a driver change:** `victory.exe clear-shaders`, or "CLEAR SHADER CACHE (RESTARTS THE GAME)" in the F1 menu, deletes `<cache_dir>\shaders` and `<cache_dir>\pipelines`. It leaves `images`, the translated title, which is slow to make again. Settings, saves and logs aren't touched (`apps/victory/src/play.rs:252-264`). - **The pipeline library no longer grows forever:** every translator change stored its pipelines under new names next to the old ones. One library held 80,703 pipelines in 4.78 GB, and the run loaded 986 of them. Now, once the library passes `VICTORY_LIBRARY_KEEP_MB` (default 1024), it is rebuilt at the end of a run with only the pipelines that run used (`crates/victory-gpu/src/pipeline/library.rs:1160-1168`). - **`Play-VIctory.cmd` now follows `VICTORY_HOME` too** (4b5cc03d). Before, it put `cache-pareto` back on C:. Two things no `VICTORY_*` variable moves: - The NVIDIA driver's own shader cache, `%LOCALAPPDATA%\NVIDIA\DXCache`, which keeps the pipelines a preload warms up. Its size limit is NVIDIA Control Panel > Manage 3D settings > Shader Cache Size. Disk Cleanup's "DirectX Shader Cache" clears it. - A tiny `advisor-shown\<build>` marker, always under `%LOCALAPPDATA%\victory` (`crates/victory-gpu/src/host/panel.rs:708`).
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-29 23:07 UTC · original

Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed).

If it still happens on v2026.11.29.05, please open a new issue with the newest play log from %LOCALAPPDATA%\victory\logs\ and crashes.log, and we'll look at it there.

**@⁠trustno1-coder** on GitHub · 2026-11-29 23:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/810#issuecomment-7264218539) Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed). If it still happens on [v2026.11.29.05](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.05), please open a new issue with the newest play log from `%LOCALAPPDATA%\victory\logs\` and `crashes.log`, and we'll look at it there.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA#810
No description provided.