Skip to content
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

Unable to run with high NumSamples in RayTracingApplication.cs #2

Open
TekuSP opened this issue May 22, 2018 · 6 comments
Open

Unable to run with high NumSamples in RayTracingApplication.cs #2

TekuSP opened this issue May 22, 2018 · 6 comments

Comments

@TekuSP
Copy link

TekuSP commented May 22, 2018

Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'C:\Users\TekuSP\Desktop\veldrid-raytracer-master\bin\Debug\raytracer\netcoreapp2.0\Shaders\RayTraceCompute-compute.hlsl.bytes'.
at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.File.InternalReadAllBytes(String path)
at System.IO.File.ReadAllBytes(String path)
at RayTracer.RayTracingApplication.LoadShaderBytes(String name) in C:\Users\TekuSP\Desktop\veldrid-raytracer-master\src\raytracer\RayTracingApplication.cs:line 526
at RayTracer.RayTracingApplication.CreateDeviceResources() in C:\Users\TekuSP\Desktop\veldrid-raytracer-master\src\raytracer\RayTracingApplication.cs:line 497
at RayTracer.RayTracingApplication.Run() in C:\Users\TekuSP\Desktop\veldrid-raytracer-master\src\raytracer\RayTracingApplication.cs:line 66
at RayTracer.Program.Main(String[] args) in C:\Users\TekuSP\Desktop\veldrid-raytracer-master\src\raytracer\Program.cs:line 7
Press any key to continue . . .

Happens for example at 80. 8 works fine.

@TekuSP
Copy link
Author

TekuSP commented May 22, 2018

Windows 10 17672.1000.
.NET 4.7.2
.NET Core 2.1.200
NVIDIA 1060 and having all these Windows 10 SDKs https://i.imgur.com/4CohZGF.png

@mellinoe
Copy link
Owner

Hrm, I don't see what that message would have to do with the sample count. Are you sure that is related?

@TekuSP
Copy link
Author

TekuSP commented Jun 3, 2018

Lowering NumSamples removes this issue. Adding more makes this issue.

This is only error I get.

@mellinoe
Copy link
Owner

mellinoe commented Jun 3, 2018

The error is about missing shader bytecode, which could be the same as #1 . I'm not sure how changing NumSamples could affect the loading of shader code, though. I have seen that the compute shader can time out (crash the app), if NumSamples is too high, though.

@TekuSP
Copy link
Author

TekuSP commented Jun 5, 2018

Too high? You mean like 30?
I can replicate this bug by changing NumSamples.

I am running it on NVIDIA 1060 with latest driver. https://pastebin.com/5iz7PYdH

@mellinoe
Copy link
Owner

mellinoe commented Jun 5, 2018

@TekuSP I see what the problem is now. Sorry for doubting you before -- this was a very unusual issue 😅 .

It turns out that if the sample count is too high, the HLSL compiler starts to hit the timeout value that I have in place (2 seconds). It seems that cranking up the outer loop limit causes the compilation to take significantly longer. At 64 samples, it takes about 10 seconds (!) to compile the HLSL compute shader. I've made the FXC timeout much longer to allow for this. On my GTX 770, I'm able to get to about 80 samples before the compute shader starts timing out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants