Quote:Also you said thread load must be 100%.. well it's never 100% on Dolphin without Lock Threads on.. or is that not how it calculates it?
I think I mentioned this earlier but not in a very articulate way. Task manager only updates every 1 or 2 seconds, what it is giving you is an average level of activity for those 1-2 seconds. In reality the threads are jumping between 100% and 0% every few nanoseconds as dolphin jumps from on thread to another (so you wind up with 50% for that entire 1-2 seconds). So it is reaching 100% but task manager simply isn't polling the results fast enough (it's actually impossible to do that).
With lock threads to cores off the OS kernel manages the threading instead of dolphin. With lock threads to cores on dolphin just grabs the first two threads available and uses those. Obviously the problem is that with a HT processor the first two logical threads belong to the same physical thread and thus only 1 real core is being used. However this conversation gave me an idea, what if I manually set the second software thread to run on logical thread 3 instead of 2? You just gave me an idea.
Edit: Found the code.
http://code.google.com/p/dolphin-emu/source/browse/trunk/Source/Core/Core/Src/Core.cpp
Line 317 change the 2 to a 3
That will force it to use the first and third logical threads instead of the first and second (so only two logical and two physical cores will be used).
If you can't do it just say so and I'll make the changes myself and compile a build in a few days. Problem is this will break lock threads to cores for people with dual core cpus since it will be assigning the second software thread to logical thread 3 (which doesn't exist on a dual core cpu). But I believe I can add a simple if then else statement to make it use thread 2 if only 2 or 3 threads are detected and use thread 3 instead if 4 or more threads are detected, which would fix that and work out perfectly for all cpus since their are also some dual core cpus that are hyperthreaded.
Edit again: Alright I got on irc and told skid about it (one of the devs), he'll commit the changes soon. Also learned in the process that apparently forcing dolphin to run on only 2 threads has another benefit. Since Intels latest architectures dynamically allocate cache space to each logical thread by using less logical threads each thread will have more usable cache space.
(12-14-2010, 04:45 PM)NaturalViolence Wrote: [ -> ]Quote:Also you said thread load must be 100%.. well it's never 100% on Dolphin without Lock Threads on.. or is that not how it calculates it?
I think I mentioned this earlier but not in a very articulate way. Task manager only updates every 1 or 2 seconds, what it is giving you is an average level of activity for those 1-2 seconds. In reality the threads are jumping between 100% and 0% every few nanoseconds as dolphin jumps from on thread to another (so you wind up with 50% for that entire 1-2 seconds). So it is reaching 100% but task manager simply isn't polling the results fast enough (it's actually impossible to do that).
With lock threads to cores off the OS kernel manages the threading instead of dolphin. With lock threads to cores on dolphin just grabs the first two threads available and uses those. Obviously the problem is that with a HT processor the first two logical threads belong to the same physical thread and thus only 1 real core is being used. However this conversation gave me an idea, what if I manually set the second software thread to run on logical thread 3 instead of 2? You just gave me an idea.
Edit: Found the code.
http://code.google.com/p/dolphin-emu/source/browse/trunk/Source/Core/Core/Src/Core.cpp
Line 317 change the 2 to a 3
That will force it to use the first and third logical threads instead of the first and second (so only two logical and two physical cores will be used).
If you can't do it just say so and I'll make the changes myself and compile a build in a few days. Problem is this will break lock threads to cores for people with dual core cpus since it will be assigning the second software thread to logical thread 3 (which doesn't exist on a dual core cpu). But I believe I can add a simple if then else statement to make it use thread 2 if only 2 or 3 threads are detected and use thread 3 instead if 4 or more threads are detected, which would fix that and work out perfectly for all cpus since their are also some dual core cpus that are hyperthreaded.
Edit again: Alright I got on irc and told skid about it (one of the devs), he'll commit the changes soon. Also learned in the process that apparently forcing dolphin to run on only 2 threads has another benefit. Since Intels latest architectures dynamically allocate cache space to each logical thread by using less logical threads each thread will have more usable cache space.
Nah I'll try it out and compare results. I used to be on the mingw-w64 project, I do know some things about some things, no worries. Didn't realize it would be so easy to switch it like that, cool, this'll be fun to do some testing.
If I knew how to check how many threads there are I could add the thread check myself, but have no idea, maybe I can try and figure it out. Would be uber cool to add the option to Dolphin's config too, but since the devs are doing it I won't go nuts, it'll just be the Lock Threads to Cores option improved.
Gotta use ICC for compile-time SSE4.2 optimizations huh.. Ok..
Would be fun to use mingw-w64 but there's no way it/gcc could hold up in performance sadly.
Ha, it's already done! SVN 6579 has it in there. Gonna build it up.
Their appears to be a bug in the implementation where dolphin only uses one thread....weird. Oh well, skid will fix it soon enough.
(12-15-2010, 03:13 AM)NaturalViolence Wrote: [ -> ]Their appears to be a bug in the implementation where dolphin only uses one thread....weird. Oh well, skid will fix it soon enough.
Was that on your non-HT 4-core, if you enable Lock Threads or always? I'm going to try removing the if->then and see if the bug's in there.
Yeah tell me if that works, and no I have not tried it myself. But a lot of others have reported the problem and they all have cpus with HT.
(12-15-2010, 04:50 AM)NaturalViolence Wrote: [ -> ]Yeah tell me if that works, and no I have not tried it myself. But a lot of others have reported the problem and they all have cpus with HT.
It'll be a while, getting it to work on Visual Studio 2010 was too messy. Sometime tonight.
Oh, and the Intel C++ Compiler 2011 XE offers Intel Performance Primitives, Math Kernel Libraries (Parallel, Sequential, and Cluster,) and Threading Building Blocks.. wonder what I should try..
I kinda miss the simplicity of gcc/make, I find it easier than navigating this complicated GUI and build scripts, hard to see exactly what's going on.
Just build it with vs2010. You can worry about optimizing later, I just want to know if it works.
Visual Studio 2008 is just skipping everything compiling to Win64 and I can't figure out why yet as it doesn't tell me jack. I could try Win32 but I already have VS set up for Win64 and all, I guess I could try, but if I run into errors I don't want to be wasting a ton of time.
I would also appreciate it if you could try settings affinity to 0 and 2 instead of 1 and 3. Line 269 should be the first affinity (or somewhere around there).