Crashes on Nvidia hardware

A few people have told me that my past two samples (Bokeh and RadiosityDX11) were crashing on Nvidia GPU’s, which I verified myself on my coworker’s GTX 470. The crash appears to be a driver bug, since it happens deep in the Nvidia runtime DLL on a worker thread and also because it works fine on AMD hardware and the REF device. This morning we managed to narrow it down to the shadow map filtering shader code (shader code can crash drivers apparently, who knew?), and I suspect that it’s the the fact that shader makes use of a SampleCmp with an integer offset. Commenting out the filtering and replacing it with a single SampleCmp seems to work, but I think using a regular texture coordinate offset might work as well. Anyone want to try putting this into “SampleShadowCascade” in Mesh.hlsl, and let me know if it works?

 

[unroll(NumSamples)]
for (int y = -Radius; y <= Radius; y++)
{
    [unroll(NumSamples)]
    for (int x = -Radius; x <= Radius; x++)
    {
        float2 offset = float2(x, y) * (1.0f / ShadowMapSize);
        float2 sampleCoord = shadowTexCoord + offset;
        float sample = ShadowMap.SampleCmp(ShadowSampler, sampleCoord, shadowDepth).x;
        ...
    }
}

2 thoughts on “Crashes on Nvidia hardware

  1. Yes, this fixes the crash in the Bokeh demo on my GTX 480.
    Finally, I can enjoy your demos. Thanks for the effort!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s