【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化

120 Views

September 25, 19

スライド概要

2019/9/25-6に開催されたUnite Tokyo 2019の講演スライドです。
酒本 幹夫(インテル株式会社)

こんな人におすすめ
・Unityを使用したゲーム開発で性能向上を目指したい方

受講者が得られる知見
・Unityを使用したゲーム開発における性能の解析
・ボトルネックの特定、最適化

Unityのイベント資料はこちらから:
https://www.slideshare.net/UnityTechnologiesJapan/clipboards

profile-image

リアルタイム3Dコンテンツを制作・運用するための世界的にリードするプラットフォームである「Unity」の日本国内における販売、サポート、コミュニティ活動、研究開発、教育支援を行っています。ゲーム開発者からアーティスト、建築家、自動車デザイナー、映画製作者など、さまざまなクリエイターがUnityを使い想像力を発揮しています。

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

酒本幹夫 インテル株式会社

2.

アジェンダ • イントロ • ゲームのプロファイリング手順概要 • プロファイリング手順のステップ • 一般的なボトルネックの特定方法 • ケース・スタディー:Unityの3Dゲームキットを最適化 • GPAを使ったパフォーマンス解析の参考になるレシピ @IntelSoftware @IntelGraphics 2

3.

効果的なグラフィックス・パフォーマンスのスケーリング 30 FPS わたしの イカした ゲーム @IntelSoftware @IntelGraphics 3

4.

効果的なグラフィックス・パフォーマンスのスケーリング 30 FPS わたしの イカした ゲーム @IntelSoftware 10 FPS @IntelGraphics 4

5.

効果的なグラフィックス・パフォーマンスのスケーリング 30 FPS わたしの イカした ゲーム @IntelSoftware 10 FPS @IntelGraphics 20 FPS 5

6.

効果的なグラフィックス・パフォーマンスのスケーリング わたしの イカした ゲーム @IntelSoftware 30 FPS 30 FPS 10 FPS 20 FPS @IntelGraphics 6

7.

効果的なグラフィックス・パフォーマンスのスケーリング わたしの イカした ゲーム @IntelSoftware 30 FPS 60 FPS+ 10 FPS 30 FPS+ @IntelGraphics 7

8.

インテル® グラフィックス・パフォーマンス・アナライザー (Intel GPA) System Analyzer @IntelSoftware Graphics Frame Analyzer @IntelGraphics Graphics Trace Analyzer 8

9.

プロファイリング手順 CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 9

10.

プロファイリング手順 CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 10

11.

プロファイリング手順 CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 11

12.

システム・アナライザー概要 @IntelSoftware @IntelGraphics 12

13.

アプリケーション実行中のライブ解析 @IntelSoftware @IntelGraphics 13

14.

プロファイリング手順 CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 フレーム解析 Frame Analysis ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 14

15.

グラフィックス・トレース・アナライザー • 改善されたデータ収集メカニズ ムと、新しいUI • 1つのタイムラインで関連付け られたさまざまなソースから データを収集 • ETWイベント • グラフィックスAPIコール • サンプリングされたメトリック (数値) @IntelSoftware @IntelGraphics 15

16.

グラフィックス・コマンドの発行から終了まで Hardware Queue Driver Queue Graphics API calls @IntelSoftware @IntelGraphics 16

17.

グラフィックス・コマンドの発行から終了まで Hardware Queue Driver Queue Graphics API calls 最終的にGPUで実行されるまでキューが存在し続ける @IntelSoftware @IntelGraphics 17

18.

グラフィックス・コマンドの発行から終了まで キューにすき間が無い Hardware Queue Driver Queue Graphics API calls @IntelSoftware @IntelGraphics 18

19.

GPUバウンドではない Hardware Queue Driver Queue Graphics API calls @IntelSoftware @IntelGraphics 19

20.

GPUバウンドではない Hardware Queue Driver Queue Graphics API calls キューにすき間がある @IntelSoftware @IntelGraphics 20

21.

VSync バウンド @IntelSoftware @IntelGraphics 21

22.

GPU バウンド vs CPU バウンド 比較 GPUキュー内 の一貫した ストリーム? Yes GPU バウンド No フレームタイ ム< VSync? Yes VSync バウンド GPU バウンド No GPUキューに 一貫した ギャップは? Yes 複合要因 No @IntelSoftware CPU バウンド @IntelGraphics GPU バウンドではない 22

23.

アプリケーションごとのGPU使用率を区別する @IntelSoftware @IntelGraphics 23

24.

プロファイリング手順 CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 フレーム解析 Frame Analysis ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 24

25.

CPU バウンド CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 フレーム解析 ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 25

26.

インスツルメンテーション インスツルメンテーションの 他の選択肢 • ETW • PIX/Graphics API markers 選択された領域のホット・ス ポット 特定の領域を詳細調査 @IntelSoftware @IntelGraphics 26

27.

プロファイリング手順 CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット 解析 + フレーム解析 Frame Analysis ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 27

28.

GPU バウンド CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics 28

29.

グラフィックス・フレーム・アナライザー @IntelSoftware @IntelGraphics 29

30.

GPUバウンド • もっとも負荷の高いコールを特定するためのフレーム解析 • 根本要因を自動判定する分析機能をもつ、かんたんホット・スポット解析 フレーム解析 ホット・スポットの特定 GPU bound @IntelSoftware @IntelGraphics 30

31.

もっとも負荷の高いコールを特定する ボトムアップ・アプローチ @IntelSoftware @IntelGraphics 31

32.

もっとも負荷の高いコールを特定する トップダウン・アプローチ @IntelSoftware @IntelGraphics 32

33.

ホット・スポット解析概要 @IntelSoftware @IntelGraphics 33

34.

Geometry Transformation(ジオメトリー変換) • Geometry Transformationボトルネック • 注意することと対策: • 小さな領域にレンダリングされた密なジオメトリー • • 氷山の一角 (5%見えてて 95%見えてない) • • よりアグレッシブなLOD、またはデシメーションが必要 な可能性あり より効率的なカリングのためにジオメトリーをスライス する はぐれ者 (カリングされてないけど見えてない) • オブジェクトがなぜカリングされてないか要デバッグ @IntelSoftware @IntelGraphics 34

35.

Geometry Transformation(ジオメトリー変換) • X軸:レンダーされたピクセル • Y軸:プリミティブ・カウント • 高く細いバー、小さなピクセルにレンダリングされた大きなオブジェクト @IntelSoftware @IntelGraphics 35

36.

Geometry Transformation(ジオメトリー変換) 氷山の一角 @IntelSoftware はぐれ者 @IntelGraphics 密/氷山 36

37.

Geometry Transformation(ジオメトリー変換) • 新しいPythonプラグインシステム • =metric(“GPU Duration”, “>”, 200) • いくつかのプラグインは同梱済み • 自作可能! @IntelSoftware @IntelGraphics 37

38.

プロファイリング手順 CPU バウンド シーンの特定 + CPU vs GPU バウンド? トレース・アナライザーでホット・スポット解析 + フレーム解析 ホット・スポットの特定 GPU バウンド @IntelSoftware @IntelGraphics

39.

ケース・スタディー: Unity 3D Game Kit 概要 Unityアセット・ストアにあるチュートリアル・プロジェクト 3つのビルトイン設定‘Performance’、‘Balanced’、‘Fantastic’ 今回のゴール: ‘Performance’ モード FPS を‘Fantastic’ モードの画像品質で @IntelSoftware @IntelGraphics 39

40.

ケース・スタディー: Unity 3D Game Kit 差分を見つける 何が”Fantastic”を”Performance”よりも見栄え良くしているのか? @IntelSoftware @IntelGraphics 40

41.

ケース・スタディー: Unity 3D Game Kit パフォーマンスのゴールを決める 何が”Fantastic”を”Performance”よりも見栄え良くしているのか? 遠景の描画 @IntelSoftware @IntelGraphics 水の反射 影 41

42.

ケース・スタディー: Unity 3D Game Kit 改善例 何が”Fantastic”を”Performance”よりも見栄え良くしているのか? 遠景の描画 @IntelSoftware @IntelGraphics 水の反射 影 42

43.

ケース・スタディー: Unity 3D Game Kit どうやったか? 品質vs性能の綱引き、描画量を増やすための余力を作り出す @IntelSoftware @IntelGraphics 43

44.

ケース・スタディー: Unity 3D Game Kit ゲームの構造を理解する @IntelSoftware @IntelGraphics 44

45.

ケース・スタディー: Unity 3D Game Kit ゲームの構造を理解する フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 45

46.

ケース・スタディー: Unity 3D Game Kit スカイボックスが3msかかってる? ~フレーム予算の10% フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 46

47.

ケース・スタディー: Unity 3D Game Kit スカイボックスの描画を調査 @IntelSoftware @IntelGraphics ~フレーム予算の10% 47

48.

ケース・スタディー: Unity 3D Game Kit スカイボックスの描画を調査 @IntelSoftware @IntelGraphics ~フレーム予算の10% 48

49.

ケース・スタディー: Unity 3D Game Kit スカイボックスのデファラード描画 ~フレーム予算の10% フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 49

50.

ケース・スタディー: Unity 3D Game Kit スカイボックスをフォワード描画で0.8msに ~フレーム時間の10%から2.4%に改善! フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 50

51.

ケース・スタディー: Unity 3D Game Kit 玉ねぎの皮をどんどんむいていこう フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 51

52.

ケース・スタディー: Unity 3D Game Kit ~フレーム予算の14.5% 反射描画に4.8ms フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 52

53.

ケース・スタディー: Unity 3D Game Kit 反射描画を調査 @IntelSoftware @IntelGraphics 53

54.

ケース・スタディー: Unity 3D Game Kit 32反射プローブ? もうちょっと少なくできるか? ~フレーム予算の14.5% フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 54

55.

ケース・スタディー: Unity 3D Game Kit 32から3に反射プローブを減らして2.1ms 14.5%から6.4%のフレーム予算に削減! フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 55

56.

ケース・スタディー: Unity 3D Game Kit 玉ねぎの皮をどんどんむいていこう フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 56

57.

ケース・スタディー: Unity 3D Game Kit UI 描画に 1.8msかかっている ~フレーム予算の8% フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 57

58.

ケース・スタディー: Unity 3D Game Kit UI レンダリングを調査 @IntelSoftware @IntelGraphics 58

59.

ケース・スタディー: Unity 3D Game Kit テキストのぼかしは高負荷、どのくらい? ~フレーム予算の8% フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 59

60.

ケース・スタディー: Unity 3D Game Kit ぼかし無しのUIレンダリングで0.2ms フレーム予算の8%から0.6%へ改善! Frame Budget (30 FPS) @IntelSoftware @IntelGraphics 60

61.

ケース・スタディー: Unity 3D Game Kit 確認してみよう:38FPSになった! これらの最適化 の結果、38FPS に動作を改善 今度は省略され てしまっていた ものを戻し始め よう 大物からやって みる:遠景のカ リング フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 61

62.

ケース・スタディー: Unity 3D Game Kit 遠景のカリングを復元 前 38FPS 後 33FPS まだ余裕がある もっと増やして みよう フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 62

63.

ケース・スタディー: Unity 3D Game Kit いっきに全部戻し! 前 33FPS 後 28FPS 8%予算を超えた が、水の反射と影 が復活! 予算に収まる範囲 内で、手軽にでき ることは? フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 63

64.

ケース・スタディー: Unity 3D Game Kit デファラード・レンダー・ターゲットをダウン・スケール デファラード・レ ンダー・ターゲッ トを元のサイズが からダウン・ス ケール 最終段のパスで アップ・スケール し、UIをフル解像 度で描画 もとのフレーム予 算に戻った! フレーム予算 (30 FPS) @IntelSoftware @IntelGraphics 64

65.

他のレシピ フレーム・キャプチャーをトリガー実行 @IntelSoftware @IntelGraphics 65

66.

他のレシピ ストリームのキャプチャー @IntelSoftware @IntelGraphics 66

67.

他のレシピ ストリームのキャプチャー @IntelSoftware @IntelGraphics 67

68.

他のレシピ ストリームのキャプチャー @IntelSoftware @IntelGraphics 68

69.

他のレシピ アドバンスド・プロファイリング・モード @IntelSoftware @IntelGraphics 69

70.

他のレシピ カウンター固定機能 @IntelSoftware @IntelGraphics 70

71.

他のレシピ カウンターの比較 @IntelSoftware @IntelGraphics 71

72.

まとめ • 効率的にグラフィックスの性能をスケールさせよう • パフォーマンスに配慮することは全員の任務 • インテル® GPAを無料でゲット @ https://software.intel.com/en-us/gpa • 遠慮なく終了後私に質問をどうぞ • ご自身の手でお試しください! @IntelSoftware @IntelGraphics 72

73.

Questions?

74.

法務上の注意書きと最適化に関する注意事項 本資料の情報は、現状のまま提供され、本資料は、明示されているか否かにかかわらず、また禁反言によるとよらずにかかわらず、いかなる知 的財産権のライセンスも許諾するものではありません。製品に付属の売買契約書『Intel's Terms and Conditions of Sale』に規定されている場合 を除き、インテルはいかなる責任を負うものではなく、またインテル製品の販売や使用に関する明示または黙示の保証 (特定目的への適合性、商 品性に関する保証、第三者の特許権、著作権、その他、知的財産権の侵害への保証を含む) をするものではありません。 性能に関するテストに使用されるソフトウェアとワークロードは、性能がインテル® マイクロプロセッサー用に最適化されていることがあります。 SYSmark* や MobileMark* などの性能テストは、特定のコンピューター・システム、コンポーネント、ソフトウェア、操作、機能に基づいて 行ったものです。結果はこれらの要因によって異なります。製品の購入を検討される場合は、他の製品と組み合わせた場合の本製品の性能など、 ほかの情報や性能テストも参考にして、パフォーマンスを総合的に評価することをお勧めします。詳細については、www.intel.com/benchmarks (英語) を参照してください。 © 2019 Intel Corporation.無断での引用、転載を禁じます。 Intel、インテル、Intel ロゴ は、アメリカ合衆国および / またはその他の国における Intel Corporation またはその子会社の商標です。 * その他の社名、製品名などは、一般に各社の表示、商標または登録商標です。 最適化に関する注意事項 インテル® コンパイラーでは、インテル® マイクロプロセッサーに限定されない最適化に関して、他社製マイクロプロセッサー用に同等の最適 化を行えないことがあります。これには、インテル® ストリーミング SIMD 拡張命令 2、インテル® ストリーミング SIMD 拡張命令 3、インテ ル® ストリーミング SIMD 拡張命令 3 補足命令などの最適化が該当します。インテルは、他社製マイクロプロセッサーに関して、いかなる最 適化の利用、機能、または効果も保証いたしません。本製品のマイクロプロセッサー依存の最適化は、インテル® マイクロプロセッサーでの 使用を前提としています。インテル® マイクロアーキテクチャーに限定されない最適化のなかにも、インテル® マイクロプロセッサー用のもの があります。この注意事項で言及した命令セットの詳細については、該当する製品のユーザー・リファレンス・ガイドを参照してください。 注意事項の改訂 #20110804 @IntelSoftware @IntelGraphics

75.

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, Core 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. @IntelSoftware @IntelGraphics