Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Game Developers Conference 2008 Comparative Analysis of Game Parallelization Dmitry Eremin Senior Software Engineer, Intel Software and Solutions Group.

Similar presentations


Presentation on theme: "1 Game Developers Conference 2008 Comparative Analysis of Game Parallelization Dmitry Eremin Senior Software Engineer, Intel Software and Solutions Group."— Presentation transcript:

1 1 Game Developers Conference 2008 Comparative Analysis of Game Parallelization Dmitry Eremin Senior Software Engineer, Intel Software and Solutions Group Thursday, February 21, 12:00pm – 1:00pm

2 2 Legal Disclaimer  INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL® PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. INTEL PRODUCTS ARE NOT INTENDED FOR USE IN MEDICAL, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS.  Intel may make changes to specifications and product descriptions at any time, without notice.  All products, dates, and figures specified are preliminary based on current expectations, and are subject to change without notice.  Intel, processors, chipsets, and desktop boards may contain design defects or errors known as errata, which may cause the product to deviate from published specifications. Current characterized errata are available on request.  Performance tests and ratings are measured using specific computer systems and/or components and reflect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance.  Intel, Intel Inside, and the Intel logo are trademarks of Intel Corporation in the United States and other countries.  *Other names and brands may be claimed as the property of others.  Copyright © 2007 Intel Corporation.

3 3  Usual Game Structure  Parallelization with Windows* and POSIX Threads  What is Intel® Threading Building Blocks?  Parallelization with Intel® Threading Building Blocks  Summary Agenda * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

4 4 Usual Game Structure Render OnFrameMove Physics AI Particles http://softwarecommunity.intel.com/articles/eng/1363.htm

5 5 Usual Game Structure OnFrameMove Render Physics AI Particles

6 6 Thread Timeline  Horizontal bands represent threads Thread 1 Thread 2 Thread 3 Usual Game Structure Dark green: Threads are active (running or runnable) Light green: Threads are waiting Yellow Transition lines: Signals that wake up other threads, such as transferring a lock or sending a message Hatched light green: Threads are busy waiting

7 7 Concurrency Profile  Measure core utilization so user can see how parallel their program really is - Relative to the system executing the application Idle: no active threads Serial: a single thread Under-subscribed: # threads > 1 && # threads < # cores Fully-subscribed*: # threads == # cores Oversubscribed: # threads > # cores  Concurrency level is the number of threads that are active (not waiting, sleeping, blocked, etc.) at a given time * example reflects 4 core machine Usual Game Structure

8 8 Performance Profile Serial Case  Sequential execution  25% of system utilization  Benchmark: 20.95sec Measured on 4 core test machine Render Physics AI Particles Usual Game Structure

9 9 Limitation of Serial Games for Multi-Core Systems  With clock rates reaching into the multiple GHz range, further increases are becoming harder  Parallel hardware has gone mainstream for desktop  To exploit the performance potential of multi-core processors, applications must be threaded Usual Game Structure Serial games get no benefits from multi-core

10 10  Usual Game Structure  Parallelization with Windows* and POSIX Threads  What is Intel® Threading Building Blocks?  Parallelization with Intel® Threading Building Blocks  Summary Agenda * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

11 11 Parallelization with Windows* and POSIX Threads  Updating with double buffered data structures  Decoupling rendering from frame processing  Asynchronous update of parts of the scene  Functional Decomposition Render Physics Particles AI * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

12 12 Performance Profile Functional Decomposition Parallelization with Windows* and POSIX Threads  Thread pool for 3 threads  Load imbalance  Benchmark: 10.15sec Measured on 4 core test machine Render Physics AI Particles Render Thread Pool Low utilization of 4 cores

13 13 Data Level Parallelism  Nested parallelism - Top level - functional decomposition - Next level - data decomposition Parallelization with Windows* and POSIX Threads update several AI units... update several AI units Render Physics Particles

14 14 Performance Profile AI Decomposition with 2 Threads Parallelization with Windows* and POSIX Threads  Thread pool for 3 threads  Split AI for 2 threads  Load imbalance  Benchmark: 9.44sec Measured on 4 core test machine Render Thread Pool AI Pool

15 15 Performance Profile AI Decomposition with 4 Threads Parallelization with Windows* and POSIX Threads  Thread pool for 3 threads  Split AI for 4 threads  Load imbalance  Oversubscription  Benchmark: 15.47sec Measured on 4 core test machine Render Thread Pool AI Pool

16 16 One More Problem: Nested Parallelism  Software components are built from smaller components  If each turtle specifies threads... Parallelization with Windows* and POSIX Threads

17 17 Disadvantages of Using Windows* and POSIX Threads for Games  Low-Level details (not intuitive)  Hard to come up with good design  Code often becomes very dependent on a particular OS’s threading facilities  Load imbalance  Has to be managed manually  Oversubscription  Multiple components create threads that compete for CPU resources  Hard to manage nested parallelism Parallelization with Windows* and POSIX Threads * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners. Hard to achieve scalability

18 18  Usual Game Structure  Parallelization with Windows* and POSIX Threads  What is Intel® Threading Building Blocks?  Parallelization with Intel® Threading Building Blocks  Summary Agenda * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

19 19 What is Intel® Threading Building Blocks?  It is Open Source now! - http://www.intel.com/software/products/tbb/ http://www.intel.com/software/products/tbb/ - http://threadingbuildingblocks.org/ http://threadingbuildingblocks.org/  Threading Abstraction Library - Relies on generic programming - Provides high-level generic implementation of parallel design patterns and concurrent data structures  You specify task patterns instead of threads - Library maps your logical tasks onto physical threads, efficiently using cache and balancing load - Full support for nested parallelism  Targets threading for robust performance - Designed to provide scalable performance for computationally intense portions of shrink-wrapped applications - Portable across Linux*, Mac OS*, and Windows*  Emphasizes scalable data parallel programming - Solutions based on functional decomposition usually do not scale * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

20 20 Components of Intel® Threading Building Blocks  Parallel algorithms  Concurrent containers  Synchronization primitives  Memory allocation  Task scheduler ProblemIntel® TBB Approach Low-Level details Operate with task patterns instead of threads Load imbalance Work-stealing balances load OversubscriptionOne scheduled thread per hardware thread What is Intel® Threading Building Blocks?

21 21  Usual Game Structure  Parallelization with Windows* and POSIX Threads  What is Intel® Threading Building Blocks?  Parallelization with Intel® Threading Building Blocks  Summary Agenda * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

22 22 Parallelization with Intel® Threading Building Blocks Scheme of parallelization with Windows* and POSIX threads Scheme of parallelization with Intel® TBB Render Physics Particles update several AI units... update several AI units update several blocks update several AI units update several particles Render update several particles update several blocks update several AI units * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

23 23 Task Graph MainTask AITask AIBodyTask AIFinalTask Task creation order Task completion signals AIBodyTask SyncTask PhysicsTask ParticlesTask Not expanded Parallelization with Intel® TBB...

24 24 Performance Profile  Intel® TBB task pool for 3 threads  Automatic load balancing with work-stealing  Benchmark: 8.66sec Measured on 4 core test machine Render Parallelization with Intel® TBB Good utilization of 4 cores

25 25 Limitation of Using Intel® Threading Building Blocks for Games Intel® TBB is not intended for  I/O bound processing  Hard real-time processing  Excessive usage of explicit synchronization compatible However, it is compatible with other threading packages  It can be used in concert with Windows* and POSIX threads, etc Parallelization with Intel® TBB * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

26 26 Advantages of Using Intel® Threading Building Blocks for Games  Generic Parallel Algorithms  You specify task patterns instead of threads  Cross-Platform implementation  Load balancing  Adaptive tuning to variable computation  Full support for nested parallelism  Efficient use of resources  One scheduled thread per hardware thread  Effective cache reuse Parallelization with Intel® TBB Easy to achieve scalability

27 27  Usual Game Structure  Parallelization with Windows* and POSIX Threads  What is Intel® Threading Building Blocks?  Parallelization with Intel® Threading Building Blocks  Summary Agenda * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners.

28 28 Summary Serial games get no benefits from multi-core Hard to achieve scalability with Windows* and POSIX threads Intel® Threading Building Blocks can easily give game developers a serious boost and scalability * Intel and the Intel logo are registered trademarks of Intel Corporation. Other brands and names are the property of their respective owners. Multi-Thread Your Game with Intel® TBB

29 29 Call To Action  Think about Multi-Threading at the beginning of your project  Think about scalable performance (for N cores, not just 2 or 4) for years to come  Please fill out the evaluation form

30 30 ?

31 31 10:30am -Gaming on the Go 12:00pm -COLLADA in the Game 02:30pm -Interactive Ray Tracing in Games 04:00pm -Speed Up Synchronization Locks www.intel.com/software/graphics 09:00am -The Future of Programming for Multi- Core with the Intel Compilers 10:30am -Getting the Most Out of Intel Graphics 12:00pm -Comparative Analysis of Game Parallelization 02:30pm - Threading Quake 4 and Quake Wars Wednesday Thursday

32 32 For More Information Commercial Intel® TBB Product Web Page: - http://www.intel.com/software/products/tbb/ http://www.intel.com/software/products/tbb/ Open Source Intel® TBB Web Portal: - http://ThreadingBuildingBlocks.org/ http://ThreadingBuildingBlocks.org/ See Intel at GDC: - Booth number 5917 - Intel Interactive Lounge – Moscone West 3 rd floor

33 33 Risk Factors This presentation contains forward-looking statements. All statements made that are not historical facts are subject to a number of risks and uncertainties, and actual results may differ materially. Please refer to our most recent Earnings Release and our most recent Form 10-Q or 10-K filing available on our website for more information on the risk factors that could cause actual results to differ. Rev. 4/17/07

34


Download ppt "1 Game Developers Conference 2008 Comparative Analysis of Game Parallelization Dmitry Eremin Senior Software Engineer, Intel Software and Solutions Group."

Similar presentations


Ads by Google