FPU exception in IDirect3D9::CreateDevice - Win10

Hi,

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.

Thanks,

Sample EXE file with a slideshow created in our product:

https://files.wnsoft.com/test/pte9016.exe

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).

I can confirm this issue still exists. On a notebook MSI Modern 15 when the setting is set to High-performance Nvidia Card for all applications, our Delphi application can’t CreateDevice with D3DCREATE_FPU_PRESERVE flag (no problem when the system chooses on-board graphics). Set8087CW seems to help, but we need to call it also after CreateDevice otherwise the FPU state produces errors and exceptions in the previously working code not related to DirectX.

Sorry for bumping. I’m not the same person, but googling [ Nvidia D3DCREATE_FPU_PRESERVE ] shows this post as the first result. And I think that still something is wrong with the mobile drivers.

EDIT: NVidia driver version 471.96