google / android-riscv64

Issues and discussions around RISC-V support in AOSP.
Apache License 2.0
226 stars 15 forks source link

Build instructions for the prebuilt QEMU with rutabaga/gfxstream support ? #145

Open Ruinland opened 7 months ago

Ruinland commented 7 months ago

The instructions on crsovm doc seems kinda outdated.

I am having linking issues during the final stage when building QEMU :

/usr/bin/ld: /data_ssd_2t/ruinland_aosp/cuttlefish/qemu_rutabaga/build/deps/prefix/lib/librutabaga_gfx_ffi.so: undefined reference to `gfxstream::vk::EmulatedPhysicalDeviceMemoryProperties::tr
ansformToGuestMemoryRequirements(VkMemoryRequirements*) const'
/usr/bin/ld: /data_ssd_2t/ruinland_aosp/cuttlefish/qemu_rutabaga/build/deps/prefix/lib/librutabaga_gfx_ffi.so: undefined reference to `gfxstream::vk::EmulatedPhysicalDeviceMemoryProperties::Em
ulatedPhysicalDeviceMemoryProperties(VkPhysicalDeviceMemoryProperties const&, unsigned int, gfxstream::host::FeatureSet const&)'
/usr/bin/ld: /data_ssd_2t/ruinland_aosp/cuttlefish/qemu_rutabaga/build/deps/prefix/lib/librutabaga_gfx_ffi.so: undefined reference to `gfxstream::vk::EmulatedPhysicalDeviceMemoryProperties::ge
tHostMemoryInfoFromGuestMemoryTypeIndex(unsigned int) const'

I doubly checked with libgfxstream_backend.a, the symbols are indeed undefined :

0000000000000000 W gfxstream::vk::EmulatedPhysicalDeviceMemoryProperties::getGuestMemoryProperties() const
                 U gfxstream::vk::EmulatedPhysicalDeviceMemoryProperties::transformToGuestMemoryRequirements(VkMemoryRequirements*) const
                 U gfxstream::vk::EmulatedPhysicalDeviceMemoryProperties::getHostMemoryInfoFromGuestMemoryTypeIndex(unsigned int) const
...
0000000000009f58 T gfxstream::vk::importExtMemoryHandleToVkColorBuffer(unsigned int, unsigned int, int)
                 U gfxstream::vk::EmulatedPhysicalDeviceMemoryProperties::EmulatedPhysicalDeviceMemoryProperties(VkPhysicalDeviceMemoryProperties const&, unsigned int, gfxstream::host::Feature
Set const&)

And these methods are supposedly to be part of gfxstream.

Is there a write up of details (including proper commit hashes) for building the QEMU with rubataga/gfxstream ? I tried the ones from : https://linaro.atlassian.net/wiki/spaces/ORKO/pages/28985622530/Building+QEMU+with+virtio-gpu+and+rutabaga+gfx Yet the commit hashes are quite old and fail to build.

Kamboh223 commented 7 months ago

Screenshot_2024-04-19-00-42-03-823_org lsposed manager

enh-google commented 7 months ago

(all we have atm is device/google/cuttlefish_vmm/qemu --- this has the README and build scripts, but there's no nice step by step, as the build process is finicky.)

Ruinland commented 6 months ago

Thanks @enh-google , I managed to get the QEMU built with gfxstream by taking a look at the build script.

However, the problem I am encountering now is that - - the output of bootanimation is fine. Even though the cvd-launcher constantly spills this error message :

E4018 14:05:07.989282 454871 FrameBuffer.cpp:3303] Failed to find process owned resources for puid 13996581337902

And once the Android init brings up SystemUI, the cvd launcher floods with this error every single ms all over the place :

qemu-system-riscv64: CHECK failed in rubataga_cmd_resource_flush() ../qemu/hw/display/virtui-gpu-rutabaga.c:234
qemu-system-riscv64: virtio_gpu_rutabaga_process_cmd: ctrl 0x104, error 0x1200

in the meantime, the display is filed with noises : snowflake_noise

====

Shall I rename this issue or close it and then open a new one ?

enh-google commented 6 months ago

Shall I rename this issue or close it and then open a new one ?

you might be better off on the mailing list, since i don't know how many people other than me and prashanthsw subscribe to all the issues, and we don't use this configuration... you're more likely to get help from another non-Googler trying to do the same thing than you are from us :-)

enh-google commented 6 months ago

btw, did you see that we [well, "prashanthsw"] updated to qemu 9? i don't remember why you were trying to build your own qemu, but if you just wanted a newer one...

Ruinland commented 6 months ago

@enh-google

we don't use this configuration

You mean gfxstream in general or QEMU 8.2 build w/ rubataga ?

Thanks a lot for the tips. I will write up a report and asked in the mailing list. Yet I think I will keep this issue for non-RVIA members.

= = = =

i don't remember why you were trying to build your own qemu

Well, vendor flavored QEMU is always a thing. And I believe rubataga was once an offshoot, right 🤣