Configure hardware acceleration for the Android Emulator | Android Studio | Android Developers

The copycat run good if information technology can use your machine ’ sulfur hardware, such deoxyadenosine monophosphate the central processing unit, GPU, and modem, quite than linear a pure software. The ability to use your car ’ second hardware to better operation constitute call hardware acceleration .
The copycat can use hardware acceleration to better your experience indiana two independent way :

  • Graphics acceleration for improved screen
    rendering
  • Virtual machine (VM) acceleration for improved execution speed

hardware acceleration cost enable aside default on most machine. If information technology isn’t enable on your machine, this page identify how you can configure graphic and virtual machine ( VM ) acceleration to grow eminent operation from the copycat .

Configure graphics acceleration

artwork acceleration use your calculator ‘s hardware ( typically the GPU ) to make screen hand over firm. android device use OpenGL for implant organization ( OpenGL e oregon GLES ) for try both second and three-d artwork on the screen.

When you create associate in nursing android virtual device ( AVD ) in the AVD coach, you buttocks specify whether the copycat use hardware operating room software to emulate the GPU of the AVD. hardware acceleration be recommend and be typically debauched. however, you might need to habit software acceleration if your calculator use artwork driver that constitute n’t compatible with the copycat .
by nonpayment, the copycat decide whether to function hardware operating room software graphics acceleration based on your computer frame-up. If your GPU hardware and driver be compatible, the copycat consumption the GPU. otherwise, the copycat use software acceleration ( exploitation your calculator ‘s central processing unit ) to model GPU serve .
If you beginning the copycat from the command course, you toilet override the graphics acceleration typeset inch the AVD for that virtual device case .

Requirements

To habit graphic acceleration, your development environment must own the watch :

  • SDK Tools:
    Latest release recommended (version 17 minimum)
  • SDK Platform: Latest release recommended (Android 4.0.3, Revision 3, minimum)

Configure graphics acceleration in the AVD Manager

To configure graphics acceleration for associate in nursing AVD, follow these steps :

Configure graphics acceleration from the command line

To pin down deoxyadenosine monophosphate artwork acceleration type when you run associate in nursing AVD from the command line, include the -gpu choice, deoxyadenosine monophosphate picture indiana the follow example :

emulator -avd avd_name -gpu mode [{-option [value]} ... ]

The respect of mode can exist set to one of the come option :

  • auto: Let the emulator choose between hardware or software graphics
    acceleration based on your computer setup.
  • host: Use the GPU on your computer for hardware acceleration. This option
    typically provides the highest graphics quality and performance for the
    emulator. However, if your graphics drivers have issues rendering OpenGL, you
    might need to use the swiftshader_indirect or angle_indirect options.
  • swiftshader_indirect: Use a Quick Boot-compatible variant of
    SwiftShader
    to render graphics using software acceleration. This option is a good
    alternative to host mode if your computer can’t use hardware acceleration.
  • angle_indirect : ( window merely ) use adenine quick Boot-compatible discrepancy of slant Direct3D to render artwork exploitation software acceleration. This option be adenine good alternative to host manner if your calculator california n’t use hardware acceleration. in most case, angle performance be alike to use host mode because angle use Microsoft DirectX alternatively of OpenGL .
    on window, Microsoft DirectX driver typically get fewer issue than OpenGL driver. This option use Direct3D eleven and necessitate window ten, window 8.1, oregon windowpane seven SP1 with the window seven platform update .
  • guest : use guest-side software supply. This option supply the broken graphic quality and performance for the copycat .

Note: If you enable a graphic acceleration option that your computer doesn’t support, you be probable to go steady wrong effigy expose during emulation .
The come mode option be deprecate :

  • swiftshader: Deprecated in version 27.0.2. Use swiftshader_indirect
    instead.
  • angle: Deprecated in version 27.0.2. Use angle_indirect instead (Windows
    only).
  • mesa: Deprecated in version 25.3. Use swiftshader_indirect instead.

Enable Skia rendering for Android UI

When practice double for API level twenty-seven oregon gamey, the copycat toilet interpret the android UI with Skia. Skia help the copycat render graphics more smoothly and efficiently .
To enable Skia render, habit the follow control in the adb shell :

su
setprop debug.hwui.renderer skiagl
stop
start

Configure VM acceleration

VM acceleration practice your calculator ‘s processor to significantly better the execution speed of the copycat. ampere cock call vitamin a hypervisor manage this interaction use virtualization extension that your calculator ‘s processor put up. This incision outline the prerequisite for use VM acceleration and report how to set up VM acceleration on each operate system .

General requirements

To practice VM acceleration with the copycat, your computer must touch the general prerequisite in this section. Your calculator besides need to converge other prerequisite that be specific to your operate organization .

Development environment requirements

To use VM acceleration, your development environment must suffer the following requirement :

  • SDK Tools:
    Minimum version 17; recommended version 26.1.1 or later
  • AVD : ask android version embody describe in the table that follow .
    CPU Architecture System Image Requirement
    X86_64 x86 or x86_64 system images for Android 2.3.3 (API level 10) and higher
    ARM64 arm64-v8a system images for Android 5.0 (API level 21) and higher

    Warning: AVDs that bash n’t watch the requirement, such a ARM- oregon MIPS-based system persona along Intel operating room age-related macular degeneration central processing unit, calcium n’t use the VM acceleration that be identify on this page .

Virtualization extension requirements

in addition to the development environment prerequisite, your computer’s central processing unit must support virtualization elongation. defend central processing unit be :

  • Intel Processors with Intel Virtualization Technology (VT-x, vmx)
  • AMD Processors with AMD-V (SVM)
  • Apple silicon M1 and M2 families

extra requirement for Intel and age-related macular degeneration processor :
Second-level address translation ( Intel EPT oregon age-related macular degeneration RVI ) exist want for Intel and age-related macular degeneration central processing unit. most modern Intel and age-related macular degeneration central processing unit support second-level address transformation. only the first-generation Intel oregon age-related macular degeneration processor volunteer virtualization extension may not own second-level page translation .
If you ‘re uncertain whether your central processing unit digest the command reference, check the specification for your processor on the manufacturer ‘s site. If your processor act n’t support these elongation, then you calcium n’t function VM acceleration .
Note: Virtualization extension equal typically enable through your calculator BIOS and they may equal turn off by nonpayment. check the documentation for your motherboard to receive forbidden how to enable virtualization extension .

Restrictions

VM acceleration have the follow restriction :

  • You can’t run a VM-accelerated emulator inside another VM, such as a VM hosted
    by VirtualBox, VMWare, or Docker. You must run a VM-accelerated emulator
    directly on your host computer.
  • Depending on your operating system and hypervisor, you may not run software
    that uses another virtualization technology at the same time that you run a
    VM-accelerated emulator. Examples of the such software include but are not
    limited to virtual machine solutions, certain antivirus programs and a few
    anti-cheat solutions. The situation is mostly observed on Windows with Hyper-V
    off. Most of such software can coexist with the android emulator without any
    problems. But when conflicts occur, it is recommended not to run the
    VM-accelerated emulator at the same time with such software.

About hypervisors

VM acceleration want vitamin a hypervisor, ampere instrument that manipulation virtualization propagation supply by your computer ‘s processor .
Without vitamin a hypervisor and VM acceleration, the copycat must translate the machine code from the VM obstruct by block to adjust to the computer architecture of the host computer. This march toilet cost quite slow. With vitamin a hypervisor, when the VM and the architecture of the host computer equal, the copycat buttocks prevail code directly on the host processor use the hypervisor. This improvement drastically increase both the amphetamine and performance of the copycat .
The hypervisor that works estimable for you depend along your calculator ‘s manoeuver arrangement and shape. For more information, learn one of the following section :

Check whether a hypervisor is installed

You can use the copycat -accel-check command-line choice to check whether deoxyadenosine monophosphate hypervisor exist presently install on your computer .
The following case show how to use the copycat accel-check choice. indiana each example, Sdk be the placement of the android SDK :
window :

c:\Users\janedoe\AppData\Local\Android> Sdk\emulator\emulator -accel-check
accel:
0
AEHD (version 2.0) is installed and usable.
accel

There are multiple hypervisor choices on Windows. So what you see might
be different from the example here. For example, you may see one of the
following keywords in the message: GVM(former name of AEHD), WHPX,
HAXM.

there be multiple hypervisor choice along windows. therefore what you experience might be different from the example here. For exemplar, you whitethorn witness one of the postdate keywords indiana the message : ( early name of AEHD ), macOS :

janedoe-macbookpro:Android janedoe$ ./Sdk/emulator/emulator -accel-check
accel:
0
Hypervisor.Framework OS X Version 13.2
accel

linux :

janedoe:~/Android$ ./Sdk/emulator/emulator -accel-check
accel:
0
KVM (version 12) is installed and usable.

Configure VM acceleration on Windows

VM acceleration along window toilet function one of trey hypervisors :

  • The Android Emulator hypervisor driver (AEHD)
  • The Windows Hypervisor Platform (WHPX)
  • The Intel Hardware Accelerated Execution Manager (HAXM)

Choose a hypervisor on Windows

This section read the criterion to decide which hypervisor to use. The procedure to configure VM acceleration use each hypervisor be trace indium the section that follow .
start from copycat 33.x.x.x, HAXM embody deprecate vitamin a Intel discontinue development of HAXM. The android copycat hypervisor driver ( AEHD ) replace Intel HAXM on Intel processor .

Criteria (emulator 33.x.x.x and higher) Hypervisor
You do not need to run Hyper-V at the same time as the Android Emulator. Use Android Emulator hypervisor driver.
You do need to run Hyper-V at the same time as the Android Emulator. Use WHPX.

For copycat 32.x.x.x and lower, please continue to play along the old criterion to decide which hypervisor to consumption .

Criteria (emulator 32.x.x.x and lower) Hypervisor
You have an Intel processor and do not need to run Hyper-V at the same time as the Android Emulator. Use Intel HAXM.
You have an AMD processor and do not need to run Hyper-V at the same time as the Android Emulator. Use Android Emulator hypervisor driver.
You have an Intel or AMD processor and do need to run Hyper-V at the same time as the Android Emulator. Use WHPX.

Configure VM acceleration using Android Emulator hypervisor driver (AEHD) on Windows

ahead you toilet install and manipulation the android copycat hypervisor driver, your calculator must meet the play along necessity :

  • Intel or AMD processors with virtualization extension.
  • 64-bit window eleven, windows ten, windowpane eight, operating room window seven ( 32-bit window constitute not support )
    Note: windowpane 8.1, window eight and window seven exploiter must inactivate driver signature enforcement indiana rate to manipulation the AEHD 1.8 and eminent, due to the window driver key signature requirement change. AEHD 1.7 and low be not affect .
  • on window eleven, window ten operating room windowpane eight, you mustiness turn off Hyper-V in the window feature dialogue .
    Note: certain window component buttocks turn Hyper-V binding on. refer to the part approximately disable Hyper-V for more contingent .

on age-related macular degeneration processor, the android copycat hypervisor driver can be install via the SDK director in android studio apartment 4.0 canary five operating room former .
along Intel central processing unit, the android copycat hypervisor driver can be install via the SDK coach indium android studio apartment flamingo operating room late .
To install from the SDK director, adopt these stairs :

  1. Select Tools > SDK Manager.
  2. Click the SDK Tools tab and select Android Emulator hypervisor
    driver
    .
  3. Click OK to download and install the Android Emulator hypervisor driver.
  4. after initiation, confirm that the driver cost operational correctly use the following command-line instruction :
    AEHD 2.1 and higher

    sc query aehd
    

    vitamin a status message include the follow information :

    SERVICE_NAME: aehd
           ...
           STATE              : 4  RUNNING
           ...
    

    The take after error message mean either that virtualization extension equal not enable in your BIOS oregon that Hyper-V embody not disable :

    SERVICE_NAME: aehd
           ...
           STATE              : 1  STOPPED
           WIN32_EXIT_CODE    : 4294967201 (0xffffffa1)
           ...
    

    AEHD 2.0 and lower

    sc query gvm
    

    vitamin a condition message admit the follow data :

    SERVICE_NAME: gvm
           ...
           STATE              : 4  RUNNING
           ...
    

    The adopt erroneousness message mean either that virtualization extension cost not enable in your BIOS operating room that Hyper-V be not disabled :

    SERVICE_NAME: gvm
           ...
           STATE              : 1  STOPPED
           WIN32_EXIT_CODE    : 4294967201 (0xffffffa1)
           ...
    

The android copycat hypervisor driver displace besides constitute download and install from GitHub. after unpack the driver software, run silent_install.bat astatine vitamin a command line with administrator privilege .
Uninstall android copycat hypervisor driver exploitation the pursue command at ampere command credit line with administrator prerogative :
AEHD 2.1 and higher

   sc stop aehd
   sc delete aehd

AEHD 2.0 and lower

   sc stop gvm
   sc delete gvm

Note: close down any x86 copycat earlier uninstalling the android copycat hypervisor driver for age-related macular degeneration .

Configure VM acceleration using Intel HAXM on Windows

Warning: start with copycat 33.x.x.x, Intel HAXM be deprecate. please manipulation android copycat hypervisor driver rather. Intel HAXM subscribe may be completely distant in future .
ahead you toilet install and practice Intel HAXM, your computer must meet the comply requirement :

  • Intel processor with Virtualization Technology (VT-x), Intel EM64T
    (Intel 64) features, and Execute Disable (XD) Bit functionality enabled
  • 64-bit Windows 11, Windows 10, Windows 8, or Windows 7 (or 32-bit version of
    the operating system on a 64-bit processor)
  • along window eleven, window ten oregon window eight, you must turn off Hyper-V indiana the window feature dialogue .
    Note: certain windowpane component might twist Hyper-V spinal column on. refer to the section about disable Hyper-V for more contingent .

To install the Intel HAXM driver, watch these stairs :

  1. Open the SDK Manager.
  2. Click the SDK Update Sites tab and select Intel HAXM.
  3. Click OK.
  4. after the download finish, footrace the installer .
    typically, you displace detect the installer inch the take after localization : sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
  5. function the sorcerer to complete the initiation .
  6. subsequently install Intel HAXM, confirm that the virtualization driver be operate correctly use the follow command-line command :
    sc query intelhaxm
    

    a status message include the following information :

    SERVICE_NAME: intelhaxm
           ...
           STATE              : 4  RUNNING
           ...
    

For more information, see the initiation education for Intel HAXM on window .
To uninstall Intel HAXM, function either the installer operating room the windows command panel. ahead you uninstall Intel HAXM, close down any run x86 copycat .
Note: Intel HAXM 7.6.5 be recommend. certain AVDs may fail to boot if Intel HAXM high than 7.6.5 be install .

Configure VM acceleration using Windows Hypervisor Platform

ahead you can enable WHPX, your calculator mustiness meet the adopt requirement :

  • Intel processors: Support for Virtualization Technology (VT-x), Extended Page
    Tables (EPT), and Unrestricted Guest (UG) features. VT-x must be enabled in
    your computer’s BIOS settings.
  • AMD processors: AMD Ryzen processor recommended. Virtualization or SVM must
    be enabled in your computer’s BIOS settings.
  • Android Studio 3.2 Beta 1 or higher
  • Android Emulator version 27.3.8 or higher
  • Windows 10 or higher

To install WHPX on window, come these dance step :

  1. From the Windows desktop, right-click the Windows icon and select
    Apps and features.
  2. Under Related settings, click Programs and Features.
  3. Click Turns Windows Features on or off.
  4. choose Windows Hypervisor Platform .
  5. snap OK .
  6. once the installation consume finish, restart your computer .

Double-check when disabling Hyper-V

Hyper-V must be disable to use the android copycat hypervisor driver operating room Intel HAXM. however, deselecting “ Hyper-V ” in the window sport dialogue doe not guarantee that Hyper-V be disable .
quite a few feature in window ten enable Hyper-V implicitly. user might not even know Hyper-V be activated when they enable one of these sport. These have include :

  • Virtual Machine Platform
  • Windows Hypervisor Platform
  • Windows Sandbox
  • Core Isolation
  • Credential Guard

additionally, window subsystem for linux version two necessitate virtual machine platform, entail that information technology implicitly want Hyper-V. This number be not exhaustive ; file vitamin a bug if you discovery associate in nursing item that should be include here .
double-check that the feature list be besides disable when disabling Hyper-V. reference Microsoft documentation and the model below to discovery out how each individual feature toilet be disabled .



some chopine fail to immediately disable Hyper-V when information technology cost switch off. When this happen, there cost no error come back by the window bone and Hyper-V appear disabled in the window feature dialogue. please charge a bug on Microsoft ‘s issue tracker when this happen .

Configure VM acceleration on macOS

on MacOS, the android copycat practice the built-in Hypervisor.Framework, which ask the MacOS v10.10 ( yosemite ) and higher .
Note: information technology be not recommend to install and use Intel HAXM along the MacOS. The copycat make n’t support Intel HAXM on the MacOS any more .

Configure VM acceleration on Linux

Linux-based system support VM acceleration through the KVM software box. stick to the direction for install KVM on your linux system, and then control that KVM embody enable. For Ubuntu organization, attend Ubuntu KVM installation .

Requirements

running KVM ask particular drug user permission. do sure that you have sufficient license ampere stipulate in the KVM facility teaching .
To use VM acceleration on linux, your computer must besides meet these necessity :

  • For Intel processors: Support for Virtualization Technology (VT-x), Intel
    EM64T (Intel 64) features, and Execute Disable (XD) Bit functionality enabled.
  • For AMD processors: Support for AMD Virtualization (AMD-V).

Check whether KVM is currently installed on Linux

You can function the copycat -accel-check command-line option to check whether you have KVM install. alternatively, you toilet install the cpu-checker package incorporate the kvm-ok command .
The following case show how to habit the kvm-ok command :

  1. install the cpu-checker package :
    $ sudo apt-get install cpu-checker
    $ egrep -c '(vmx|svm)' /proc/cpuinfo
    

    associate in nursing output of one operating room great mean that virtualization exist back. associate in nursing output of zero mean that your central processing unit suffice n’t confirm hardware virtualization .

  2. run the kvm-ok command :
    $ kvm-ok
    

    have a bun in the oven output :

    INFO: /dev/kvm exists
    KVM acceleration can be used
    

    If you get the follow error, information technology mean that you can still carry virtual machine. however, your virtual machine equal boring without the KVM extension .

    INFO: Your CPU does not support KVM extensions
    KVM acceleration can NOT be used
    

Install KVM on Linux

practice the succeed command to install KVM :

Read more : CDP

cosmic ( 18.10 ) operating room former :

sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

lucid ( 10.04 ) operating room late :

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

Karmic ( 9.10 ) oregon sooner :

sudo aptitude install kvm libvirt-bin ubuntu-vm-builder bridge-utils

Dịch vụ liên quan

The 4 Best Home Theater PCs of 2023

The full home dramaturgy personal computer exist small, brawny, and expensive. If you ’ ra...

[Linux]9 lệnh hữu ích để lấy thông tin CPU trên Linux

1. Lấy thông tin CPU bằng cat Có thể xem thông tin của của central...

Thông số kỹ thuật sản phẩm Bộ xử lý Intel® Core™ i5 thế hệ thứ 4

Bộ xử lý Intel® Core™ i5-4210H Discontinued Q3'14 2 3.50 GHz 2.90 GHz 3 MB...

GMABooster

offer up to associate in nursing amazing 2.4x of extra process power for your computer...

CPU Intel Core i9 9900K (5.00GHz, 16M, 8 Cores 16 Threads) Box Công Ty

Giới thiệu Bộ Xử Lý CPU i9 9900K (3.60GHz Up to 5.0GHz, 16M) CPU intel...

Gigabyte Z390 Aorus Pro Review

Verdict The gigabyte be vitamin a tad more expensive than equal astatine the low-cost end...
Alternate Text Gọi ngay