fix(host): room in the drivers' shader caches for the prepared pipelines (Linux) #2033
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2033
Loading…
Reference in a new issue
No description provided.
Delete branch "driver-cache-room"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The preparation builds its predicted pipelines into the driver's own shader cache only. On Linux, NVIDIA's cache is capped at 1 GiB by default, and a full preparation needs about 1.8 GB. So the driver throws away close to half of what the preparation just built, and play compiles it again. This raises the cap for the game process.
What changes
host/hos_main.c): the game process gets__GL_SHADER_DISK_CACHE_SIZE=10737418240(NVIDIA) andMESA_SHADER_CACHE_MAX_SIZE=10G(Mesa: RADV, ANV) before anything loads Vulkan. Mesa's default is also 1 GiB.setenv(..., 0), so a value the player set, or one fromhookshot_env.txt, is kept.tests/test_driver_cache_room.pychecks that both variables are set without overwriting, that the NVIDIA size is at least 4 GiB, and that this happens before the window (SDL) can load Vulkan.Why the pipelines go missing
predict_runbuilds the predicted pipelines withdriver_cache_only, so they are kept only in the driver's cache, not inmkw_vk_pipelines.bin. That is deliberate: our own cache file is read in whole at every start. It means the driver cache has to be big enough to hold them.Numbers
Setup: RTX 3090, Linux, NVIDIA driver, OoT 1.1.1, a full preparation from an empty driver cache. That is 43,414 predicted pipelines plus 1,261 listed ones and 9,925 compute pipelines.
Not tested
Heads-up: the Windows display startup fixture now fails to compile because its extracted startup block calls
driver_cache_room()without a declaration. I reproduced it with Windows LLVM on mainf8efe057and on both #1954 and #2035. The Windows source job shows the same error. The missing declaration is in the fixture; the Windows build is separate.