Announcement

Collapse
No announcement yet.

Does BF2 support multithreading?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: Does BF2 support multithreading?

    this is probably the most technologically advanced thread to ever exist on tbf2.

    Comment


    • #17
      Re: Does BF2 support multithreading?

      Here's a screen shot after playing about 10 min of BF2 i Alt tabbed out and took the pic. As you can see both cores are being used when im playing BF2.

      Comment


      • #18
        Re: Does BF2 support multithreading?

        Okay I decided to do some tests the results are shown below.

        I decided not to use the Windows Task manager CPU monitor instead opting to go for the one provided with Rvia Tuner.



        I booted BF2 with affinity set to both CPU cores, once in game I tabbed out and set BF2.exe affinity to CPU 0 alone.

        The first part of the graph shows that load on CPU 0 goes to near 100% with CPU 1 load dropping off to about 5%, this is background task for the OS being handled by CPU 1. I can assume that task scheduler is selecting CPU 1 to take up the slack.

        I then tabbed out and set affinity to CPU 1 alone as you can see the result is an almost complete reverse of the first half of the graph. I can't really explain the odd random spikes in CPU 0s load graph but CPU 1s load graph goes to near 100% as it did when CPU 0 was set to affinity.

        I then tabbed back out and set affinity to both CPU cores again the result is not significant but you can see a drop off in the CPU 1 load and an increase in the CPU 0 load.

        The result seems to suggest that BF2 isn't multi threaded, the difference in CPU loads between affinity set to both and affinity set to either 0 or 1 is so small as to be of little real significance.

        The ultimate result is that no matter what the affinity was set to their was no difference at all in the gameplay, no drops in FPS, no skips jumps or other unexpected issues.

        I dunno how Punkbuster works, but it is a core part of BF2 more interesting is the fact that it doesn't allow you to adjust it's affinity. IF PB uses CPU 0 as standard then it would explain why you get a near 100% result when setting BF2 to use only CPU 0. If you set BF2 to use CPU 1 then Punkbuster is still going to use CPU 0, this would kind of explain why the middle part and the latter part of the graph are almost identical. BF2 is still using ONLY CPU 1 and Punkbuster is still using CPU 0.

        Discuss!

        Comment


        • #19
          Re: Does BF2 support multithreading?

          And my results seem to suggest BF2 does use both cores...



          The graph shows half a round with BF2 set to both cores, and as you can see, both cores are being used equally.

          Comment


          • #20
            Re: Does BF2 support multithreading?

            Interesting

            There are some issues though

            Firstly I don't know what kind of system specs you are running
            Second I don't know what each and everyone of those processes you run on your system does.

            The big question though is have you noticed the difference between my system and yours yet? The big difference that could explain why your CPU 1 usage is miles higher than mine?

            Remember the theory is that BF2 is given it's own core whilst running with background OS tasks being shifted to run on the second core.

            Worked it out yet?

            Two main differences

            Firstly my CPU is clocked at 700mhz (E6600) more than yours, quicker through put less work needed.
            Second excluding the processes needed for BF2 I have a total of 36 background tasks running 35 if you excluded Firefox, 33 if you excluded Rivatuner. You have 66 tasks running in the background. 64 excluding Rivatuner
            Third I notice a process called RtHDVCpl.exe. Realtek onboard sound I assume? that requires additional work from your CPU which will also increase the work load, especially whilst it's generating in game sound. I am lucky enough to have a dedicated sound card so that's extra load off my CPU.

            Like I said you have tons more stuff running in the background, I don't know what res you run at. I run at 1680x1050 so that means the whole graphics job is done by the GPU as you lower the res you shift the work from your GPU to your CPU. I don't know if you run a dedicated sound card, I am assuming from that 'process' I spotted that you do run on board sound, which adds to your CPU work load. I don't know how much RAM you run less RAM requires more work from your CPU as it has to swap data to and from your HD. Finally it looks like you're running Vista which handles things a tad different from XP SP2 (what I am running.)

            What would be interesting would be if you gave us a look at a usage chart doing the same thing I did. Boot the game with affinity set to both, tab out set it too CPU 0, run around for a while, tab out set it to CPU 1 run around a bit more, then tab out and set it back to both.

            Comment


            • #21
              Re: Does BF2 support multithreading?

              Originally posted by The Laughing Man
              Interesting

              There are some issues though

              Firstly I don't know what kind of system specs you are running
              Second I don't know what each and everyone of those processes you run on your system does.

              The big question though is have you noticed the difference between my system and yours yet? The big difference that could explain why your CPU 1 usage is miles higher than mine?

              Remember the theory is that BF2 is given it's own core whilst running with background OS tasks being shifted to run on the second core.

              Worked it out yet?

              Two main differences

              Firstly my CPU is clocked at 700mhz (E6600) more than yours, quicker through put less work needed.
              Second excluding the processes needed for BF2 I have a total of 36 background tasks running 35 if you excluded Firefox, 33 if you excluded Rivatuner. You have 66 tasks running in the background. 64 excluding Rivatuner
              Third I notice a process called RtHDVCpl.exe. Realtek onboard sound I assume? that requires additional work from your CPU which will also increase the work load, especially whilst it's generating in game sound. I am lucky enough to have a dedicated sound card so that's extra load off my CPU.

              Like I said you have tons more stuff running in the background, I don't know what res you run at. I run at 1680x1050 so that means the whole graphics job is done by the GPU as you lower the res you shift the work from your GPU to your CPU. I don't know if you run a dedicated sound card, I am assuming from that 'process' I spotted that you do run on board sound, which adds to your CPU work load. I don't know how much RAM you run less RAM requires more work from your CPU as it has to swap data to and from your HD. Finally it looks like you're running Vista which handles things a tad different from XP SP2 (what I am running.)

              What would be interesting would be if you gave us a look at a usage chart doing the same thing I did. Boot the game with affinity set to both, tab out set it too CPU 0, run around for a while, tab out set it to CPU 1 run around a bit more, then tab out and set it back to both.
              My specs are in the little pull down menu, but they are:
              AMD Athlon 64 X2 4000+ 2.1ghz
              3Gb of RAM
              9600GT
              windows vista

              Now, taking all those things you said into consideration your theory is wrong because when I set BF2 to a single core, the core BF2 is assigned to gets maxed out to 100% usage, while the core not assigned to BF2 is around 5% - 10% usage. If what you're saying is correct about all my background processes, then when I set BF2 to a single core I should see 100% on the BF2 core and 60% - 80% on the other core, but that's not what happens.

              Comment


              • #22
                Re: Does BF2 support multithreading?

                I dunno, your results show multi-core threading my results don't. Very strange, interesting that you're using an Athlon x 2 perhaps Pingu had something when he said Athlons use treat application threads in a different way.

                Mind you I did a few more tests and found some interesting stuff.

                I used a program called TAT (Intel Thermal Analysis Tool) this allows me to selectively load any, either or both cores on my cpu by whatever value I want. Results are



                A - Tabbed out, set TAT to load Core 1 to 100%

                Result shows Core 1 at 100% whilst Core 0 is at about 50% running BF2, no in game stutter at all.

                B - Tabbed out, set TAT to load Core 0 to 100% set Core 1 back to 0%

                Result. Interesting both CPU loads show 100% whilst running BF2, no in game stutter.

                C - Tabbed out, set TAT to load Core 1 to 100% set Core 0 back to 0% (same as A)

                Result. The same as A 50% on CPU 0 100% on CPU 1, no in game stutter

                D was a mess about at first trying the same set up as B and then using TAT to 100% load both cores. Only then did I get in game stutter.

                The results show that BF2 is being switched between cores depending on which on is available. The strange thing is when it's switched to CPU 1 it's using 100% of the core whilst it only uses about 50% when it's being run on CPU 0. I don't know what the reason behind this is but it shows that some sort of difference in active load occurs depending on which core.

                I have no real idea how the OS handles thread application. Is it possible that the OS could be switching a single threaded program between CPU cores whilst the program is being run? If it was switching applications rapidly depending on CPU load and availability then a CPU load graph could give the impression of being multi threaded when in fact all that's happening is the program is being switch between cores.

                I dunno. It requires some further investigation or at least a better understanding of how the OS and CPUs deal with threads

                Comment


                • #23
                  Re: Does BF2 support multithreading?

                  Just found this over at the MS website. Confirms my idea that BF2 isn't multi threaded just that it's thread is being dynamically shifted between cores depending on available power.

                  Demand-Based Switching (DBS) is the use of ACPI processor performance states (dynamic voltage and frequency scaling) in response to system workloads. Windows XP processor power management implements DBS by using the adaptive processor throttling policy. This policy dynamically and automatically adjusts the processor’s current performance state in response to system CPU use without user intervention.

                  When single-threaded workloads run on multiprocessor systems that include dual-core configurations, the workloads may migrate across available CPU cores. This behavior is a natural artifact of how Windows schedules work across available CPU resources. However, on systems that have processor performance states that run with the adaptive processor throttling policy, this thread migration may cause the Windows kernel power manager to incorrectly calculate the optimal target performance state for the processor. This behavior occurs because an individual processor core, logical or physical, may appear to be less busy than the whole processor package actually is. On performance benchmarks that use single-threaded workloads, you may see this artifact in decreased performance results or in a high degree of variance between successive runs of identical benchmark tests.

                  Comment


                  • #24
                    Re: Does BF2 support multithreading?

                    i dont know if bf2 officially supports multiple cpu features etc, but what i do know, because of 3 years of use and experience, it greatly affects play and performance depending on what you specify it to run on...

                    i have a dual xeon rig, 2 x physical cpus, 2 x logical, 4 in all.

                    i specifically pass the game over to 1 physical CPU, and then pass all other background and running tasks to the remaining units and and its logical siblings via an automated scripting process as it launches.

                    there is a big enough of a performance difference when i change that setup or let it run on defaults, or swap it round (invert) to know, somewhere the cpus its allocated to are making a difference. cant speak for dual core, only what i have, separate physical units and HT.

                    its not so much a science but a journey of hands on discovery, playing with different settings related to pci bus and cpu allocation etc.

                    so from my post you can see what i am saying, in my case, i get better performace from letting bf2 run on one physical CPU as opposed to two or more CPUs, married with letting ALL other tasks run on the remaining units.

                    which i guess could state that its not optimized to run on more than one CPU.

                    :shakehead:

                    Comment


                    • #25
                      Re: Does BF2 support multithreading?

                      If we get a BF3 I hope it will support it.
                      You would think it would.

                      Comment


                      • #26
                        Re: Does BF2 support multithreading?

                        If we get a BF3 I hope it will support it.
                        You would think it would.
                        More than likely I would imagine.

                        Comment


                        • #27
                          Re: Does BF2 support multithreading?

                          It would appear that the BF3 Frostbite 3D engine is multithreaded. But that doesn't mean the game will be fully multithreaded.

                          There are different approaches to multithreading, and designing a program from the ground up is said to be 10 times more difficult and take 10 times as long. That's why very few games are multithreaded.

                          Even games that are multithreaded probably just have segments multithreaded where a good benefit was identified (like the Quake 4 1.0.5 multithread patch).

                          Given that there is a lot of inter cpu comms going on in multithreaded progs the costs can outweigh the benefits. The program has to be fine tuned and tested along the way, increasing the cost and taking a lot of time, even years longer.

                          I can't remember the date of the interview, but it was the id software guru (John Carmack 2006?). He said fully multithreaded games were still years and years away from becoming standard.

                          Even the latest releases that claim multithread support do it in a makeshift way. For example Borderlands claims it's multithreaded, as it runs the audio, physics, visuals, movements, on different cores. Which is a lot better than nothing.

                          By the time the game developers get it sorted the physics will probably be moved to the gfx card, and audio to the sound card anyway, leaving less threads left for what will be a more powerful cpu.

                          Comment

                          Working...
                          X