SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Debug, Analyze and Optimize
Games with Intel Tools
Surviving the apocalypse on mainstream graphics
Matteo Valoriani, FifthIngenium CEO
Intel Software Innovator
Nice to Meet You
www.slideshare.net/MatteoValoriani
https://it.linkedin.com/in/matteovaloriani
http://fifthingenium.com/blog
https://github.com/mvaloriani
mvaloriani at gmail dot com
@MatteoValoriani
Matteo Valoriani
CEO of FifthIngenium
PhD at Politecnico of Milano
Speaker and Consultant
2
Agenda
3
• Introduction
• Intel® Graphics Performance
Analyzers .. What ?
• Intel® GPA Live Demo
• Optimizations
• Conclusion
4
PC Virtual Reality Mobile
6
Getting Started with
Intel® Graphics
Performance Analyzers
(Intel® GPA)
https://goo.gl/2cKmMa
Intel® Graphics Performance Analyzers 2017 R1
8
How to Get Started?
Download for FREE at https://software.intel.com/gpa/
• No Code Changes Needed
• No Environment Changes
• No IDE Necessary
9
Intel® GPA - Optimize Your Graphics Applications!
High–End
GPU
Mainstream
Graphics
10fps
5fps
60+
fps
5fps
30 fps
30+
fps
Intel® Graphics
Performance
Analyzers
Host OS
▪ Win 7, Win 8.1, Win 10 (64-
bit)
DirectX*
▪ DX 9, 9EX, 10.x, 11.0, 11.1, 12
Target Hardware
▪ Intel, NVidia* & AMD* GPUs
▪ Windows x86 Tablets
▪ HTC Vive*, Oculus Rift*
10
Optimize Windows*, Android*, and Ubuntu* Games!
Windows
Gaming
Android
Gaming
Host OS
▪ Windows, Ubuntu, Mac* OSX
OpenGL* ES
▪ 1.x, 2.x, 3.x
Target Hardware
▪ Intel Atom®
Android OS
▪ 4.x, 5.x, 6.x
Ubuntu
Gaming
Host OS
▪ Ubuntu 16.04
OpenGL
▪ 3.2, 3.3, 4.0, 4.1 (Core Profile)
Target Hardware
▪ Intel® HD Graphics 4k-6k
Target OS
▪ Ubuntu 16.04
11
Host/Target Architecture
Host System Target System
12
What’s Inside Intel® GPA?
System Analyzer / HUD
Graphics Frame
Analyzer
In-game analysis
Single frame analysisTimeline analysis
Graphics Monitor
Launch & config tool
Graphics Trace
Analyzer
13
How to Use Intel® GPA?
HUD / System Analyzer:
Frame Analyzer:
Trace Analyzer:
CPU Limited
GPU Limited
Capture Frame
Capture Trace
?Run with
Intel® GPA
In-Game Analysis Offline Analysis
14
Graphics Monitor
Launch & config tool
Define profiles & preferences
15
System Analyzer / HUD
In-game analysis
• Get metrics for CPU, GPU, graphics drivers, DirectX*,
OpenGL*, or OpenGL* ES
• Experiment with override modes that quickly isolate
common performance bottlenecks
• Capture frames and traces for further analysis
• Display up to 16 performance metrics
simultaneously
• Monitor the current, minimum, and maximum frame
rate
• Use without code modifications or special libraries
16
System Analyzer / HUD
Live Analysis
17
18
Graphics Frame Analyzer
In-game analysis
• Use the API log to identify visual errors by function and call
errors and warnings to graphics APIs
• Select a draw call and verify its contribution to the frame,
alpha channel, color, format, and depth buffers
• Quantify performance optimization opportunities with
render experiments per draw call
• Solve issues with shadowing, lighting, or color schemes by
locating misplaced objects
19
Graphics Frame Analyzer
Performance Analysis with Hardware Metrics
Evaluation Flow to find 3D hotspots
20
21
Published in the 6th generation graphics API dev guide :
https://software.intel.com/en-us/articles/6th-gen-graphics-api-dev-guide
22
23
Graphics Trace Analyzer
Single frame analysis
24
Optimizations
25
Script Frustum Culling and Co-routines
Use the following Monobehavior callbacks to cull scripts
outside of the camera frustum that do not need to
update when not in focus.
Monobehavior callbacks which trigger when object with
script leaves / enters the camera frustum
26
Script Frustum Culling and Co-routines (2)
Co-routines are essentially functions with the ability to
pause and resume execution.
The power of co-routines can be leveraged by
removing the original Update() function in your script
and replacing it with a co-routine.
You can then set how often you would like your co-
routine to execute using the yield command.
27
Memory Management Optimization
A great way to get an overview of how you are managing memory is to check the ‘GC
Alloc’ section of the Overview window in Unity Profiler and step through your frames until
you see a significant allocation.
• To avoid frequent allocations, it is advantageous to use structs instead of classes to
have allocations be done on the stack, instead of in the heap.
• Multiple allocations to the heap can lead to significant memory fragmentation and
frequent garbage collections.
28
Occlusion Culling
Occlusion culling is a feature available in Unity that enables you to cull out objects that
are occluded by other objects with respect to the camera.
29
Occlusion Culling
1. Go through your entire scene to multi-select
any objects that should be included in
occlusion culling calculations and mark them
as “Occluder Static” and “Occludee Static”.
2. When setting up your occlusion culling system,
set your occlusion areas carefully.By default,
Unity uses the entire scene as the occlusion
area, which can lead to frivolous computation.
3. To make sure that the entire scene isn’t used,
create an occlusion area manually and
surround only the area to be included in the
calculation.
30
LOD
Level of Detail (LOD) allows multiple meshes to attach to a game object and provides the
ability to switch between meshes the object uses based on camera distance. The LOD can
automatically simplify the mesh to compensate.
LOD L0 L1 L2
fps 160 180 220
31
Terrain Optimization
• Sampler limited
• No dynamic branching
• Optimized for Legacy HW where sampling was faster than computing LODs
• Implementation of dynamic branching increased perf by 2x ( 3ms -> 1.5ms)
• Using samplegrad for dynamic LOD selection
Conclusion
32
33
Conclusion
With the right tools :
and the right methodology, finding performance bottlenecks is easy !
Questions ?
34
References
https://software.intel.com/gpa/
https://software.intel.com/en-us/articles/6th-gen-graphics-api-dev-guide
https://software.intel.com/en-us/articles/how-to-plan-optimizations-with-unity
https://software.intel.com/en-us/android/articles/unity-optimization-guide-for-x86-android-part-2
https://software.intel.com/en-us/android/articles/unity-optimization-guide-for-x86-android-part-3
https://software.intel.com/en-us/android/articles/unity-optimization-guide-for-x86-android-part-4
https://x-team.com/blog/unity-3d-optimisation-and-best-practices-part-1/
http://docs.unity3d.com/Manual/class-OcclusionArea.html
Legal Notices and Disclaimers
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.
Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well
as any warranty arising from course of performance, course of dealing, or usage in trade.
You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products described herein. You agree to grant Intel
a non-exclusive, royalty-free license to any patent claim thereafter drafted which includes subject matter disclosed herein.
The products and services described may contain defects or errors known as errata which may cause deviations from published specifications. Current characterized errata are
available on request.
Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on
system configuration. No computer system can be absolutely secure. Check with your system manufacturer or retailer or learn more at [intel.com].
Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark,
are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should
consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other
products. For more complete information visit www.intel.com/benchmarks.
Optimization Notice: Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors.
These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any
optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain
optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information
regarding the specific instruction sets covered by this notice.
Results have been estimated or simulated using internal Intel analysis or architecture simulation or modeling, and provided to you for informational purposes. Any differences in your
system hardware, software or configuration may affect your actual performance.
Intel, Atom and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
*Other names and brands may be claimed as the property of others
© Intel Corporation.
36
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codemotion Rome 2017

Contenu connexe

Tendances

DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes Integration
Hank Preston
 

Tendances (20)

DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes Integration
 
From Monolith to K8s - Spring One 2020
From Monolith to K8s - Spring One 2020From Monolith to K8s - Spring One 2020
From Monolith to K8s - Spring One 2020
 
Kubecon US 2019: Kubernetes Multitenancy WG Deep Dive
Kubecon US 2019: Kubernetes Multitenancy WG Deep DiveKubecon US 2019: Kubernetes Multitenancy WG Deep Dive
Kubecon US 2019: Kubernetes Multitenancy WG Deep Dive
 
Using Kubernetes to make cellular data plans cheaper for 50M users
Using Kubernetes to make cellular data plans cheaper for 50M usersUsing Kubernetes to make cellular data plans cheaper for 50M users
Using Kubernetes to make cellular data plans cheaper for 50M users
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 3
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 3Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 3
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 3
 
Container security within Cisco Container Platform
Container security within Cisco Container PlatformContainer security within Cisco Container Platform
Container security within Cisco Container Platform
 
Why Automate the Network?
Why Automate the Network?Why Automate the Network?
Why Automate the Network?
 
Comparison of Current Service Mesh Architectures
Comparison of Current Service Mesh ArchitecturesComparison of Current Service Mesh Architectures
Comparison of Current Service Mesh Architectures
 
Your Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
Your Application Deserves Better than Kubernetes Ingress: Istio vs. KubernetesYour Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
Your Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
 
Open Source Licensing: Types, Strategies and Compliance
Open Source Licensing: Types, Strategies and ComplianceOpen Source Licensing: Types, Strategies and Compliance
Open Source Licensing: Types, Strategies and Compliance
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introduction
 
So you think you know SUSE?
So you think you know SUSE?So you think you know SUSE?
So you think you know SUSE?
 
API 102: Programming with Meraki APIs
API 102: Programming with Meraki APIsAPI 102: Programming with Meraki APIs
API 102: Programming with Meraki APIs
 
Enabling Business Agility with SUSE CaaS Platform
Enabling Business Agility with SUSE CaaS PlatformEnabling Business Agility with SUSE CaaS Platform
Enabling Business Agility with SUSE CaaS Platform
 
12 Factor App
12 Factor App12 Factor App
12 Factor App
 
Learn To Think Like A Computer Scientist
Learn To Think Like A Computer ScientistLearn To Think Like A Computer Scientist
Learn To Think Like A Computer Scientist
 
How to Build a Basic Edge Cloud
How to Build a Basic Edge CloudHow to Build a Basic Edge Cloud
How to Build a Basic Edge Cloud
 
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
 
Develop, Deploy, and Innovate with Intel® Cluster Ready
Develop, Deploy, and Innovate with Intel® Cluster ReadyDevelop, Deploy, and Innovate with Intel® Cluster Ready
Develop, Deploy, and Innovate with Intel® Cluster Ready
 

Similaire à Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codemotion Rome 2017

Desirable software features simulation & modeling
Desirable software features simulation & modelingDesirable software features simulation & modeling
Desirable software features simulation & modeling
Shashwat Shriparv
 
Briforum2013 applicationpackagingsmackdown public
Briforum2013 applicationpackagingsmackdown publicBriforum2013 applicationpackagingsmackdown public
Briforum2013 applicationpackagingsmackdown public
Kevin Kaminski
 

Similaire à Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codemotion Rome 2017 (20)

Getting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® GraphicsGetting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® Graphics
 
Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*
 
Design and Optimize your code for high-performance with Intel® Advisor and I...
Design and Optimize your code for high-performance with Intel®  Advisor and I...Design and Optimize your code for high-performance with Intel®  Advisor and I...
Design and Optimize your code for high-performance with Intel® Advisor and I...
 
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
Tuning For Deep Learning Inference with Intel® Processor Graphics | SIGGRAPH ...
 
Leveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge DevicesLeveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge Devices
 
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
 
Tales from the Optimization Trenches - Unite Copenhagen 2019
Tales from the Optimization Trenches - Unite Copenhagen 2019Tales from the Optimization Trenches - Unite Copenhagen 2019
Tales from the Optimization Trenches - Unite Copenhagen 2019
 
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
 
Intel® Xeon® Processor E7-8800/4800 v4 EAMG 2.0
Intel® Xeon® Processor E7-8800/4800 v4 EAMG 2.0Intel® Xeon® Processor E7-8800/4800 v4 EAMG 2.0
Intel® Xeon® Processor E7-8800/4800 v4 EAMG 2.0
 
Desirable software features simulation & modeling
Desirable software features simulation & modelingDesirable software features simulation & modeling
Desirable software features simulation & modeling
 
Common Project Mistakes (And How to Avoid Them)
Common Project Mistakes (And How to Avoid Them)Common Project Mistakes (And How to Avoid Them)
Common Project Mistakes (And How to Avoid Them)
 
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
 
EMERSON EDUARDO RODRIGUES Automating_with_SIMATIC_S7_400_inside_TIA_Portal.pdf
EMERSON EDUARDO RODRIGUES Automating_with_SIMATIC_S7_400_inside_TIA_Portal.pdfEMERSON EDUARDO RODRIGUES Automating_with_SIMATIC_S7_400_inside_TIA_Portal.pdf
EMERSON EDUARDO RODRIGUES Automating_with_SIMATIC_S7_400_inside_TIA_Portal.pdf
 
GPGPU in Commercial Software: Lessons From Three Cycles of the Adobe Creative...
GPGPU in Commercial Software: Lessons From Three Cycles of the Adobe Creative...GPGPU in Commercial Software: Lessons From Three Cycles of the Adobe Creative...
GPGPU in Commercial Software: Lessons From Three Cycles of the Adobe Creative...
 
Accelerating AI Adoption with Partners
Accelerating AI Adoption with PartnersAccelerating AI Adoption with Partners
Accelerating AI Adoption with Partners
 
Accelerating AI from the Cloud to the Edge
Accelerating AI from the Cloud to the EdgeAccelerating AI from the Cloud to the Edge
Accelerating AI from the Cloud to the Edge
 
Agentless System Crawler - InterConnect 2016
Agentless System Crawler - InterConnect 2016Agentless System Crawler - InterConnect 2016
Agentless System Crawler - InterConnect 2016
 
“Benchmarking vs. Benchmarketing: Why Should You Care?,” a Presentation from ...
“Benchmarking vs. Benchmarketing: Why Should You Care?,” a Presentation from ...“Benchmarking vs. Benchmarketing: Why Should You Care?,” a Presentation from ...
“Benchmarking vs. Benchmarketing: Why Should You Care?,” a Presentation from ...
 
Briforum2013 applicationpackagingsmackdown public
Briforum2013 applicationpackagingsmackdown publicBriforum2013 applicationpackagingsmackdown public
Briforum2013 applicationpackagingsmackdown public
 
Dublin Unity User Group Meetup Sept 2015
Dublin Unity User Group Meetup Sept 2015Dublin Unity User Group Meetup Sept 2015
Dublin Unity User Group Meetup Sept 2015
 

Plus de Codemotion

Plus de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codemotion Rome 2017

  • 1. Debug, Analyze and Optimize Games with Intel Tools Surviving the apocalypse on mainstream graphics Matteo Valoriani, FifthIngenium CEO Intel Software Innovator
  • 2. Nice to Meet You www.slideshare.net/MatteoValoriani https://it.linkedin.com/in/matteovaloriani http://fifthingenium.com/blog https://github.com/mvaloriani mvaloriani at gmail dot com @MatteoValoriani Matteo Valoriani CEO of FifthIngenium PhD at Politecnico of Milano Speaker and Consultant 2
  • 3. Agenda 3 • Introduction • Intel® Graphics Performance Analyzers .. What ? • Intel® GPA Live Demo • Optimizations • Conclusion
  • 4. 4
  • 6. 6 Getting Started with Intel® Graphics Performance Analyzers (Intel® GPA) https://goo.gl/2cKmMa
  • 7. Intel® Graphics Performance Analyzers 2017 R1
  • 8. 8 How to Get Started? Download for FREE at https://software.intel.com/gpa/ • No Code Changes Needed • No Environment Changes • No IDE Necessary
  • 9. 9 Intel® GPA - Optimize Your Graphics Applications! High–End GPU Mainstream Graphics 10fps 5fps 60+ fps 5fps 30 fps 30+ fps Intel® Graphics Performance Analyzers
  • 10. Host OS ▪ Win 7, Win 8.1, Win 10 (64- bit) DirectX* ▪ DX 9, 9EX, 10.x, 11.0, 11.1, 12 Target Hardware ▪ Intel, NVidia* & AMD* GPUs ▪ Windows x86 Tablets ▪ HTC Vive*, Oculus Rift* 10 Optimize Windows*, Android*, and Ubuntu* Games! Windows Gaming Android Gaming Host OS ▪ Windows, Ubuntu, Mac* OSX OpenGL* ES ▪ 1.x, 2.x, 3.x Target Hardware ▪ Intel Atom® Android OS ▪ 4.x, 5.x, 6.x Ubuntu Gaming Host OS ▪ Ubuntu 16.04 OpenGL ▪ 3.2, 3.3, 4.0, 4.1 (Core Profile) Target Hardware ▪ Intel® HD Graphics 4k-6k Target OS ▪ Ubuntu 16.04
  • 12. 12 What’s Inside Intel® GPA? System Analyzer / HUD Graphics Frame Analyzer In-game analysis Single frame analysisTimeline analysis Graphics Monitor Launch & config tool Graphics Trace Analyzer
  • 13. 13 How to Use Intel® GPA? HUD / System Analyzer: Frame Analyzer: Trace Analyzer: CPU Limited GPU Limited Capture Frame Capture Trace ?Run with Intel® GPA In-Game Analysis Offline Analysis
  • 14. 14 Graphics Monitor Launch & config tool Define profiles & preferences
  • 15. 15 System Analyzer / HUD In-game analysis • Get metrics for CPU, GPU, graphics drivers, DirectX*, OpenGL*, or OpenGL* ES • Experiment with override modes that quickly isolate common performance bottlenecks • Capture frames and traces for further analysis • Display up to 16 performance metrics simultaneously • Monitor the current, minimum, and maximum frame rate • Use without code modifications or special libraries
  • 18. 18 Graphics Frame Analyzer In-game analysis • Use the API log to identify visual errors by function and call errors and warnings to graphics APIs • Select a draw call and verify its contribution to the frame, alpha channel, color, format, and depth buffers • Quantify performance optimization opportunities with render experiments per draw call • Solve issues with shadowing, lighting, or color schemes by locating misplaced objects
  • 20. Performance Analysis with Hardware Metrics Evaluation Flow to find 3D hotspots 20
  • 21. 21 Published in the 6th generation graphics API dev guide : https://software.intel.com/en-us/articles/6th-gen-graphics-api-dev-guide
  • 22. 22
  • 25. 25 Script Frustum Culling and Co-routines Use the following Monobehavior callbacks to cull scripts outside of the camera frustum that do not need to update when not in focus. Monobehavior callbacks which trigger when object with script leaves / enters the camera frustum
  • 26. 26 Script Frustum Culling and Co-routines (2) Co-routines are essentially functions with the ability to pause and resume execution. The power of co-routines can be leveraged by removing the original Update() function in your script and replacing it with a co-routine. You can then set how often you would like your co- routine to execute using the yield command.
  • 27. 27 Memory Management Optimization A great way to get an overview of how you are managing memory is to check the ‘GC Alloc’ section of the Overview window in Unity Profiler and step through your frames until you see a significant allocation. • To avoid frequent allocations, it is advantageous to use structs instead of classes to have allocations be done on the stack, instead of in the heap. • Multiple allocations to the heap can lead to significant memory fragmentation and frequent garbage collections.
  • 28. 28 Occlusion Culling Occlusion culling is a feature available in Unity that enables you to cull out objects that are occluded by other objects with respect to the camera.
  • 29. 29 Occlusion Culling 1. Go through your entire scene to multi-select any objects that should be included in occlusion culling calculations and mark them as “Occluder Static” and “Occludee Static”. 2. When setting up your occlusion culling system, set your occlusion areas carefully.By default, Unity uses the entire scene as the occlusion area, which can lead to frivolous computation. 3. To make sure that the entire scene isn’t used, create an occlusion area manually and surround only the area to be included in the calculation.
  • 30. 30 LOD Level of Detail (LOD) allows multiple meshes to attach to a game object and provides the ability to switch between meshes the object uses based on camera distance. The LOD can automatically simplify the mesh to compensate. LOD L0 L1 L2 fps 160 180 220
  • 31. 31 Terrain Optimization • Sampler limited • No dynamic branching • Optimized for Legacy HW where sampling was faster than computing LODs • Implementation of dynamic branching increased perf by 2x ( 3ms -> 1.5ms) • Using samplegrad for dynamic LOD selection
  • 33. 33 Conclusion With the right tools : and the right methodology, finding performance bottlenecks is easy !
  • 36. Legal Notices and Disclaimers No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document. Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade. You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products described herein. You agree to grant Intel a non-exclusive, royalty-free license to any patent claim thereafter drafted which includes subject matter disclosed herein. The products and services described may contain defects or errors known as errata which may cause deviations from published specifications. Current characterized errata are available on request. Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. No computer system can be absolutely secure. Check with your system manufacturer or retailer or learn more at [intel.com]. Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. For more complete information visit www.intel.com/benchmarks. Optimization Notice: Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Results have been estimated or simulated using internal Intel analysis or architecture simulation or modeling, and provided to you for informational purposes. Any differences in your system hardware, software or configuration may affect your actual performance. Intel, Atom and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries. *Other names and brands may be claimed as the property of others © Intel Corporation. 36