View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003160 | FSSCP | graphics | public | 2015-05-22 04:07 | 2015-05-29 03:57 |
Reporter | Goober5000 | Assigned To | m_m | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Dell Precision M4800 | OS | Windows 7 | ||
Product Version | 3.7.2 | ||||
Fixed in Version | 3.7.3 | ||||
Summary | 0003160: Periodic freezes when running under the NVIDIA GPU | ||||
Description | I alluded to this in ticket 0003130 but didn't elaborate as that was primarily about the beam crash. When running a build using the NVIDIA GPU, the build will periodically and unpredictably freeze. Each freeze lasts from 5 to 15 seconds, and they happen every minute or so, with no apparent pattern. They occur in the main hall, in the tech room, and in the mission. This occurs on builds compiled with 2005, 2008, and 2013. It does *not* occur on builds compiled with VS 6 (at least up to and including 3.7.2 final). This makes me wonder if it's due to a compiler option introduced post-VS6. I doubt it's an overheating problem as the laptop has plenty of ventilation and doesn't feel particularly hot. And I doubt it's a driver problem as I updated the drivers about five times in the course of testing 0003130. | ||||
Tags | No tags attached. | ||||
|
Interesting update. After Googling around using "Dell Precision M4800 graphics stutter", I ran across this thread: http://forums.totalwar.com/showthread.php/147456-Issue-Stuttering-and-freezing-from-intro-cinematic-to-main-menu/page2 In the Task Manager, my process affinity was set to only use CPU 1 (the available choices where All Processors and CPU 0 through CPU 7, all with checkboxes). I messed around with the checkboxes a bit and when I set it to use All Processors, the stuttering stopped! Is there a setting for changing the CPU affinity when the game starts up, just as there is for changing the GPU? If so, we could ensure that the CPU and GPU are changed in the same block of code. |
|
Incidentally, changing the CPU affinity does not prevent the beam crash bug. :sigh: |
|
Solutions seem to exist (see: http://stackoverflow.com/questions/12803585/example-usage-of-setprocessaffinitymask-in-c-c for Windows, http://stackoverflow.com/questions/8486314/setting-processor-affinity-with-c-that-will-run-on-linux for Linux, unsure about MacOS). |
|
Additionally, Windows should default to everything having affinity for all available processes; it sounds like you've got something setting Explorer's affinity to a single core: http://blogs.msdn.com/b/oldnewthing/archive/2005/03/21/399688.aspx |
|
FSO actively set the processor affinity to the second core when there are multiple cores on the system (https://github.com/scp-fs2open/fs2open.github.com/blob/master/code/osapi/osapi.cpp#L126). I can't think if any good reason to actually do this and messing with the OS scheduler isn't such a great idea. @Goober: Does the issue still exists if you remove that line? |
|
...What. We have a registry setting for processor affinity? Is that documented anywhere? |
|
The affinity being set was added years ago do to a problem with certain processors not liking FSO being set to run on multiple cores. There is a thread on it in either the SCP forum or the internal. http://www.hard-light.net/forums/index.php?topic=55990 |
|
This is also not the first time the automatic affinity setting has caused performance issues for somebody: http://www.hard-light.net/forums/index.php?topic=82620.msg1649312#msg1649312 |
|
Forcing a process to run on a single core doesn't seem like a generally good idea, the scheduler should take care of that. I'll see if removing that code causes any issues. Could we add a commandline option that forces the processor affinity instead of defaulting to use a single core? |
|
I did some experiments with setting the registry entry to 0 (no preference) without any issues last night. |
|
The issue only affected specific processors so in order to test you would need to find out which processor line(s) had the flaw and who still has one. |
|
@m!m: Yes, commenting out the line removes the stuttering, and I confirmed via Task Manager that all CPUs were selected. |
|
We now have multiple confirmed cases where setting the process affinity causes issues. I think that is reason enough to use the default affinity and only set it when a commandline flag is present. |
|
Seems pretty clear-cut to me. |
|
It can be set that late into the runtime? |
|
The documentation for SetProcessAffinityMask doesn't mention any restriction as to when this function may be called. |
|
It's already set in response to a registry entry; it's hardly a huge difference in how long the executable has been running to set it in response to the commandline. In fact, parse_cmdline() is actually called earlier. |
|
Pull request with the discussed changes: https://github.com/scp-fs2open/fs2open.github.com/pull/131 |
|
@Goober: Can you do a final test with the newest nightly now that the PR got merged? |
|
Newest nightly works without any stuttering. |
|
Marking as fixed. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-05-22 04:07 | Goober5000 | New Issue | |
2015-05-22 04:08 | Goober5000 | OS | => Windows 7 |
2015-05-22 04:08 | Goober5000 | Platform | => Dell Precision M4800 |
2015-05-22 05:03 | Goober5000 | Note Added: 0016717 | |
2015-05-22 05:12 | Goober5000 | Note Added: 0016719 | |
2015-05-22 05:13 | Goober5000 | Status | new => confirmed |
2015-05-22 05:55 | The_E | Note Added: 0016721 | |
2015-05-22 06:02 | MageKing17 | Note Added: 0016722 | |
2015-05-22 07:29 | m_m | Note Added: 0016723 | |
2015-05-22 07:38 | MageKing17 | Note Added: 0016724 | |
2015-05-22 07:48 | FUBAR-BDHR | Note Added: 0016725 | |
2015-05-22 07:54 | FUBAR-BDHR | Note Edited: 0016725 | |
2015-05-22 08:04 | MageKing17 | Note Added: 0016726 | |
2015-05-22 10:31 | m_m | Note Added: 0016727 | |
2015-05-22 18:14 | MageKing17 | Note Added: 0016728 | |
2015-05-22 18:25 | FUBAR-BDHR | Note Added: 0016729 | |
2015-05-23 19:27 | Goober5000 | Note Added: 0016730 | |
2015-05-26 17:34 | m_m | Note Added: 0016731 | |
2015-05-26 19:54 | The_E | Note Added: 0016732 | |
2015-05-26 20:38 | chief1983 | Note Added: 0016733 | |
2015-05-26 20:42 | m_m | Note Added: 0016734 | |
2015-05-26 21:36 | MageKing17 | Note Added: 0016735 | |
2015-05-26 22:01 | m_m | Note Added: 0016736 | |
2015-05-27 12:34 | m_m | Note Added: 0016737 | |
2015-05-28 04:25 | Goober5000 | Note Added: 0016739 | |
2015-05-29 03:57 | Goober5000 | Note Added: 0016741 | |
2015-05-29 03:57 | Goober5000 | Assigned To | => m_m |
2015-05-29 03:57 | Goober5000 | Status | confirmed => resolved |
2015-05-29 03:57 | Goober5000 | Resolution | open => fixed |
2015-05-29 03:57 | Goober5000 | Fixed in Version | => 3.7.3 |