FPU exception in IDirect3D9::CreateDevice - Win10


IDirect3D9::CreateDevice() raises FPU exception (“floating point division by zero”) on laptops with dual graphics NVIDIA + Intel. This problem occured since the latest update of Windows 10 (April 2018).

We received many complaints from users of our software product who recently updated Windows 10 on their laptops.

We found a solution - globally disable all FPU exceptions in our app by calling Set8087CW($133F). I’m sure that our code which works with DirectX is correct and there is no mistakes in parameters which we pass to CreateDevice().

This problem didn’t happen with any previous version of Windows 10 or with Windows 8/7/Vista/XP. Also this problem doesn’t occur if manually choose Intel video card for our app. Or run our app on external monitor on NVIDIA card. Desktop computers with NVIDIA graphics also work correctly. And no problems with AMD cards.

We pass D3DCREATE_FPU_PRESERVE flag to CreateDevice() because we need double-precision. If I remove this flag the problem disappears. Or calling Set8087CW($133F) also solves the problem.

Earlier version of DirectX documentation said for D3DCREATE_FPU_PRESERVE : “Indicates that the application needs either double-precision floating-point unit (FPU) or FPU exceptions enabled. Microsoft® Direct3D® sets the FPU state each time it is called.”

We could not imagine that simple call of CreateDevice() may produce FPU exception with this flag.

Even the latest NVIDIA drivers (May 2018) don’t solve this problem.

Our software product creates executable slideshows and it would be difficult to quickly update these files on user’s computers.

Please fix this problem in future version of NVIDIA drivers for better compatibility.


Sample EXE file with a slideshow created in our product:


You can see the error message due to FPU exception in CreateDevice() on a laptop with NVIDIA + Intel dual graphics on Windows 10 (April 2018 update).