Hello all,
I'm having trouble getting GPU-acceleration working when running cuttlefish virtual devices in a container.
I followed the build instructions from:
https://github.com/google/android-cuttlefish/blob/main/BUILDING.md#building-the-docker-imageAfter sourcing setup.sh, I created the cvd container and then ran:
ssh vsoc-01@${ip_cuttlefish} -- './download-aosp -A -C -a $(uname -m)'
When I try cvd_start_cuttlefish with either --gpu_mode=gfxstream or --gpu-mode=drm_virgl, things go boink.
Output log when gpu_mode=auto abd boot completes:
https://hastebin.com/monebixuciOutput log when gpu_mode=drm_virgl:
https://hastebin.com/olayapayuzOutput log when gpu_mode=gfxstream:
https://hastebin.com/okobogotetI can launch cvds with
--gpu_mode=gfxstream without issue when doing it outside of a container as per:
https://android.googlesource.com/device/google/cuttlefish/#cuttlefish-getting-startedI'm
not sure if it would be related to the present problem but I had to
make some changes to get my GPU recognized when running the build.sh
script. I kept getting the message "Building without physical-GPU
support". The problem was (I think) that ref_oem wasn't getting defined
(
https://github.com/google/android-cuttlefish/blob/8dd9f222eca1aebdebd03213b82568f1867a1cbe/build.sh#L53)
because the function is_debian_distro doesn't exist. The closest I
could find was is_debian_series, which is defined in utils.sh. I changed
the call in build.sh to is_debian_series, but that was still failing so
I changed an expression within the is_debian_series function, and that
cleared it up. Specifically I changed:
Original line: (
https://github.com/google/android-cuttlefish/blob/8dd9f222eca1aebdebd03213b82568f1867a1cbe/utils.sh#L228)
if ls -1 /etc/*release | egrep -i "(buntu|mint)" > /dev/null 2>&1; then
Changed to:
if cat /etc/os-release | egrep -i "Ubuntu" > /dev/null 2>&1; then
After
making these changes, the GPU IDing and dependency walking/building
process proceeded as per:
https://github.com/google/android-cuttlefish/blob/main/BUILDING.mdI've
tried this both on my local x86-64 system with nvidia GPU as well as on
a gcloud x86-64 instance with nvidia GPU*, and I'm getting the same
error message pertaining to crosvm_control.sock:
[ERROR:external/crosvm/src/
main.rs:2028] invalid value
"/home/vsoc-01/cuttlefish_runtime.1/internal/crosvm_control.sock": this
socket path already exists
Deleting the container directory
/home/vsoc-01/cuttlefish_runtime.1 doesn't fix the problem (I had seen
that mentioned elsewhere as a possible solution.)
Any suggestions?
Thanks,
Mark
* The second changed mentioned above was only done on my local machine (Ubuntu 20.04 and not on the cloud machine, Debian 10). The first change was still required, however.