Hi all!
I beg your pardon if this has been asked before, but I was not able to find a similar topic in the knowledge base
I have a very simple (ie mono-threaded) fullscreen OpenGL app. It works fine on many configurations, but on some dual cpu systems framerate becomes really âchoppyâ, ie it continually changes between, say, 5fps and 200fps! Of course, the result is really bad (the animation is not very smooth, as you may imagine)âŚ
I dunno what could be the problem. It shouldnât be a problem with timers because I use timeGetTime (I read that performance timers CAN give problems on multi cpus boxs, but timeGetTime should be safe enough); Iâve also tried to force my mono-threaded app to stay on just one CPU by setting the affinity mask (just in case), but it didnât help.
The problem seems to become worse with bigger textures and when using FBOs (but even with direct rendering to the âtraditionalâ framebuffer itâs still present). It doesnât happen on EVERY multi cpu box, but it happens on both nVidia AND Ati equipped hardware; sometimes, on nVidia, turning off the âoptimize for multi-threaded appsâ option from the nVidia control panel cures the problem, but sometimes itâs still thereâŚ
Has anybody any clue about what could be the cause? Thank to everybody in advance for your timeâŚ
First of all, thank you very much for the quick answer and for the hint! Alas, from what I know performance timers are even more prone to problems on multi-cpu systems⌠Anyway, this shouldnât be the problem because I force the whole process to stay on just one CPU (SetProcessAffinityMask), maybe the problem is elsewhereâŚ?
Yes, but if you read my previous post, this doesnât always solve the problem; moreover, I get the same very problem on ATi cards, so I think that the cause should be elsewhereâŚ
Depending on motherboard, BIOS and CPU (older dual core CPU & mobos), performance counter is not synced between two cores. So⌠in first loop one core execute code⌠then a bit later second core execute next loop. Because performace counters is not synced between cores, it can produce negative delta time between frames. If your physx calculations and animation depends on delta time then gameplay falls apart.
Solution is to stick to one core (set process affinity) or install some updates from AMD (dual core optimizer or such) or Mocrosoft (some KBxxxxxx fix) site.