Jump to content
Sign in to follow this  
bensdale

Win7 and Hyper Threading (I7 cpu)

Recommended Posts

I have a litle testet with enable and disable HT on my I7920 cpu and ArmA2.

many tests sites says the HT preformance from Win7 is alot improve and works mutch better than Vista. Win7 forces to use the 4 native cores by games and only for bottlenecks uses a virtual core.

I have this testet with OFPDR (yes i know bad example ;) ) and Arma2.

OFP DR uses core Nr. 0,2,4,6 (there ar the native cores with HT on)

Arma 2 uses all cores and if i set manual the cores to 0,2,4,6 ArmA2 run absolutly bad.

If i disable HT in the bios so ArmA2 and OFPDR uses logically core nr. 0,1,2,3 (no virtual core between) and ArmA2 works fine.

so was is the point..

I think that is a ArmA 2 problem and it would be nice it would fixed.

I know it is absolutly no problem to disabel HT in the bios for a smooth ArmA. But for new ArmA2 Gamers and technical less talented peoples is this very confusing and complicated (its not user-friendly).

Sorry i think there was a simlar thread with this theme, but i can't find it :o

And sorry for my bad english

Greetig

Edited by bensdale

Share this post


Link to post
Share on other sites

Addonsync at least warns the user :)

Also it will restrict the selectable number of cores for the -cpucount option to the number of real cores, so you won't be lured into launching with -cpucount=8.

That's about as much as i can do to tackle the issue.

Share this post


Link to post
Share on other sites

With HT ON I found that ARMA2 runs better with -cpucount=2

I haven't compared when HT is OFF yet. (Need it for work)

Share this post


Link to post
Share on other sites

I run it off because i also run my cpu overclocked. Saves a few degrees in terms of temprature. Other than that I can't tell any difference performance wise in Win 7 x64. But then again, I've never had an eye for FPS (luckily?).

Share this post


Link to post
Share on other sites

If you manually set the affinity to the physical cores in arma 2 it causes a problem where all data is fighting for usage of the cores believing it has more cores than it actually has (this is because it initially loads with all cores accessable then changes affinity leaving too many threads to fight over the limited resources)

as mentioned, if you plan to run with HT enabled then run with -cpucount=4 ( if it's still causing issues use 2, I run a non HT quad core and get slighty better performance with 2 cores than 4 cores specified by cpucount due to the slight performance difference from CPU switching)

Share this post


Link to post
Share on other sites
If you manually set the affinity to the physical cores in arma 2 it causes a problem where all data is fighting for usage of the cores believing it has more cores than it actually has (this is because it initially loads with all cores accessable then changes affinity leaving too many threads to fight over the limited resources))

Thats a good comment why the manually set of cores not working. Now i understand why ArmA 2 so bad works with manually set cores.

THX for this :thumbsup:

if i use cpu count 4 and HT on, would Win7 not use 2 native and 2 virtual cores? Or force Win7 the use of 4 native cores?

Edited by bensdale

Share this post


Link to post
Share on other sites

As far as I know there is no real reason to limit anything with the cpucount parameter if the only (heavy) thing you run on your computer is Arma.

The game does not run enough (heavy) threads to take advantage of hyperthreading which is why you will get at least equal performance if not better with HT off - The game seems to use 3 (heavy) threads total, 1 of those being for AI. Sure the game has a lot more threads than this (checked using procmon) but they don't seem to use noticeable CPU power so they don't really matter for anything.

Since hyperthreading means you run 2 threads on one core with somewhat faster than 1/2 speed for each, hyperthreading only helps if you actually run 8 (or close to 8) threads that require significant CPU power, but it doesn't do anything useful when you only run 3. I'm assuming running a single thread running on a core with HT off will run faster than running that same single thread on a single virtual core with HT on, and thus Arma 2 will always perform better (or at least as good) with HT off.

Sure the game can be made to use multiple cores (by spreading the load to more threads), but that takes time effort and money, which TBH I'd rather see spent on other aspects of the game, such as improving the graphical performance. The only time my CPU will become the bottleneck is when the game needs to make extreme amounts of AI calculations. Maxing out graphic settings all the way will make my HD4890 be the bottleneck, CPU (even if you only look at the 2 threads used for the game) will not work hard at all. The only important thing that could be done regarding multiple core optimization is making AI use more than 1 thread so that PCs with multiple cores can run more AI. Though I can see why you'd need the other threads have their load split up as well if you happened to make the mistake and buy a slow quad-core CPU (in which case you should have just bought a fast dual-core at the same price).

OFPDR is made for consoles as well, and I suppose that to make it work on 3-4 year old hardware they simply had to write it with more threads (XBOX 360 and PS3 allow you to run up to 6 threads simultaneously AFAIK). We can see how much time they then had to make the actual game and we all know the results... Sure that's most likely not the real reason and is total BS, but it's a funny thought nonetheless :)

Bottom line is that HT does no good for Arma 2 because it doesn't use enough threads since it is easier to not split up your code to multiple threads. If you have an i7 the only thing that can make your CPU become the limit is if you run very heavy on the AI. In open ground with non-OC i7 you should be able to handle hundreds of AI before you get performance drop, in regular towns 100-200 and in very dense user-made environment - around 30-50 (that is, when all AI are actually active (patrolling/fighting) and not standing idle, or else numbers would be much higher as idle AI barely use any CPU power compared to active AI). If you don't have an i7 then you don't need more than 2-4 threads anyway.

Edited by galzohar

Share this post


Link to post
Share on other sites

You are mixing up the multithread with multiCPU.

Multithreading means running two or more calculation cycles at the same time rather than one after another. Like doing AI and Physics calculations at the same time. The limitation is more of a design & technology issue rather than time & money. One of the main issue you need to handle is the dependency between those calculations.

PC already uses whatever is available to calculate the given job if you do not assign CPU cores to the application. It will assign the CPUs at the start roughly by judging the load on them.

So ArmA2 is a 2 threaded game because they've managed to split some AI calculations from other calcs while keeping the dependencies and synchronization intact.

If it was possible (or even meaningful) to split geometry and make all threads talk to each other, they would probably do so and it would be a 3-threaded game utilizing 3 cores.

This would of course kill the game performance for all the 2-core players. So you see, not only it is a design issue, it is a business/financial choice as well

Share this post


Link to post
Share on other sites

I'm not mixing anything up. To use more cores you need more threads as a single thread cannot run on more than 1 core (virtual with HT or real without HT) at the same time. So basically the number of cores you can use is limited by the number of threads the application uses, of course after neglecting threads that only take a small fraction of the CPU power.

Oh, and the game already seems to run 3 heavy threads on clients (but only 2 on dedicated servers), based on the results of my and other people's experimentations, and people with an i7 (and a current top-end video card) will only really make their CPU reach its limits by playing with heavy AI action going on, which will really only load one thread and thus only one core, so the only thing you can do to make it work better is making that core run faster by OCing and/or disabling HT. If BIS would at least find a way to split the AI thread up then i7 users (as well as servers with more than 2 cores) could get a lot more out of this game.

They already spawn less threads for CPUs with less cores for that exact purpose. Spliting the workload to more threads is almost always possible, it just takes a lot of extra work and effort to make it work out as intended which is probably something BIS is not willing to do. Whether or not it is justified is arguable, but saying that they would do it if it would've been possible is flat out wrong, because it IS possible and they still didn't do it.

Share this post


Link to post
Share on other sites

wow very god and detailed comment :thumbsup:

I have a last question ;)

has cpu count 4 (with HT on), basically the same effect like disable HT ?

Share this post


Link to post
Share on other sites

No. Disabling HT makes the CPU actually not use that feature and (hopefully) run each thread faster (with a maximum of 4 at a time rather than 8 at a time). Limiting CPU count via the command basically makes Arma think you only have 4 cores rather than 8, and hopefully spawn an appropriate amount of threads. Since the game only spawns 3 "heavy" threads anyway, I doubt it even makes a difference, but in any case if Arma 2 is the only CPU-intensive application your computer is running there is absolutely no benefit to using the -cpucount parameter.

The only use for -cpucount is if you want to also limit Arma 2 to only use X (real or virtual) cores by setting affinity as well so that the rest of your CPU is left available for other, more important applications (if such applications even exist!). Or of course the command has a use if you want to test what the game does when you have less cores... But there is practically no way this command will do anything positive to Arma 2's performance.

Edited by galzohar

Share this post


Link to post
Share on other sites

It has one separate thread utilizing 12 % of cpu time and another 16 concurrent threads using approx 30% cpu. These 16 are probably from the same worker. Around 8-10 of them are active with 3-4 % utilization each.

There are some other threads as well but used time to time. Total number of threads is around 45-50.

So it is not 3 threads but 2 main threads, 1 of which has many subthreads so to speak, or concurrent threads. It is probably for geometry and the one with single thread is for AI. So if geometry is still one thread then it means the memtraffic trade-off is bigger than the performance gains. So it is by choice ;) .. for the current design.

My i7-950 works @ around 35-45 % utilization having all 4 main cores +2 HT active with ACE on. So it utilizes all the available cores instead of maxing out 1 or 2.

I dont see any improvements by turning off HT. Maybe it is system/OS dependent etc..

The cpucount command is to limit Arma to use limited number of cores before the appl assignes itself to cores, rather than assigning cores thru taskmanager which does it after the appl launch.

Share this post


Link to post
Share on other sites

I've noticed some imporvement with HT off only when using high numbers of AI, obviously. Without a high number of AI my graphics card is the bottleneck anyway so I can't load up my CPU to its limits - HT on or off.

If you see a all cores being used it doesn't mean that there are that many threads. Running a single thread with an infinite loop (and nothing else) will use up 12.5% of your total CPU power as it can only run on 1 virtual core at a time, but windows will move it around between virtual cores to reduce overheating. So it's not that the thread is using multiple cores to run faster - It is only using 1 core at a time but a different one at any given time. Therefore if you only get 35-40% CPU usage then you cannot say for sure whether the game is using more than 3-4 "heavy" threads or not. If you manage to somehow get 75% CPU usage (with HT on) then you know the game runs at least 6 "heavy" threads.

For me, with HT off, I don't think I ever got near 75% which means I have no evidence for the game using more than 3 "heavy" threads. I did get above 50% though with HT off so it means the game uses at least 3. And looking at the results people were getting in other threads testing CPU usage with high number of AI it's easy to see that 1 of those threads is the (only) AI thread.

If you do use something that shows you the game using more threads, then those threads are probably not using any more CPU when the game is running more intensive missions/graphics or something.

Share this post


Link to post
Share on other sites

Sorry what you say does not makes sense.

I'm not equating threads to cores. I can see individual threads Arma is running and their addresses. And CPU usage for each ;)

What I see is 1 thread from 1 address @12% usage and 8-10 threads initiated by another address @3 % each.

I can't get what you mean by "heavy" threads ? You cannot assume the no of threads a game has just by looking at the CPU utilization.

Share this post


Link to post
Share on other sites

I agree CPU utilization doesn't say everything, but it can tell you the minimum amount of CPU-intensive threads that the game is possibly running. 3% isn't exactly CPU-intensive ;)

But again, to be honest, the only thread that seems to get CPU intensive in this game is the AI thread, and making it run faster by disabling HT seems to be an increase to performance. If the AI thread isn't working hard then you will get the same performance with or without HT as you're not using any core to its full potential.

Share this post


Link to post
Share on other sites

Thx galzohar & Cross for your efforts!

I try now with disable HT ;)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×