Score:0

Android Studio emulator only crashes when using `nouveau` driver, OK with `i915` intel driver

in flag

I'm running Kubuntu 20.04LTS on a 1st-gen Optimus-enabled ThinkPad T410s (dual graphics, Intel + NVIDIA).

Whenever I run Android Studio device emulator (installed with dependencies according to official instructions here) using the nouveau driver, the virtual device opens but crashes after the first click on the UI.

When running it under the i915 / intel driver (Intel HD graphics, i5-i540M processor), it runs OK.

When booting under the i915 / intel driver but running the emulator with env DRI_PRIME=1 to have it using NVIDIA graphics via nouveau, it runs but crashes on the first interaction with a mouse click.

My reasons for not using the proprietary NVIDIA driver (340.108 for my machine) are:

  • It sort of breaks RANDR behaviour
  • Can't and won't ever handle DRI_PRIME

This is why I've preferred sticking to nouveau, which runs at decent speeds on the on-board NVS3100M chip on this T410s ThinkPad when invoked with env DRI_PRIME=1.

When running the emulator via command line with env DRI_PRIME=1 ~/Android/Sdk/tools/emulator -avd Galaxy_Note_3_API_25 &, what I see is:

handleCpuAcceleration: feature check for hvf
emulator: INFO: QtLogger.cpp:68: Warning: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled ((null):0, (null))


emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) ((null):0, (null))


emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))


emulator: Warning: skin file button uses unknown key name 'menu'
emulator: Warning: skin file button uses unknown key name 'dpad-select'
emulator: Warning: skin file button uses unknown key name 'T'
emulator: Warning: skin file button uses unknown key name 'NEXT'
cannot add library /home/dmayr/Android/Sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /home/dmayr/Android/Sdk/emulator/lib64/vulkan/libvulkan.so
emulator: INFO: GrpcServices.cpp:315: Started GRPC server at 127.0.0.1:8554, security: Local
emulator: INFO: EmulatorAdvertisement.cpp:93: Advertising in: /run/user/1000/avd/running/pid_229634.ini
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037

# Upon clicking the UI
[1]  + 229634 segmentation fault (core dumped)  env DRI_PRIME=1 ~/Android/Sdk/tools/emulator -avd Galaxy_Note_3_API_25

I wanted to launch the Android Studio emulator taking advantage to the video acceleration provided by the NVIDIA chip, but so far it has been impossible.

Has this happened to any of you?

Have you found a way around it, or have you stuck to running the emulator on the integrated Intel video (my current situation)?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.