2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
Cuttlefish: GPU グラフィック アクセラレーション
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Cuttlefish のアクセラレーテッド グラフィック モードでは、ホストマシンの物理的な画像処理装置(GPU)を使用してレンダリングを行います。ゲストのレンダリング コマンドをホストマシンに渡し、ホストマシン上でレンダリング コマンド呼び出しを実行して、その結果をゲストに返します。
Android 11 以降を搭載した Cuttlefish デバイスは、アクセラレーテッド グラフィックを検出して使用します。ホストマシンがアクセラレーテッド グラフィックをサポートしていない場合、または Android のバージョンが Android 10 以前の場合、Cuttlefish デバイスでのゲスト側のレンダリング(UI や動画再生など)は、SwiftShader によって処理されます。SwiftShader は、OpenGL API と Vulkan API のソフトウェア実装です。ソフトウェア実装であるため、どのホストマシンでも実行できる Cuttlefish に、汎用的にアクセス可能なレンダリング ソリューションを提供します。
ただし、仮想デバイスでの SwiftShader の使用は、通常のデバイスに比べてパフォーマンスの面で劣ります。レンダリングは、ピクセル値の計算が独立して行われると超並列化が発生する可能性がある並列問題です。この問題に対処するために、ハードウェア ユニットである画像処理装置(GPU)を使用して処理を高速化することができます。
要件
アクセラレーテッド グラフィック モードを使用する場合、ホストに以下が必要です。
GL_KHR_surfaceless_context
拡張機能をサポートする EGL 対応ドライバ
- OpenGL ES 対応ドライバ
- Vulkan 対応ドライバ
アクセラレーテッド グラフィック モードの使用
GfxStream
GfxStream アクセラレーテッド グラフィック モードを使用するには、--gpu_mode=gfxstream
フラグを指定してローカルの Cuttlefish デバイスを起動します。このモードを使用すると、OpenGL API と Vulkan API の呼び出しがホストに直接転送されます。
launch_cvd --gpu_mode=gfxstream
Virgl
Virgl アクセラレーテッド グラフィック モードを使用するには、--gpu_mode=drm_virgl
フラグを指定してローカルの Cuttlefish デバイスを起動します。
launch_cvd --gpu_mode=drm_virgl
Virgl アクセラレーテッド グラフィック モードを使用すると、OpenGL API の呼び出しが中間表現に変換されます(Gallium3D を参照)。この中間表現がホストに伝送され、ホストの virglrenderer ライブラリによって OpenGL API の呼び出しに再び変換されます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-26 UTC。"],[],[],null,["# Cuttlefish: GPU graphics acceleration\n\nCuttlefish's accelerated graphics mode uses your host machine's physical\ngraphics processing unit (GPU) for rendering by passing guest rendering commands\nto your host machine, running the rendering commands calls on your host machine,\nand passing the rendered results back to the guest.\n\nA Cuttlefish device running in Android 11 or higher\ndetects and uses accelerated graphics. If the host machine doesn't support\naccelerated graphics or the Android version is\nAndroid 10 or lower, guest-side rendering (for example,\nUI and video playback) in your Cuttlefish device is handled by SwiftShader.\nSwiftShader is a software implementation of the OpenGL and Vulkan APIs. Because\nSwiftShader is a software implementation, it provides a universally accessible\nrendering solution for Cuttlefish capable of running on any host machine.\n\nHowever, using SwiftShader isn't as performant as a normal device. Rendering is\na parallel problem that can be massively parallelized, as pixel\nvalues can be computed independently. Graphics processing units (GPUs) are\nhardware units that address this problem by accelerating rendering.\n\nRequirements\n------------\n\nAccelerated graphics mode requires that the host have:\n\n- EGL capable driver supporting the `GL_KHR_surfaceless_context` extension\n- OpenGL ES capable driver\n- Vulkan capable driver\n\nUse accelerated graphics modes\n------------------------------\n\n### GfxStream\n\nTo use the GfxStream accelerated graphics mode, launch your local Cuttlefish\ndevice with the `--gpu_mode=gfxstream` flag. Using this mode, OpenGL and Vulkan\nAPI calls are forwarded directly to the host. \n\n```\nlaunch_cvd --gpu_mode=gfxstream\n```\n\n### Virgl\n\nTo use the Virgl accelerated graphics mode, launch your local Cuttlefish device\nwith the `--gpu_mode=drm_virgl` flag. \n\n```\nlaunch_cvd --gpu_mode=drm_virgl\n```\n\nWhen using the Virgl accelerated graphics mode, OpenGL API calls are translated\ninto an intermediate representation (see\n[Gallium3D](https://www.freedesktop.org/wiki/Software/gallium/)). The\nintermediate representation is communicated to the host and the\n[virglrenderer](https://gitlab.freedesktop.org/virgl/virglrenderer) library on\nthe host translates the intermediate representation back to OpenGL API calls.\n| **Note:** Vulkan isn't supported."]]