Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release thay vì aosp-main để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Chế độ đồ hoạ tăng tốc của Cuttlefish sử dụng đơn vị xử lý đồ hoạ (GPU) thực của máy chủ lưu trữ để kết xuất bằng cách truyền lệnh kết xuất của khách đến máy chủ lưu trữ, chạy lệnh gọi kết xuất trên máy chủ lưu trữ và truyền kết quả kết xuất trở lại máy khách.
Thiết bị Cuttlefish chạy Android 11 trở lên sẽ phát hiện và sử dụng đồ hoạ tăng tốc. Nếu máy chủ không hỗ trợ đồ hoạ tăng tốc hoặc phiên bản Android là Android 10 trở xuống, thì tính năng kết xuất phía khách (ví dụ: giao diện người dùng và phát video) trong thiết bị Cuttlefish sẽ do SwiftShader xử lý.
SwiftShader là một phần mềm triển khai API OpenGL và Vulkan. Vì SwiftShader là một phương thức triển khai phần mềm, nên nó cung cấp một giải pháp kết xuất có thể truy cập phổ biến cho Cuttlefish có thể chạy trên bất kỳ máy chủ nào.
Tuy nhiên, việc sử dụng SwiftShader không hiệu quả bằng thiết bị thông thường. Kết xuất là một vấn đề song song có thể được song song hoá một cách mạnh mẽ, vì các giá trị pixel có thể được tính toán độc lập. Đơn vị xử lý đồ hoạ (GPU) là các đơn vị phần cứng giải quyết vấn đề này bằng cách tăng tốc kết xuất.
Yêu cầu
Chế độ đồ hoạ tăng tốc yêu cầu máy chủ có:
Trình điều khiển có khả năng EGL hỗ trợ tiện ích GL_KHR_surfaceless_context
Trình điều khiển có khả năng OpenGL ES
Trình điều khiển có khả năng Vulkan
Sử dụng chế độ đồ hoạ tăng tốc
GfxStream
Để sử dụng chế độ đồ hoạ tăng tốc GfxStream, hãy khởi chạy thiết bị Cuttlefish cục bộ bằng cờ --gpu_mode=gfxstream. Khi sử dụng chế độ này, các lệnh gọi API OpenGL và Vulkan sẽ được chuyển tiếp trực tiếp đến máy chủ lưu trữ.
launch_cvd --gpu_mode=gfxstream
Virgl
Để sử dụng chế độ đồ hoạ tăng tốc Virgl, hãy khởi chạy thiết bị Cuttlefish cục bộ bằng cờ --gpu_mode=drm_virgl.
launch_cvd --gpu_mode=drm_virgl
Khi sử dụng chế độ đồ hoạ tăng tốc Virgl, các lệnh gọi API OpenGL sẽ được dịch thành một bản trình bày trung gian (xem Gallium3D). Nội dung trình bày trung gian được thông báo cho máy chủ và thư viện virglrenderer trên máy chủ sẽ dịch nội dung trình bày trung gian trở lại các lệnh gọi API OpenGL.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 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."]]