SFML community forums

General => General discussions => Topic started by: eigenbom on January 25, 2018, 03:14:49 am

Title: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: eigenbom on January 25, 2018, 03:14:49 am
Here's a community announcement: If your game is stuttering it may be due to something called Nvidia Threaded Optimisation. See this Stack Overflow thread (https://stackoverflow.com/questions/36959508/nvidia-graphics-driver-causing-noticeable-frame-stuttering/37632948#37632948) for an analysis and solution of the issue. The easier way to fix it is to register an Nvidia profile that disables the optimisation in an installer. The key triggers of this problem for me seemed to be Nvidia Card, OpenGL, Multiple Threads, and FBOs.

There are discussions of this in other threads, but I thought I'd make one focusing on this exact issue. I hope some future SFMLer finds this before tearing all their hair out like I've done. It plagued me for years!
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: eXpl0it3r on January 25, 2018, 07:37:04 am
While this is true, the real origin of the problem are the GL checks that happen in debug mode.
If you build your application in release mode where the GL checks are removed, the game should run fine even with Nvidia's thread optimization active.
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: eigenbom on January 25, 2018, 09:44:47 am
Good to know. In my case I encountered the stuttering with the RelWithDebInfo build. Maybe that calls glCheck, I'm not sure.
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: eXpl0it3r on January 25, 2018, 10:07:11 am
What I really meant was, if SFML_DEBUG is defined, which gets defined when NDEBUG is not defined. Only then will glCheck be used.

See this topic: https://en.sfml-dev.org/forums/index.php?topic=22343.0
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: eigenbom on January 25, 2018, 11:38:20 am
Thanks for the link.

Unfortunately there's never just one cause of stutter. For instance, I had to heavily patch SFML to remove the multiple render target contexts due to stutter. Disabling those glChecks is certainly something to try.
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: anthnich on January 26, 2018, 06:23:54 am
FYI, you can use NVAPI (https://developer.nvidia.com/nvapi) to set a custom profile to force disable threaded optimization for your project.

That setting is pretty controversial and has been for while. I'm not a fan of it being enabled.
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: willm127 on February 20, 2018, 08:02:58 am
Anyone know how this affects Macs? I'm on a 2013 Macbook Pro that uses a built-in Intel Iris.

I also find that the game stutters every ten seconds or so, whether the game is running with vSync on or off.

Thanks for the info!
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: FredSteadman on August 22, 2018, 01:06:55 pm
Here's a community announcement: If your game is stuttering it may be due to something called avis sur phenq (https://www.outlookindia.com/outlook-spotlight/phenq-avis-meilleure-pilule-de-perte-de-poids-2023-phenq-france-canada-french-2-achet%C3%A9s-1-offert-news-316639) Nvidia Threaded Optimisation. See this Stack Overflow thread[/url] for an analysis and solution of the issue. The easier way to fix it is to register an Nvidia profile that disables the optimisation in an installer. The key triggers of this problem for me seemed to be Nvidia Card, OpenGL, Multiple Threads, and FBOs.

There are this in other threads, but I thought I'd make one focusing on this exact issue. I hope some future SFMLer finds this before tearing all their hair out like I've done. It plagued me for years!

Thanks for the info. Disabling the optimisation in the installer through an Nvidia profile solved my problem.
Title: Re: Game stuttering? It could be Nvidia Threaded Optimisation.
Post by: eigenbom on August 25, 2018, 05:29:06 am
Glad to hear it!