Jump to content

ADVANCED USERS - Improve KSP performance on Intel CPUs with HyperThreading


MDBenson

Recommended Posts

(I don't know if this is in the right forum so feel free to move it)

Okay. I have a very nice i7 2600 in my PC. It's wicked fast and very power efficient for a gaming PC processor and I love it lots.

The problem is it has HyperThreading which in most modern games isn't an issue any more as they multi-thread just fine. However, as most people know, KSP (or at least the physics?) is only capable of using 1 'CPU' or 'Core'. With HyperThreading, Intel divide each physical core into 2 virtual CPUs so, for example, my i7 has 4 physical cores and HT makes that look like 8 virtual cores. Each virtual core is only capable of using a maximum of 50% of the cycles available on the physical core it is on. So what? So that means KSP is confined to 50% of one CPU core's CPU power when it's running. As good as my i7 is, that makes it a bit slow. So what's the miracle cure?

This is for advanced users only who are 100% confident and comfortable changing their motherboard settings in their BIOS/UEFI setup screen, I also provide zero warranty and take zero responsibility for you messing up your PC doing this. It's purely experimental and done at your own risk.

When you boot your PC up to play KSP, enter the BIOS/UEFI settings screen (this is usually a key press at the power-on self-test screen like Del or F2). If in doubt do some RTFM for your motherboard. Navigate to the CPU settings and look for the HyperThreading option. Set it to OFF if you can. You shouldn't need to change anything else. Save your new settings and reboot.

When you reboot the PC after the change you will notice if you open Task Manager in Windows that there are half the number of CPU graphs (if you have it set to graph per CPU) and they match the number of physical cores on your CPU. Also, now, KSP can use 100% of one of the physical cores to run meaning you get 2x the available CPU power you had before. It runs WAAAY smoother on my rig now I've done this and as far as I can see Windows 7 doesn't care and neither do any of my other games or programs.

I have a feeling it might be a possible cure for some people's lag issues.

Link to comment
Share on other sites

...Mother of God...

Thanks for posting this, however this only makes me feel worse about my lag problems as I am not confident with my computer skills and would never attempt something like this...

GAH! So close, yet so far...

Oh well, bad frame-rate for me I guess. :(

Link to comment
Share on other sites

Uh. I don't really follow the goings on of intel, but didn't hyperthreading die with the P4's?

Nope. In fact, hyperthreading is one of the things used to distinguish Haswell i7s from i5s. I don't know if this was true of previous generations.

Link to comment
Share on other sites

Nope. In fact, hyperthreading is one of the things used to distinguish Haswell i7s from i5s. I don't know if this was true of previous generations.

It is true of previous generations (I have an i7-3770k @4.1 ghz that I play ksp on from the Ivy Bridge Generation).

However, the OP's claims are not quite true. Hyperthreading does not limit a single thread to 50% of a core's resources - it is dynamic. As KSP or other games that are single-threaded (such as Oblivion) demand a lot of resources, that thread is given almost the entire core's cycles. It is true, however, that disabling hyperthreading can help, but the performance gains are more on the order of 2-5%.

Link to comment
Share on other sites

It is true of previous generations (I have an i7-3770k @4.1 ghz that I play ksp on from the Ivy Bridge Generation).

However, the OP's claims are not quite true. Hyperthreading does not limit a single thread to 50% of a core's resources - it is dynamic. As KSP or other games that are single-threaded (such as Oblivion) demand a lot of resources, that thread is given almost the entire core's cycles. It is true, however, that disabling hyperthreading can help, but the performance gains are more on the order of 2-5%.

I was going to point that out, but you beat me to it.

The op's tweak won't really do much of anything for KSP sadly, but then, if you have a relatively recent I7 the game should be running pretty decently anyway, it runs nicely on my 4.5ghz I5.

Link to comment
Share on other sites

1. hyperthreading does not reduce your single thread performance in any way. it doesn't split your cores in two, it just allows them to run an additional thread with any unused resources.

2. I don't see how changing the hyperthreading option in your BIOS is in any way advanced dangerous or power or changes your warranty in any way. If you mess up your PC while doing this you should probably go play a console instead.

3. I don't even need to try to know that his will have zero effect on your game performance. Do a scientific and unbiased test yourself to see if there is any change at all before posting crap like these and wasting people's time.

Uh. I don't really follow the goings on of intel, but didn't hyperthreading die with the P4's?

hyperthreading can increase the performance of each of your cores by about 20% when running more than 1 thread with only about 5% increase in number of transistors. it is very clear that future programs will be more and more parallel, utilizing as many threads as you can provide, in these cases, it is basically a free 20% increase in performance, why not?

Hyperthreading went out of fashion for a while because when we used to have true dual core processors, and most applications are not parallel, so making them hyperthreading will not increase general performance.

Edited by 1096bimu
Link to comment
Share on other sites

Intel must have revised it since I owned a P4 HT then because it definitely used to lock out at 50% on a P4. I apologise for the mis-information.

As for if it makes a difference, I've also used HT Atoms (D410 in my case - single core with HT) and got significant speed gains from single-threaded tasks by using them in Uni-core vs. HT mode (for those sad enough to care I was running DEC VAX emulations on it which peg the CPU at 100% when you are compiling code inside the emulator or bootstrapping the OS or really doing anything that would use a lot of CPU cycles on a VAX). With all the background crap running in Windows it effectively allows KSP to shove everything else off one core and get it to itself and make Windows cope using the other 3 cores, surely? Because of the screwed up way Windows prioritises processes it's entirely possible with HT that something with a higher CPU priority can barge in and take CPU cycles off the core that's trying to run KSP. I've noticed this happen several times on my system and it's not just KSP glitching.

Anyway, I definitely noticed a significant positive difference in speed. I played it all evening (about 3 hours on and off). Explain that how you will but it seems like too much of a coincidence to me :) Like I said, it's experimental stuff, try it, if it works then great, if you don't think it makes a difference turn it back on again. Ultimately the Unity engine really needs pushing to multi-thread and 64-bit, but I guess that's out of Squad's hands.

1096bimu I can read stuff in non-bold normal sized text but thanks for the visual aid ;) I don't post stuff unless I've tested it and think it's genuinely useful. If you don't agree then I'm sorry, feel free to ignore the thread. As for the disclaimer? I'm just covering my arse against people who try it, screw something up, then try and peg the blame on me. I speak from bitter experience, sadly.

Link to comment
Share on other sites

i could test it but i am with i5, so no BIOS modifying for me, this is also interesting experiment and idea i would try myself, and certain people really should control themselves KSP community is the tolerant and intelligent one.

Link to comment
Share on other sites

Disregard OPs post. Hyper threading does not reduce performance (on win7/8). It also never reduced your performance to 50% of a single core.

Performance drops were due to bad scheduling in vista and former, it did not distinguish between ogical and physical cpus. "Hyper threading" works by letting another thread take over a CPU (and thus increasing utilization) when the currently active thread blocks - for example when it waits for data from memory.

http://en.wikipedia.org/wiki/Simultaneous_multithreading

This thread is just another one of the many "I did some voodoo and now it feels faster. Cue facepalm. A hard one.

Edited by jfx
Link to comment
Share on other sites

I`m going to give this a go before I poo-poo it and then find it works. There is lots of stuff from intel saying that HT does not slow down single threaded performance but in the real world, if you turn off HT, you get more work from a single core but less work done overall.

Anyone use a framerate thing so we can have some concrete numbers rather than hyperbole (did you see what I did there?)

Link to comment
Share on other sites

I`m going to give this a go before I poo-poo it and then find it works. There is lots of stuff from intel saying that HT does not slow down single threaded performance but in the real world, if you turn off HT, you get more work from a single core but less work done overall.

Anyone use a framerate thing so we can have some concrete numbers rather than hyperbole (did you see what I did there?)

I'm speaking from expereince rather than "poo-pooing" it out of turn, it will make pretty much zero difference, nothing you would even be able to notice if there WAS any difference.

But hey I've just been in this whole pc hardware game for 17 years...lol

Especially if your pc has the turbo boost stuff on, in which case it will already detect that KSP is not using more than one thread and overclock the cpu to whatever it's turbo speed is for you anyway.

Link to comment
Share on other sites

Anyone use a framerate thing so we can have some concrete numbers rather than hyperbole (did you see what I did there?)

Not sure how restricted the later demo editions of 3DMark are, but they'd be a good start. Go into the task manager and tell the process to only run on one core for a fair benchmark, I guess.

That or find something from http://demoscene.ru that gives you a frame rate option.

Link to comment
Share on other sites

When hyperthreading was new I read some benchmarks which showed that single-threading applications were indeed bogged down a bit by hyperthreading. But even back then the performance gain from disabling HT was so low that it was barely noticeable except for in benchmark scores.

Link to comment
Share on other sites

1. hyperthreading does not reduce your single thread performance in any way. it doesn't split your cores in two, it just allows them to run an additional thread with any unused resources.

2. I don't see how changing the hyperthreading option in your BIOS is in any way advanced dangerous or power or changes your warranty in any way. If you mess up your PC while doing this you should probably go play a console instead.

3. I don't even need to try to know that his will have zero effect on your game performance. Do a scientific and unbiased test yourself to see if there is any change at all before posting crap like these and wasting people's time.

1) It was possible it might have helped, not guaranteed.

2) A lot of people don't use computers for much else that the web and light gaming, and won't know what the hell a BIOS is at all. Stop assuming everyone does. And besides, people are on these forums and in this thread because want to play KSP. KSP isn't on consoles.

3) > might be a possible cure

> purely experimental

> some people's

He isn't wasting anyone time or spreading crap, He said several times in the OP that it may not work and never said you MUST do it.

Sit down and shut up.

Link to comment
Share on other sites

Argue it out if you must. It worked for me (quantifiable improvement, no voodoo involved), it might not work for others. I'm done here.

I may yet ask for this thread to be deleted because a helpful suggestion has basically turned into a mud-throwing match, which wasn't my intention.

Link to comment
Share on other sites

I had the issue with my first gen i7 though the main effect disabling HT had was a significant decrease in power use/ temperature, I don't know of any games that significantly benefit from more than 4 cores anyway, so I've just bought the K-series unlocked i5 chips. Also, I did read an article recently on Anandtech I believe where HT did have a negative impact in purely single threaded games, but again, 2-5% difference tops.

Link to comment
Share on other sites

That isn't how hyperthreading works. To the Operating system it appears that there are 8 cores on a 4 core 8 thread hyperthreaded processor. However, both the OS and the hardware are smarter than that for scheduling. Generally the physical cores will be scheduled before the hyperthreaded ones will be. On top of that, if a thread will utilize all of a physical core it WILL. It doesn't use "only 50% of a core". Hyperthreaded cores are setup such that full utilization of a thread will use basically all of the same execution resources that a non-hyperthreaded core would, the difference is that hyperthreaded processors have a extra scheduling (and maybe load/unload? Can't recall) units that a non-hyperthreaded processor doesn't have. Then since most threads really can't use 100% of available execution units (maybe an integer or FPU is left idled by a thread) the processor/OS will run a second thread (if there is a spare one laying around) in the unused execution units, increasing total utilization of the core. Also since these are OoO processors, a lot of time parts of the pipeline can be skipped and/or predictive processing gets it right and you get a jump ahead thus leaving resources idled, which get snapped up by hyperthreading for that extra thread.

However, with the exception of a few poorly written massively threaded applications, disabling hyperthreading rarely increases performance and pretty much never in single threaded applications.

It does mean that anything executed on the hyperthreaded cores are likely to have fewer execution resources that what would run on the physical threads, unless of course what is running on the physical threads is poorly utilizing the resources. You won't get a good indication of this by processor load. the % you see in task manager is NOT % of core resources used, it is simply % of processor cycles utilized. You could have 100% of processor cycles utilized, but only be using 25% of the execution resources on a thread because of how the program is designed, leaving lots of spare resources to run a hyperthreaded thread.

A good way to see the kind of resources different highly threaded programs use is to enable/disable hyperthreading and see the performance difference. In general the difference between non-hyperthread and hyperthreaded is in the realm of 10-20% performance gain in highly threaded tasks (ones that will utilize more threades than available physical cores). In some cases though you can see 30-40% gains from thread that poorly utilize (or can't) execution units.

Link to comment
Share on other sites

Here is a site that benchmarked applications with Hyper Threading on and off using an Ivy Bridge i7. To quote their summary:

"As you can see their are a few applications that perform marginally better, to the tune of one to two percent, with Hyper-Threading disabled. But at the same time there is far more to be gained in terms of performance from leaving Hyper-Threading enabled than there is to be gained from disabling it.

On average the 3770K with Hyper-Threading disabled offers only 90 percent of the performance of the same chip with this feature enabled."

He does go on to say that the newer processors (Ivy and Sandy) have much more efficient Hyper Threading than previous generations, but he doesn't say by how much.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...