Gaming On The Go Mobility Considerations For Gaming
Gaming On The Go: Mobility Considerations For Gaming Satheesh G Subramanian Sr. Technical Marketing Engr. Software Solutions Group Feb 20, 2008
Agenda Why should game developers care about Mobility? What – are the primary mobility constraints? – are the common mobility issues in gaming? – are the potential usage models? How – Can you act on these issues today? – Can you use Intel hardware and software to make it happen? Summary 2
Key Trend: Growth in Notebooks Continues To Surge WW NB TAM expected to grow at 17% annual rate through 2010 DT and NB WW TAM (Mu) Forecast DT NB CAGR Consumer DT NB 2006 3% 38% Source: IDC December’ 06 PC Tracker 3 2007 3% 24% 2008 5% 19% 2009 4% 16% 2010 4% 13%
Why Should You Care - The Graphics Story Integrated graphics forms bulk of the sales in mobile segment and you want your games to run well on integrated graphics. Source: Mercury Research (Q 3’ 07) 4
Why Are Mobile PCs Different? Laptops and Ultra Mobile PCs present a fresh set of constraints and possibilities to game playability – Power – Connectivity Traditionally game development code streams for mobile (handheld) and PC gaming have been different but the future PC platforms will have handheld form factors. 5
What Are The Main Mobility Constraints Power – For mobile applications, energy efficiency is as important as performance. – We can extend game play time on battery by optimizing software for power Connectivity – Games could preemptively save game states before you get kicked out of a poor wireless network. – Networked PC games could support P 2 P game play laptops without internet connection Other usage models – Game could be paused when the laptop lid is closed 6
Software Affects Platform Power Consumption LCD Brightness – LCD displays still consume a significant portion of platform power. – It is possible to reduce the LCD brightness through Software in Vista. Threading – Case Studies show that multi-threaded applications are more power efficient than single-threaded applications. – But imbalanced threading may result in more power consumption 7
~3 W Platform Power Savings From 50% LCD Brightness Reduction Game power consumption (CPU, Platform, Panel) Study shows the average power consumption with changing brightness using ‘Game Options’ and with programmatically changing using Vista registry keys Brightness control in game uses Set. Gamma. Ramp() which doesn’t result in any LCD panel power savings – Developers don’t have a common way to programmatically change brightness with custom OEM implementation LCD panel average power is reduced to ½ when programmatically changed using Vista* reg keys 8
Threading Methodologies Two threading models – Data domain decomposition – Each thread performs same work on different data set – Functional domain decomposition – Each thread perform different work (functions) Other methodologies used – Balanced multi-threading – Each thread consumes same CPU resources – Imbalanced multi-threading – Each thread vary in CPU usage consumption e. g. one thread consuming 80% CPU core, while other thread consuming 20% of the second core 9
Multi-threading Provides Power Savings Over Single-threading In applications where MT performance scaling is high, we see a corresponding savings in power between single-threaded and multi-threaded apps. 10
Imbalanced Threading Uses More Power Than Balanced Threading Test kernel based on gaming application created in-house – Balanced – Imbalanced Multi-threaded Imbalanced implementation on Portable/Laptop mode shows degradation in performance 11
Multi-Threading For Power - Summary Multi-thread your games to save power in mobile systems. Use a threading model in which all the threads perform equal amounts of work independently. (Balanced Threading) Minimizing synchronization points between threads leads to more time spent in the parallel section which translates to better power savings. Use Intel® Threading Tools to profile load across different threads as well as profile the code for time spent in parallel sections. 12
When Power Is Job 1: Use Graphics Programmability ONLY Where It Is Required Or An Advantage Trends are clearly driving much higher capability in a relatively constant power/thermal budget EPI 10 nj Power considerations drive an “as much as practical” fixed function solution which provides the least amount of power for a certain performance level Power Efficiency General purpose microprocessors (x 86, MIPS, RISC cores) Max Flexibility 1 nj Domain specific processors (GPU, DSP, CSP) 0. 1 nj ASIC, fixed function Blocks 0. 01 nj Flexibility considerations requires a programmable solution EPI: Energy Spent per Inst in n. J 13 Max Power Efficiency
Introduction To Laptop Gaming TDK The Intel® Laptop Gaming Technology Development Kit (TDK) is a development kit intended for use by game developers to get access to and control of key mobility features of the Intel Mobile Platforms The TDK is a set of light-weight, high-performance APIs that can be integrated with minimal or no overhead into games Freeware including source code, but not open source. TDK can be downloaded from: http: //softwarecommunity. intel. com/articles/eng/1017. htm 14
Laptop Gaming TDK – Platform Query APIs Category Query Functionality Platform Is. ALaptop() Power Get. Power. Src() Get. Battery. Percent. Remaining() Get. Batter. Life. Time. Remaining() Get. Power. Scheme() Connectivity Get. Connectivity. Status() Get. IPAddresses() Set/Is. Wireless. Enabled() Set/Is. Wireless. Connected() Get 80211 Wireless. Signal. Strength() 15
Invoking the TDK APIs – Include the TDK Interface header file: #include "Intel. Gaming. TDKAPI. h" – Get a handle to the TDK Interface class singleton object: Intel. Laptop. Gaming. TDKInterface *IGT = Intel. Laptop. Gaming. TDKInterface: : Get. TDKInterface(); – Call appropriate TDK APIs to request platform status: int power. Source = IGT Get. Power. Src() 16
Invoking TDK in Threaded Mode Derive an event observer class from the Abstract Base Class Notifiable Implement the abstract method notify in the derived class Register the observer object as the callback for an event using Register. Event. Observer method The notify method is called when platform events are detected by the threads In this example, when the power source changes from AC_Power to Battery_Power, the function CGaming. TDKObserver: : notify is called with the value = “Battery_Power” class CGaming. TDKObserver : public Notifiable { public: CGaming. TDKObserver() : Notifiable() { } virtual void notify(int event, long value = 0); }; void CGaming. TDKObserver: : notify(int event, long value) { Enter. Critical. Section(&cs); if (event == BATTERY_LIFE_PRCNT_CHANGED || event == POWER_SRC_CHANGED) { // Handle event here } if (event == CURRENT_CPU_UTIL) { // Handle event here } Leave. Critical. Section(&cs); } CGaming. TDKObserver observer; IGT Register. Event. Observer(POWER_SRC_CHANGED, &observer); 17
Some Popular Titles Optimized for Mobility 18
Ad-Hoc Networked Gaming - Overview Peer-to-Peer gaming in a Personal Area Network (PAN) Popularized by Nintendo DS*, two users could join in a networked game without a physical connection to a game server on the Internet Users playing the same game could detect and invite each other to join a networked game No Internet infrastructure is required 19
Intel® Laptop Gaming TDK P 2 P Networking APIs Wireless Connectivity component: – Uses Microsoft* WLAN APIs to establish wireless connection – Connection establishes much faster in Vista* (~10 secs) than in XP* (~1 min 10 secs) Peer Management component: – Establishes a transport protocol among Ad-Hoc nodes – Build a network layer connection allows add more friendly features (e. g. Invite message) – Monitors peers Prerequisites: Windows* SDK, hot fix on Windows* XP 20
TDK: Key APIs to Manage Ad-Hoc Networks Select a wireless interface – Get. Current. Wless. Interface Prepare and load a profile – Load. Profile Connect an Ad-Hoc network – Start. Ad. Hoc. Network Monitor peers – Get. List. Of. Local. Users 21
TDK: How To Select a Wireless Interface First, we tell the system to pick up an available wireless interface Get. Current. Wless. Interface. By default, the system will get the first wireless interface. RPC_WSTR my. Interface = NULL; WLAN_INTERFACE_STATE my. State = wlan_interface_state_not_ready ; Ad. Hoc. App. Get. Current. Wless. Interface (my. Interface, my. State); if (my. Interface != NULL) {. . . continue here. . . } For a laptop with multiple wireless interfaces, we can manually select a wireless interface Set. Current. Wless. Interface. 22
TDK: How to Prepare a P 2 P Profile Next, prepare an Ad-Hoc profile with a particular SSID by just modifying the sample XML profile using ascii to hex conversion 23
TDK: How to Load the Profile Name this profile by the SSID name (e. g. , Intel_e. Chess. Demo. xml) int rc = Adhoc. App. Load. Profile("Intel", "e. Chess. Demo"); if (rc == IMG_SUCCESS) { } Load this profile with the API Load. Profile. 24
TDK: How to Connect to an Ad-Hoc Network & Monitor Peers Connect to the Ad-Hoc network using the API Start. Ad. Hoc. Network rc = Adhoc. App. Start. Ad. Hoc. Network("Intel", "e. Chess. Demo"); if (rc == IMG_SUCCESS) {. . . } Once we successfully connect to the Ad-Hoc network, we can monitor peers on that network Get. List. Of. Local. Users int n. Num. Peers; Peer. Data List. Of. Local. Users[MAX_NUM_PEER] = {0}; rc = Adhoc. App. Get. List. Of. Local. Users(n. Num. Peers, List. Of. LOcal. Users); if (rc == IMG_SUCCESS) {. . . } 25
Usage Model 1 – Start Game, Join Game Player 1 starts game in Ad-Hoc Gaming Mode Player 1 Adhoc Connection is Established. Players play multiplayer game Player 2 starts the same game in Ad-Hoc Gaming Mode Player 2 26
Usage Model 2 – Discover User, Invite to Game, Start Game, Join Game Player 1 has game service running in taskbar, which detects nearby players Player 1 opens application and invites user for gameplay Adhoc Connection is Established. Players play multiplayer game 27
Usage Model 3 – Discover User, Share Game, Start Game, Join Game Player 1 has game service running in taskbar, which detects nearby players Player 1 opens application and invites user for gameplay Player 2 gets a quick 30 min evaluation download of game from Player 1 Adhoc Connection is Established. Players play multiplayer game 28
Case Study of Usage Model 2 Turtle Entertainment - Wire Game Client Visit the Intel Booth for a Live Demo 29
Intel® Laptop Gaming TDK: Roadmap Q 3 2007: Release v 2. 0: P 2 P features introduced Q 4 2007: Release v 2. 1: Support for Vista* 32 -bit and 64 -bit, XP* 64 -bit Q 1 2008: Release v 2. 2: Support for next generation Intel® mobile platform (Exciting P 2 P Networking Opportunities) 30
www. intel. com/software/graphics Wednesday 12: 00 pm - COLLADA in the Game 02: 30 pm - Interactive Ray Tracing in Games 04: 00 pm - Speed Up Synchronization Locks Thursday 09: 00 am - The Future of Programming for Multi. Core with the Intel Compilers 10: 30 am - Getting the Most Out of Intel Graphics 12: 00 pm - Comparative Analysis of Game Parallelization 02: 30 pm - Threading Quake 4 and Quake Wars 31
32
Legal Disclaimers 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 processor numbers are not a measure of performance. Processor numbers differentiate features within each processor family, not across different processor families. See http: //www. intel. com/products/processor_number for http: //www. intel. com/products/processor_number for details. All dates, plans and features are preliminary and subject to change without notice. Designers must not rely on the absence or characteristics of any features or instructions marked “reserved” or “undefined. ” Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. Some platforms may not meet Microsoft’s Windows Vista* ready PC program requirements. Check with your PC Manufacturer details The Intel® Pentium® M processor, Intel® Core. TM Duo Processor processor, Intel® Core. TM Solo processor, Intel® Celeron® M processor, Intel® 945 PM chipset, Intel® 945 GM chipset, Intel® 955 GMZ chipset, Intel® 940 GML chipset, Intel® 945 GMS, and Intel® PRO/Wireless 3945 ABG network connection 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. The Specification Update should be publicly available following the last shipment date for a period of time equal to the specific product’s warranty period. Hardcopy Specification Updates will be available for one (1) year following End of Life (EOL). Web access will be available for three (3) years following EOL. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an order number are referenced in this document, or other Intel literature, may be obtained by calling 1 -800 -548 -4725, or by visiting Intel’s website at http: //www. intel. com. Intel, Intel Core, Celeron, and Pentium are registered trademarks of Intel Corporation and its subsidiaries in the United States and other countries. Copyright © Intel Corporation 2007. *Other names and brands may be claimed as the property of others. 33
Additional sources of information on this topic: More web based info: – Intel® Core™ Microarchitecture http: //www. intel. com/technology/architecture/coremicro/ – DVD Playback Power Consumption http: //www 3. intel. com/cd/ids/developer/asmona/eng/dc/mobile/286740. htm? page=1 – Effect of multi-threading on power consumption http: //www 3. intel. com/cd/ids/developer/asmo-na/eng/dc/threading/274896. htm – Disk I/O Power Consumption http: //softwarecommunity. intel. com/articles/eng/1091. htm – WLAN Power Consumption http: //www 3. intel. com/cd/ids/developer/asmo-na/eng/333927. htm – Intel® Energy-Efficient Performance http: //www. intel. com/technology/eep/index. htm – Timer interrupt impact on CPU power http: //softwarecommunity. intel. com/articles/eng/1086. htm 34
Windows - Power APIs Historically, applications need to poll for status change Get. System. Power. Status API for battery capacity, AC line status Vista features asynchronous notification of common power events Same API used for power setting change registration User mode Register. Power. Setting. Notification() Kernel mode Po. Register. Power. Setting. Notification() 35
Media Testing/Benchmarking Battery Life Targets 2. 5 Hrs e. g. Underworld e. g. Last Samurai e. g. Fast & Furious: Tokyo Drift 2. 0 Hrs Intel OEM e. g. Silent Hill e. g. Bourne Ultimatum Source: http: //www. hddvdstats. com; http: //www. blu-raystats. com/ Notebooks are driving the need for sufficient battery for HD Playback – Reduced overall Platform Power Ideally require playback time to better than or equal to 2½ hours – Based on a sampling of 50 titles – 38% require 2 hours or better Battery-Life is dependent on battery capacity & platform power targets – G 45 Target above is based on typical Intel + OEM T&L platform power (14 -17 Watts) 36
Lowering P-States helps save CPU Power Single-Threaded Implementation Multi-Threaded Implementation Physics game kernel with 2 implementations Lowering P-States helps save CPU power on both singlethreaded and multi-threaded case 37
- Slides: 37