DigiRL-agent / digirl

Official repo for paper DigiRL: Training In-The-Wild Device-Control Agents with Autonomous Reinforcement Learning.
Apache License 2.0
200 stars 16 forks source link

Stuck at emulator -avd test_Android ... phrase #4

Closed xuyifan-0731 closed 2 months ago

xuyifan-0731 commented 2 months ago

Hi! Thanks for your great work. I am trying to reproduce your work. But when I am following env_setup/README.md, I get stuck at this phrase:

emulator -avd test_Android "-no-window" "-no-audio" "-skip-adb-auth" "-no-boot-anim" "-gpu" "auto" "-no-snapshot-load"

output of my cmd:

emulator -avd test_Android "-no-window" "-no-audio" "-skip-adb-auth" "-no-boot-anim" "-gpu" "auto" "-no-snapshot-load"
INFO    | Storing crashdata in: /tmp/android-xuyifan/emu-crash-34.2.15.db, detection is enabled for process: 2400899
INFO    | Android emulator version 34.2.15.0 (build_id 11906825) (CL:N/A)
INFO    | Found systemPath /raid/xuyifan/opt/.android/system-images/android-28/google_apis/x86_64/
INFO    | Storing crashdata in: /tmp/android-xuyifan/emu-crash-34.2.15.db, detection is enabled for process: 2400899
INFO    | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.
INFO    | Increasing RAM size to 1536MB
WARNING | FeatureControl is requesting a non existing feature.
WARNING | Your GPU drivers may have a bug. Switching to software rendering.
library_mode swangle_indirect gpu mode swangle_indirect
INFO    | Initializing hardware OpenGLES emulation support
android_startOpenglesRenderer: gpu infoI0627 13:51:19.213724 2400899 HealthMonitor.cpp:279] HealthMonitor disabled.
WARNING: could not open libX11.so, try libX11.so.6
I0627 13:51:19.222884 2400899 FrameBuffer.cpp:506] Graphics Adapter Vendor Google (Google Inc.)
I0627 13:51:19.222908 2400899 FrameBuffer.cpp:507] Graphics Adapter Android Emulator OpenGL ES Translator (Google SwiftShader)
I0627 13:51:19.222919 2400899 FrameBuffer.cpp:508] Graphics API Version OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)
I0627 13:51:19.222924 2400899 FrameBuffer.cpp:509] Graphics API Extensions GL_OES_EGL_sync GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_standard_derivatives GL_OES_texture_npot GL_OES_rgb8_rgba8 GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_texture_format_BGRA8888 GL_APPLE_texture_format_BGRA8888 
I0627 13:51:19.222931 2400899 FrameBuffer.cpp:510] Graphics Device Extensions N/A
INFO    | OpenGL Vendor=[Google (Google Inc.)]
INFO    | OpenGL Renderer=[Android Emulator OpenGL ES Translator (Google SwiftShader)]
INFO    | OpenGL Version=[OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)]
INFO    | Monitoring duration of emulator setup.
WARNING | The emulator now requires a signed jwt token for gRPC access! Use the -grpc flag if you really want an open unprotected grpc port
INFO    | Using security allow list from: /raid/xuyifan/opt/.android/emulator/lib/emulator_access.json
WARNING | *** Basic token auth should only be used by android-studio ***
INFO    | The active JSON Web Key Sets can be found here: /run/user/1023/avd/running/2400899/jwks/7fbee0d5-984c-40bf-aa51-0d8354b7708f/active.jwk
INFO    | Scanning /run/user/1023/avd/running/2400899/jwks/7fbee0d5-984c-40bf-aa51-0d8354b7708f for jwk keys.
INFO    | Started GRPC server at 127.0.0.1:8556, security: Local, auth: +token
INFO    | Advertising in: /run/user/1023/avd/running/pid_2400899.ini
I0627 13:51:19.275063 2400946 FrameBuffer.cpp:2853] setDisplayConfigs w 1080 h 2280 dpiX 440 dpiY 440
I0627 13:51:19.275090 2400946 FrameBuffer.cpp:2866] setDisplayActiveConfig 0
##############################################################################
##                        WARNING - ACTION REQUIRED                         ##
##  Consider using the '-metrics-collection' flag to help improve the       ##
##  emulator by sending anonymized usage data. Or use the '-no-metrics'     ##
##  flag to bypass this warning and turn off the metrics collection.        ##
##  In a future release this warning will turn into a one-time blocking     ##
##  prompt to ask for explicit user input regarding metrics collection.     ##
##                                                                          ##
##  Please see '-help-metrics-collection' for more details. You can use     ##
##  '-metrics-to-file' or '-metrics-to-console' flags to see what type of   ##
##  data is being collected by emulator as part of usage statistics.        ##
##############################################################################
INFO    | Cold boot: requested by the user
WARNING | Cold boot: requested by the user
INFO    | Boot completed in 12132 ms
INFO    | Increasing screen off timeout, logcat buffer size to 2M.

It seems that there is no error reported, but get stuck forever. For more information, here is my device:

Static hostname: ubuntu
Icon name: computer-server
Chassis: server
Operating System: Ubuntu 20.04.2 LTS
Kernel: Linux 5.4.0-81-generic
Architecture: x86-64

CUDA Version: 11.4
8* NVIDIA A100-SXM

I confirm that JDK8, sdkmanager, emulator -version, and kvm have shown the same output as in README.md. Thanks a lot for your help.

BiEchi commented 2 months ago

Hi, this is not an error, it means that you've successfully launched the emulator. What you need to do next is to leave this alone and open a new terminal to interact with this emulator. You should be able to find details on what to do next at here.

xuyifan-0731 commented 2 months ago

There is no device found by exceuting "adb devices", and also no screenshot from env_setup/screenshot.py. I think emulator is not successfully launched.

BiEchi commented 2 months ago

From our end, Boot completed in 12132 ms indicates a successful boot, so you should be able to view something like

$ adb devices
# List of devices attached
# emulator-5554   device

@Jiayi-Pan @YifeiZhou02 did you observe any cases like that?

xuyifan-0731 commented 2 months ago

In my case, after showingBoot completed in。。。,I saw:

$ adb devices
# List of devices attached
# emulator-5554   offline

For about 1 min later I execute adb devices again, and I get:

$ adb devices
# List of devices attached

In the same time, other cmd remain

...
INFO    | Cold boot: requested by the user
WARNING | Cold boot: requested by the user
INFO    | Boot completed in 12132 ms
INFO    | Increasing screen off timeout, logcat buffer size to 2M.

and nothing append

YifeiZhou02 commented 2 months ago

This looks strange to me too. We have successfully set the emulator up in many machines. Usually when it says Boot completed, this means that booting is successful and adb devices should be able to find the device. Maybe you can try if you can find any similar issues in other works that use adb android emulators? such as

xuyifan-0731 commented 2 months ago

We have found the reason. If the current port and port + 1 are occupied (for example, 5554 and 5555 are used for a 5554 machine), this strange error message will appear. In the future, we can consider adding judgment to the code to select a reasonable port.