Android Studio, Suddenly got GPU Driver Issue when running emulator

AndroidAndroid StudioAndroid Emulator

Android Problem Overview


I have a laptop that I mainly use for android development on android studio, today all of the sudden got this error message (or an outdated version of it) when i ran my emulator

Your GPU driver information:

GPU #1
Make: 8086
Model: Intel(R) HD Graphics Family
Device ID: 0a16
Driver version: 10.18.10.3945
GPU #2
Make: 10de
Model: NVIDIA GeForce 820M
Device ID: 1140
Driver version: 22.21.13.8476 

Some users have experienced emulator stability issues with this driver version. As a result, were selecting a compatibility renderer. Please check with your manufacturer to see if there is an updated driver available. 

Updated the geforce driver, but no use, tried to update the intel one but failed, is there a way to disable this? bypass the compatibility renderer and work as I used to, the emulator is awful now. Any explanation why that occurred all of the sudden?

Also I'm using windows 7 64-bit if that will help with anything, had an update few days ago.

Android Solutions


Solution 1 - Android

I am using Win10 but have the same problem. Emulator started crashing my app after last emulator update. In my case, problem is that emulator does not run on hardware even though I never had a problem with my GPUs. Also, the "GPU driver issue" window that pops up doesn't even label WHICH one of the GPUs it thinks is the problem.

For me the solution that worked is to run emulator from terminal, forcing it to run using hardware graphics (instead of letting emulator decide on which) using command

emulator -avd avd_name -gpu mode

where mode is host so that it will run with hardware.

For example:

Using Android Studio terminal move to folder where the emulator is located. Default on Win10 is: C:\Users<i>userName\AppData\Local\Android\sdk\emulator

Find emulator to run by listing available ones: emulator -list-avds

Run emulator with -gpu host option: emulator -avd avd_name -gpu host

More info on this link

Solution 2 - Android

A comment in the on the bug report pertaining to this issue by a Google employee is illuminating.

> If your system doesn't have a discrete GPU, we intended this change in > order to make the emulator more reliably run on Intel GPU drivers. At > your own risk, you may switch back to using the Intel GPU by going to > settings page, then changing the OpenGL ES renderer to "ANGLE > (D3D11)", "ANGLE (D3D9)", or "Desktop native OpenGL".

It appears that this message is being displayed for all systems using Intel GPUs, not just systems running specific versions of a graphics driver.

The solution is to, if possible, switch to using an external GPU for running the emulator.

If an Intel GPU is the only GPU available on system it is possible to re-enable accelerated rendering of OpenGL ES, by overriding the default OpenGL ES renderer in settings (see below). Options are OpenGL, ANGLE and SwiftShader. SwiftShader is CPU based OpenGL ES emulation, so this setting will not provide a speedup. ANGLE is Direct3d based OpenGL emulation.

As per the comment this is not guaranteed to work, indeed I am able to re-enable hardware acceleration for Android 7 emulators, but with hardware acceleration enabled, all I receive is a black screen for Android 8 emulators.

Open settings with Ctrl-Shift-S then, depending on the version of the emulator, either go to Settings -> General -> OpenGL ES renderer or to Settings -> Advanced -> OpenGL ES renderer

Newer emulator versions: Settings illustration

Older emulator versions: Settings illustration

Update #1: Another comment on the bug report provides further illumination on this issue: > If you have just a Intel HD 4xxx running the emulator, it's intended that a compatibility renderer be used. I'm sorry about it, but we need to be able to switch to better-supported Intel GPU drivers especially when running high API levels (25+) of system images. Intel iGPUs of that generation (and older) have many issues with OpenGL compatibility.

It appears that Intel iGPU drivers for Haswell (4th gen) processor and older don't support OpenGL well enough for Android 7.1+ devices. So they are purposely falling back to using software emulation which better supports the new Android emulators.

This matches my experience. Using the Intel iGPU works great on Android 7, but is flaky on Android 7.1 and doesn't work at all on Android 8.

My suggestion, stick with Android 7 emulators when using hardware acceleration for Intel Haswell and older iGPUs.

Update #2: Official communication on this issue was finally provided in the form of comments in the release notes for Emulator 26.1.3:

>Which GPUs will be switched to use ANGLE or Swiftshader rendering is determined as follows: > >- Older Intel iGPUs have driver issues on both OpenGL and ANGLE D3D drivers. Users with Intel HD Graphics 3xxx and older will use Swiftshader.

  • Some users reported the inability to use API level 25 images because of a bug in which "Pixel Launcher keeps stopping." This seems to be a driver issue in some Intel HD 4xxx models. So they will be switched to use ANGLE automatically. > >For best results with GPU emulation, we recommend either to use a discrete NVIDIA or AMD GPU, or a newer Intel GPU (Iris, HD 5xxx, HD 5xx/6xx).

Solution 3 - Android

I ran into this problem today. Per the suggestion from the Google emulator issue tracker, I installed the beta emulator 26.1.3. Problem fixed.

Solution 4 - Android

As other suggested, go to Settings -> Appearance & Behaviour -> System settings -> Updates. Change "Automatically check updates for" to "Beta channel". Update emulator to latest beta. Driver issue should be gone. I had problems running fragment with google maps (app chrash) that was solved after update of emulator to latest beta.

Solution 5 - Android

I did the same thing as @Api, but I did it from the Virtual Device Manager. In the device edit window, in the Graphics dropdown list, I selected "Hardware - GLES 2.0". I believe the default is Automatic. I still get the erroneous GPU Driver popup window, but the emulator does not crash anymore. It is back to normal reliability.

Solution 6 - Android

For linux users, go to Android Folder which in my case is under ~/Android. Then proceed to /sdk/emulator. "emulator" is a local command. So, you can run the command as local "./emulator".

The rest is done as the user "Api" stated.

$ ./emulator -avd -avd_name -gpu mode

$ ./emulator -avd Nexus_5X_API_26 -gpu host (#IN MY CASE)

Note: I didn't download SDK, instead copy and pasted it under /home dir. That's why the command was not valid on a global scale. If you setup sdk avd from ground-up, it should work just fine.

Solution 7 - Android

I managed to workaround this problem by disabling the use of the GPU so that the AVD uses Software acceleration. It won't be as fast as GPU though, but at least it has better chances to work properly.

I tried other options above but sadly none of them was working.

If you want to try this option, go to the AVD Manager (in Android Studio : Tools -> Android -> AVD Manager), then edit your virtual Device and in the Graphics field, you can set "Software - GLES 1.1" instead if "Hardware - GLES 2.0".

This is not the perfect fix for this problem but it can help.

Solution 8 - Android

On Mac OS (currenly i'm using Catalina)

  1. First move to emulator directory I use the default location

    cd /Users/yourusername/Library/Android/sdk/emulator

  2. Search list of emulator

    ./emulator -list-avds

    example my output is : Pixel_2_XL_API_27

  3. Running emulator using -gpu command

./emulator -avd Pixel_2_XL_API_27 -gpu host

Solution 9 - Android

I'm having the exact same issue from precisely 4 days ago. I've tried both above answers but none of it work. PS. The emulator works, but just crashes seemingly at random. I prior to this error, the emulator worked fine and i could test certain features, i can also debug completely with no crashes via USB with a few android devices so im almost certain its a problem with the emulator.

Edit: Not sure what eactly the problem was, but was solved by forcing Android Studio to run with nVidia GPU.

Solution 10 - Android

How do I update my GPU drivers? Select Windows Start > Control Panel. Open Device Manager. (Or Search Start for Device Manager.) Click the arrow next to Display Adapters. Right-click on Intel HD Graphics and choose Update Driver. Choose Search automatically for updated driver software.

Solution 11 - Android

none of that worked for me on my windows laptop with intel hd4000

what worked is ubuntu linux after i run emulator on linux i was shocked of its speed :)

so it seems the problem with intel and windows won't be resolved soon

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionnewRuserView Question on Stackoverflow
Solution 1 - AndroidApiView Answer on Stackoverflow
Solution 2 - AndroidJadeView Answer on Stackoverflow
Solution 3 - AndroidLeeView Answer on Stackoverflow
Solution 4 - AndroidAlfaSpiderView Answer on Stackoverflow
Solution 5 - AndroidCVDView Answer on Stackoverflow
Solution 6 - AndroidThet HtunView Answer on Stackoverflow
Solution 7 - AndroidR. DuView Answer on Stackoverflow
Solution 8 - AndroidKharis AzharView Answer on Stackoverflow
Solution 9 - AndroidRayzor536View Answer on Stackoverflow
Solution 10 - AndroidAhmedakhtar11View Answer on Stackoverflow
Solution 11 - AndroidAhmed D. SherifView Answer on Stackoverflow