Enabling Light propagation volumes on directional light completly freeze entire system

Very simple to reproduce. Just place DirectionalLight on level, and check the Light Propagation Volume checkbox. Entire system will freeze and the only recovery is by hard reset.

Just tried here on the 4.3 Preview, same result. System freeze, but my system recovers stating that the graphics driver crashed. I suspect bad shader somewhere in the pipeline.

To add further detail, running with -d3ddebug, this is what is displayed as the reason for the crash:

D3D11 ERROR: ID3D11Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #378: DEVICE_REMOVAL_PROCESS_AT_FAULT]

So as a potential fix (potential workaround, doesn’t cause a crash and the effect looks right). The following code changes can be made:

Line 474 in LightPropagationVolume.cpp. Remove the next 4 lines and replace with the two below lines:

 VplListBufferUAV.Bind( Initializer.ParameterMap, TEXT( "RWVplListBuffer" ) );
 VplListHeadBufferUAV.Bind( Initializer.ParameterMap, TEXT( "RWVplListHeadBuffer" ) );

Line 418 in ShadowRendering.cpp. Replace the next 4 lines with the below:

GvListBuffer.Bind(Initializer.ParameterMap,TEXT("RWGvListBuffer"));
GvListHeadBuffer.Bind(Initializer.ParameterMap,TEXT("RWGvListHeadBuffer"));
VplListBuffer.Bind(Initializer.ParameterMap,TEXT("RWVplListBuffer"));
VplListHeadBuffer.Bind(Initializer.ParameterMap,TEXT("RWVplListHeadBuffer"));

Then make a change to one of the LPV shaders, like hit enter on the first line (Just to force it to recompile and rebind the parameters)

Now it should no longer crash when turning on LPV. Let me know if you have any issues.

Thanks it works now!

So this will be on 4.3 release?

I tried this fix in the 4.3 preview (from github). I’m afraid it doesn’t work.

LPV is now fixed in cl 2192346, which will be in 4.4. Sorry about that!

This fix not be present on 4.3? There is way to get it? I realy want mix the new Skylight with my work on LPV.

Look:

If you are referring to the fix I provided above, then I see absolutely no reason why it wouldn’t work. I have the latest 4.3 preview. Make sure that you correctly performed the fix

I tried 3 times: I changed the lines in LightPropagationVolumes and ShadowRendering and I added a : //MAJ in every LPV shaders. I compiled UE4. And, when I lunch my game, it crashes.

I tried with the 4.3 (twice) and the 4.3 previous version.

Atm it will not be in 4.3. I have passed it on for consideration in a 4.3 hotfix and we’ll see what happens.

The changes were (<< means remove line, >> means add line)

LPVClearLists.usf

<< RWByteAddressBuffer gVplListHeadBufferRW; 
<< RWByteAddressBuffer gGvListHeadBufferRW; 
>> RWByteAddressBuffer RWVplListHeadBuffer;
>> RWByteAddressBuffer RWGvListHeadBuffer;

<< gVplListHeadBufferRW.Store( i*4, -1 );
<< gGvListHeadBufferRW.Store( i*4, -1 );
>> RWVplListHeadBuffer.Store( i*4, -1 );
>> RWGvListHeadBuffer.Store( i*4, -1 );

LightPropagationVolume.cpp

<< VplListHeadBufferUAV.Bind(Initializer.ParameterMap, TEXT("gVplListHeadBufferRW") );
>> VplListHeadBufferUAV.Bind(Initializer.ParameterMap, TEXT("RWVplListHeadBuffer") );

<< VplListBufferUAV.Bind(Initializer.ParameterMap, TEXT("gVplListBufferRW") );
>> VplListBufferUAV.Bind(Initializer.ParameterMap, TEXT("RWVplListBuffer") );

<< GvListBufferUAV.Bind(Initializer.ParameterMap, TEXT("gGvListBufferRW") );
<< GvListHeadBufferUAV.Bind(Initializer.ParameterMap, TEXT("gGvListHeadBufferRW") );

>> GvListBufferUAV.Bind(Initializer.ParameterMap, TEXT("RWGvListBuffer") );
>> GvListHeadBufferUAV.Bind(Initializer.ParameterMap, TEXT("RWGvListHeadBuffer") );

<< GvListBuffer.Bind(Initializer.ParameterMap,TEXT("GvListBuffer"));
<< GvListHeadBuffer.Bind(Initializer.ParameterMap,TEXT("GvListHeadBuffer"));
<< VplListBuffer.Bind(Initializer.ParameterMap,TEXT("VplListBuffer"));
<< VplListHeadBuffer.Bind(Initializer.ParameterMap,TEXT("VplListHeadBuffer"));

<< Ar << GvListBuffer;
<< Ar << GvListHeadBuffer;
<< Ar << VplListBuffer;
<< Ar << VplListHeadBuffer;

<< FRWShaderParameter GvListBuffer;
<< FRWShaderParameter GvListHeadBuffer;
<< FRWShaderParameter VplListBuffer;
<< FRWShaderParameter VplListHeadBuffer;

LPVCommon.usf
(add a space to cause recompile)

It works. Thanks a lot !

Is it a crash or a freeze? This is a big distinction. The fix above fixes the freezing of the machine (Which results in a GPU crash). But will not fix any crashes of the engine. ie. If you have any translucent materials with LPV on it will crash the engine it appears, this will not resolve that. Please upload log file of crash

It was a freeze but gave a functional solution. Problem fixed.

This needs to be hotfixed, this could potentially stall a lot of people’s work. 4.4 is too far away., Isn’t that the point of pre-releasing before the actual release?

DanielW says: I have passed it on
for consideration in a 4.3 hotfix and
we’ll see what happens.

They’ll try to integrate it in a hotfix/update.

Hi Sitrec - we were actually able to sneak this into the 4.3 build released yesterday. Please let us know if this doesn’t fix your issue.

Hi Shinje - we were able to include this in the 4.3 build. So you should no longer need the workaround.