Unreal Engine is exiting due to D3D device being lost. (Error: 0x0 - 'S_OK')

Hello. For w few months I can not use UE4 because of error above. It is happening all the time on the system:

Lenovo Legion Y520 with i5-7300HQ, Intel HD Graphics 630 and Nvidia GeForce GTX 1050Ti

I’ve been looking for solution all over the internet and I think I have tried every possible fix that could have been found on this answer hub or forums, and still no luck for me. Can’t say for sure if older UE4 had this issue, might be Windows 10 updates or the engine, however I did tried to roll back drivers and complete reinstall, still crashing.

From the user perspective it does look like UE4 having problems with working with laptop’s integrated video cards, when starting, it uses GPU 0 instead of GPU 1, and GPU 0 (which is weaker Intel 630) goes up to 100% and display freezes, and starts flashing with interval of a few seconds with performance spikes. I did captures performance tab with GPU on it. At some point I’ve managed to randomly make it run on GPU 1 by the luck on random startup but at some point it has switched back to GPU 0 and crashed. Might be something to do with shader message at the right bottom of the screen but not sure if UI is somehow related here but it is good to mention I guess.

Screenshot of GPU performance during crash: https://i.imgur.com/nnatzuq.png

Screenshot of GPU performance of random lucky start up (apparently the way it meant to be working): https://i.imgur.com/1UcDL1c.png

I’ve tried r.GraphicsAdapter = -2 in ConsoleVariable.ini method which made it work on GPU 1 but still crashed after a while with the same error.

Here is entire .zip file folder of crash report from the test project: https://www.mediafire.com/file/relxjdkud0b0r0q/UE4CC-Windows-E7558E77412B5142E53759A3B8E0DE7F_0000.7z/file

Found solution. Installed UE4 version 4.17 and everything works smooth.

Newest versions produce error above.