WastedChances
10-09-2008, 12:48 PM
<p>Greetings,</p><p>I've got several years background programming Win32 applications and was a bit surprised whenI saw the following error after launcing EQ2:</p><blockquote><p><span style="color: #000000;"><span style="color: #ffffff;">E:liveeq2gameclientsrcmain.cpp</span></span></p><p><span style="color: #000000;"><span style="color: #ffffff;">failed to set affinity to CPU 1</span></span></p></blockquote><p>In an effort to curb the system lockups I've been getting since GU49, I decided to disable themulti-processor support in game and manually set the affinity to CPU 0, using Task Manager.Since child processes share affinity with the parent process that created them, I set the affinity forLaunchpad.exe to CPU 0. As expected, EQ2 does start with CPU 0 selected. </p><p>Now I understand you're using SetProcessAffinityMask() to tell EQ2 which processor (or processors) to usehowever it has been my understanding that with a HT processor (single chip with a "real" and virtual CPU)CPU 0 should be the physical CPU and CPU 1 should be the virtual CPU.In past experience with other games that are incompatible with HT processors, forcing them to use CPU 0always resulted in better performance.At any rate, my system is a single Pentium 4 CPU with HTT and running a quick piece of test code I wrote(using the PID for an instance of Notepad.exe) gives:GetProcessAffinityMask()ProcAffinityMask = 3SysAffinityMask = 3which indicates two available CPU. Keep in mind, since I only have one physical chip I actually only haveone CPU and one virtual CPU. Following up with these bits of code, I can toggle between CPU 0 or CPU 1:SetProcessAffinityMask(hProcess, 1) // force CPU 0 onlySetProcessAffinityMask(hProcess, 2) // force CPU 1 onlySetProcessAffinityMask(hProcess, 3) // force all available CPUTaking it one step further, I can manually set Notepad.exe to use CPU 0 via Task Manager and then execute:SetProcessAffinityMask(hProcess, 2)and verifying in Task Manager, CPU 1 is now selected and CPU 0 is unselected (as expected).So it appears the method that EQ2 uses to set process affinity is a bit incorrect. Regardless of wether affinityis set manually in Task Manager, a programmer should be able to toggle via code which CPU to use.I don't really know why it generates the error that it can't use CPU 1 but it seemed like something you mightwant to look into.</p><p>Thanks for readingPS:Even with the error message, EQ2 does still run and remains on CPU 0...</p>