Can't change emulated performance of AVD in Android Studio
Asked Answered
F

11

161

I can't change the graphics to software as I'm sure this is the fix for my AVD not launching. The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.

I'm running the latest version of Android Studio on Ubuntu 17.04.

Screenshot of the configuration of the AVD

Forevermore answered 2/6, 2017 at 11:49 Comment(5)
Hmmm... I am on Ubuntu 16.10, and that drop-down is available to me, with "hardware", "software", and "automatic" options. Try creating a lower-resolution emulator (vs. the 1080p that you are trying right now).Disk
Hmm if I install a Nexus 4, I can change the graphics setting. Weird...Forevermore
@MichelMichels did you find a solution? I have to use maps and Nexus 4 doesn't support this feature.Motorist
I did not find a solution for the Nexus 5X emulator. Only the Nexus 4... I'm sorryForevermore
I found a workaround: I'm starting emulator from command line with -gpu swiftshader_indirect parameter. developer.android.com/studio/run/emulator-acceleration.htmlHalflength
P
136

Actually, this problem seems to be limited to devices with Play Store available, so Nexus 5X and Nexus 5 images will be forced to use Automatic Graphics, but all other devices allow you to choose either Automatic, Hardware or Software graphics.


edit: I've just tested this today and it seems to no longer be the case. At least on MacOS with Android Studio 3.3.2, I can now make a Nexus 5X image with Play Store and Hardware Graphics. I'll do more testing at home later, on Windows and Linux to see if it's related to OS or graphics drivers. AVD screen showing a Nexus 5X device with hardware graphics

Procurator answered 12/10, 2017 at 23:42 Comment(10)
So there is no way to use software graphics AND play store? I can't believe it'd be that bad!Broderic
@LuanNico I've just tested this today and it seems to no longer be the case, at least on MacOS with Android Studio 3.3.2, I can now make a Nexus 5X image with Play Store and Hardware Graphics.Procurator
You can edit the config.ini and change the gpu.mode=host. Worked for me.Finkelstein
The Emulated Performance option is still disabled for me (on Windows) when selecting an emulator profile supporting Google Play.Withindoors
looks like this issue still persists on windows, as of today. Someone please feel free to correct mePhilipphilipa
Can confirm the issue is still there on Linux too (Ubuntu 18.04, i3, Android Studio 4.1.1).Ormond
@DielsonSales Would you mind explaining where do you find this file on the filesystem ?Ormond
@Ormond ~/.android/AVD/<your emulator name>.avd/config.initFinkelstein
Don't forget to enable Skia rendering, that thing really works! developer.android.com/studio/run/…Conk
gpu.mode=software for no acceleration.Caddell
K
84

I also think it's related to whether the Playstore is contained or not, but I cannot explain why.

Dielson Sales already gave the answer which worked for me - unfortunately only in a comment to this answer. I just thought it's worth to make a "real" answer out of it:

Edit the config.ini file of the AVD. Under Linux it's located under /home/<user>/.android/avd/<AVD-name>/config.ini (in my case <AVD-name> is Nexus_5X_API_29.avd).

In a text editor change the lines

hw.gpu.enabled=no
hw.gpu.mode=auto

either to

hw.gpu.enabled=no
hw.gpu.mode=off

or to

hw.gpu.enabled=yes
hw.gpu.mode=host

This setting remains even if opened in the Android Virtual Device Manager of Android Studio. It's just not editable there.

I also tried this, which I found in another AVD:

hw.gpu.enabled=yes
hw.gpu.mode=software

But this is then changed to "no" / "off" by the Android Virtual Device Manager. I didn't look any further so far. hw.gpu.mode=off worked for me. Otherwise my whole Kubuntu hangs (using the Nouveau driver, not the NVidia driver)

Kendalkendall answered 14/10, 2019 at 12:32 Comment(7)
= Does setting the properties like hw.gpu.enabled=no hw.gpu.mode=off make the emulator similar to an old slow device?Selfdenial
Using the Nouveau driver too on a MBP. Using hw.gpu.enabled=no and hw.gpu.mode=off solved "Segmentation fault (core dumped)".Merari
I am using Manjaro and my driver card's NVidia i set to hw.gpu.enabled=no hw.gpu.mode=off and it's worked thanks broInterrogation
hw.gpu.enabled=no; hw.gpu.mode=off. This option worked for me. Thanks!Kara
Thanks for posting a thorough description. Wish I could upvote this more than once!Coextend
For anyone like me who for some reason couldn't open the config.ini through terminal, you can open it if you follow this answer: https://mcmap.net/q/95350/-regarding-gpu-mode-error-in-launching-android-virtual-device. FYI 'Show on Disk' is in the drop down arrow of the Virtual Device ManagerParlormaid
hw.gpu.mode=swiftshader_indirect worked for me (developer.android.com/studio/run/…)Secunda
F
17

Seems like the problem was with the choosen VM. If I choose a Nexus 4, it runs just fine.

Forevermore answered 10/6, 2017 at 12:38 Comment(1)
Currently the Nexus 4 profile doesn't support Google Play, so that might explain why it works.Withindoors
F
15

I am little late on this thread but following are my findings and solution. I am using Ubunut 18.04 and faced the same issue. The solution is to edit AVD and under Emulated Performance, change the grpahics to Software. The problem was that this option was disabled for me. I was unable to change graphics drop down.

I did some more research and found that while creating AVD if you choose default/existing device definition on first screen, you will not be able to edit graphics drop down.

The solution is to create a "New Hardward Profile" while creating AVD and use your new profile. Now, you will be able to edit "Grahics" drop down.

Hope this helps....

Fiorenza answered 30/5, 2019 at 1:29 Comment(4)
I think that's because that profile will lack Google Play support?Withindoors
This helped me most. Just switch to a device emulator that doesn't hold a Play Store, and you can set it to render graphics using software during creation.Wellgrounded
THIS IS THE SOLUTION!Toilet
good tip man! solved here for me, in my case, I simply cloned the device I wanted and enabled the choice.Boss
P
8

It seems all emulators with Play Store cannot emulated performance. I am using AS 4.0

Perdition answered 28/8, 2020 at 10:58 Comment(1)
Agreed on this for AS 4.1 as well.Quaky
V
7

Open Android Virtual Device Manager Android Studio, change VMHeap to 512, RAM to 4096 MB. Then restart Android Studio.

enter image description here enter image description here

Vogue answered 11/4, 2018 at 17:4 Comment(4)
but I still got error: Emulator: glClear:466 GL err 0x502, still couldn't fix that yet.Vogue
It may not work with 4096 MB RAM. With the Android 7.1.1 64-bit emulator, I can only use 2048 MB RAM.Archine
Worked for me. ThanksCoridon
Cannot change those either :-(((Baran
N
3

I think It's just a bug!

Solved the issue by selecting any virtual device had the option enabled and after finishing the installation I just clicked on edit and reselected the device I wanted and the option was still enabled.

Click on edit button from here.

enter image description here

Then change the device to the one you want.

enter image description here

Naphtha answered 29/5, 2020 at 4:24 Comment(0)
G
1

For those who are still searching for solutions on how to make it work with an image containing google play store: install / update your GPU drivers solves the problem. On my Ubuntu 20 this was the issue.

Grishilda answered 7/10, 2020 at 9:30 Comment(0)
E
0

I'm working on mac os - after i upgrade my os my emulator stoped working and one of the solution was to change the graphic settings from hardware to software - since i couldn't - came here ---> turns out Android Emulator HAXM on macOS High Sierra is left out from security reasons follow this link : https://developer.android.com/studio/known-issues#deploy

Escalante answered 3/5, 2021 at 1:1 Comment(0)
F
0

Best solution that worked for me was to install Android Emulator HAXM and update Android studio SDK tools.

Then, Click the drop down arrow in the AVD Manager in the "Actions" column and select "Show on Disk on your target emulator. Using any text editor or IDE if you like, Edit the config.ini file by setting hw.gpu.enabled=no and hw.gpu.mode=off

Save and close editor.

In the AVD manager, do "Wipe data", restart Android studio and afterwards "Cold boot Now".

Fluviatile answered 26/6, 2023 at 9:22 Comment(0)
S
0

I know this is an old thread but I just came across this issue. The resolution seemed to be selecting an x86_64 image which makes sense if it's going to leverage a host's x86_64 system graphics.

Seminarian answered 8/11, 2023 at 13:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.