-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NVRHI shaderCompiler to retry if parallel compilation fails #3
Conversation
Update to latest main
It's only supported in DX12 so far.
CMakeLists fix for NVRHI shader compiler to support AppleClang
This reverts commit 6cd0688.
…d process or shell issues
Hi Robert - any chance you could have a look at this one? I would like to push a change to RBDoom3BFG that depends on this NVRHI tools fix: Remove macOS-specifics from compileshaders.cmake and revert to original code. I don't think the auto build check failures on Windows are due to this tools PR. UPDATE: added |
9eb2a3a
to
c692489
Compare
1cbc9e9
to
bb9d8ae
Compare
No longer needed since this is now included in main at ShaderMake. |
This corrects an issue with parallel shader compilation on macOS, where a pipe resource limitation is hit that causes occasional failures. Not observed when parallel compilation is disabled.
Solution is to check
pclose()
result + status and retry task again under specific conditions:result == -1
anderrno == ECHILD
) - on all platformsWEXITSTATUS(result) == 127
) - on posix platforms only (linux/macOS)Retries are limited to a minimum total of 10 across all shaders, up to a maximum failure rate of 5%. This should be plenty. Failure rate observed on macOS Monterey is about 3-5 shell failures out of ~360 shader variations, or about 1.0-1.5%. This solution is general but solves the macOS issue.
Tested on Windows 10, Manjaro Linux, and macOS Monterey.