Skip to content

Emulator attached GPU but not use GPU at all #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pnthai88 opened this issue Aug 6, 2023 · 0 comments
Open

Emulator attached GPU but not use GPU at all #353

pnthai88 opened this issue Aug 6, 2023 · 0 comments

Comments

@pnthai88
Copy link

pnthai88 commented Aug 6, 2023

Hello,

I'm facing strange issue. Emulators connected GPU but these vms does not use GPU.
image

My GPU driver setup in host:

1./ sudo apt-get purge nvidia-*
2./ sudo add-apt-repository ppa:graphics-drivers/ppa
3./ sudo apt-get update
4./ sudo apt-get install nvidia-driver-535
5./ sudo reboot
.
.
.
6./ nvidia-smi (check nvidia driver installed)
7./ curl https://get.docker.com | sh \
  && sudo systemctl --now enable docker
8./ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
9./ sudo apt-get update
10./ sudo apt-get install -y nvidia-container-toolkit
11./ sudo nvidia-ctk runtime configure --runtime=docker
12./ sudo systemctl restart docker

My inside container setup

....
# Install required packages
RUN apt-get update \
    && apt-get install -y \
    vulkan-tools \
    vulkan-utils \
    libnvidia-gl-535
...

Trying to start container

###### emulator @emulator-5554 -cores 2 -gpu host ######
INFO    | Android emulator version 32.1.14.0 (build_id 10330179) (CL:N/A)
INFO    | Found systemPath /opt/android/system-images/android-29/google_apis/x86_64/
INFO    | Storing crashdata in: /tmp/android-unknown/emu-crash.db, detection is enabled
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
WARNING | Please update the emulator to one that supports the feature(s): Vulkan
WARNING | cannot add library /opt/android/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
INFO    | added library /opt/android/emulator/lib64/vulkan/libvulkan.so
host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextCould not init `pa' audio driver
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO    | Started GRPC server at 127.0.0.1:8554, security: Local, auth: none
WARNING | Using fallback path for the emulator registration directory.
WARNING | .ini File /root/.android/avd/running/288 too large (9223372036854775807 bytes)
INFO    | Advertising in: /root/.android/avd/running/pid_2707.ini
WARNING | Using fallback path for the emulator registration directory.
WARNING | .ini File /root/.android/avd/running/288 too large (9223372036854775807 bytes)
WARNING | .ini File /root/.android/avd/running/288 too large (9223372036854775807 bytes)
INFO    | Setting display: 0 configuration to: 1080x1920, dpi: 480x480 

i take focus on this log, it seem not correct, i tried to use "sdkmanager --update" but no help

WARNING | Please update the emulator to one that supports the feature(s): Vulkan
WARNING | cannot add library /opt/android/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
INFO    | added library /opt/android/emulator/lib64/vulkan/libvulkan.so

The container started successfully, i see it listed in nvidia-smi on host
image

But it did not listed inside container...
image

I think it's problem to use GPU. How can i solve this problem to able to use GPU to gain higher performance ?

Thanks,
BR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant