[fpc-pascal] Division by zero when running SDL program on GPU (NVIDIA)

Rafael Picanço cpicanco42 at gmail.com
Tue Jan 30 12:45:04 CET 2024


Hi everyone, how are you doing?

I am receiving an "FLT divide by zero" error when creating a renderer with

// will default to Direct3d renderer
DL_CreateRenderer(FSDLWindow, -1,
    // error
    // SDL_RENDERER_ACCELERATED or SDL_RENDERER_PRESENTVSYNC
    SDL_RENDERER_SOFTWARE
    );

So, my notebook have two GPUs, an on-board Intel and a discrete NVIDIA ,
and the error happens only on NVIDIA.

Here (https://forum.lazarus.freepascal.org/index.php/topic,66042.0.html)
Jamie suggests that I may need to:

Set8087CW($133f)

and Tron suggests:

SetExceptionMask

Calling these functions during the OnCreate in the main form did not
solve the problem.

Can you shed some light on this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20240130/d2c89c35/attachment.htm>


More information about the fpc-pascal mailing list