25 Commits
Author SHA1 Message Date
Will Hollins ce691026d9 Fix vulkan library search path on emu-next
Bug: 436554408
Change-Id: Iec18d031a80a8f7acd3386ddb3f1762e7467128a
2025-09-11 08:25:45 +00:00
Serdar Kocdemir 9625af3ac4 Adjust ICD path setting to avoid loader errors
Only use launcher directory when the icd file cannot be found under
the program directory. Avoids 'Failed to open JSON file' errors
thrown from the loader.

Bug: 390345102
Test: run with VVL and VK_LOADER_DEBUG
Change-Id: I72e9832ff95f0e0037a5a1328a89f327965bf249
2025-06-24 23:54:43 +00:00
Jason Macnak c2b159afd1 Move logging to common
and add Android support which uses __android_log_print to
the default callback. This will allow us to eventually build
and run the guest libs in a standalone bazel environment without
Android libs (no "liblog", "libcutils", etc).

Misc notes:

 * Updates some cases of ANDROID vs __ANDROID__. The former is
   set when building with Soong (either host or guest) while the
   latter is set specifically when targeting the Android platform.
   Some places that were using ANDROID needed to be fixed to use
   __ANDROID__ to properly detect when to use ANativeWindow.

 * Updates the EGL platform header to address something similar
   to the above where we may want to use X11 display when building
   host binaries with Soong where ANDROID may still be defined.

Bug: b/416342919

Test: cd hardware/google/gfxstream
      bazel build ...
      bazel test ...

Test: cd hardware/google/gfxstream
      mma

Test: cd hardware/google/gfxstream
      mkdir build && cd build
      cmake .. -G Ninja
      ninja

Test: meson setup \
        -Ddefault_library=static \
        -Dgfxstream-build=host \
        build

      meson compile -C build

Test: cd <emu main dev repo>
      cd external/qemu
      python android/build/python/cmake.py --gfxstream

Test: cd <emu main next repo>
      prebuilts/bazel/linux-x86_64/bazel test \
      --platforms=@//build/bazel/platforms:linux_x64 \
     @gfxstream//...
Change-Id: I4db669047f3900392d50509c470ea350d94a64ba
2025-05-14 16:51:19 -07:00
Jason Macnak b001c743d3 Update non interface parts of Gfxstream to use new base lib
NO_IFTTT=existing field covered with type change

Bug: b/403363880

Test: cd hardware/google/gfxstream
      mma

Test: cd hardware/google/gfxstream
      mkdir build && cd build
      cmake .. -G Ninja
      ninja

Test: meson setup \
        -Ddefault_library=static \
        -Dgfxstream-build=host \
        build

      meson compile -C build

Test: cd <emu master dev repo>
      cd external/qemu
      python android/build/python/cmake.py --gfxstream

Test: cd <emu main next repo>
      prebuilts/bazel/linux-x86_64/bazel test \
      --platforms=@//build/bazel/platforms:linux_x64 \
     @gfxstream//...
Change-Id: I6bfb2c4ef8368799d9f99f6293d9762b7dcb4c7f
2025-05-01 16:29:17 +00:00
Jason Macnak 937ef1d2d6 Remove gl-host-common dependency on aemu/host-common
... to continue working on breaking up dependencies on
hardware/google/aemu to support a standalone build.

NO_IFTTT=renderer not snapshot/restored in context

Bug: b/403363880
Test: cvd create --gpu_mode=gfxstream
Test: cvd create --gpu_mode=gfxstream_guest_angle
Change-Id: I6378c0c1139a12f9f3ab8cede6274cf9bda85bc0
2025-04-16 10:50:38 -07:00
Jason Macnak a43dfa9f3c Add gfxstream host logging lib
... to eventually replace the existing host-common/logging. This
is needed to break up the circular dependency between aemu-base and
aemu-host-common, so that we can move parts of aemu-base and
aemu-host-common into hardware/google/gfxstream, in order to make
Gfxstream a self contained library for building.

Hooks up the existing host-common/logging via the
RenderLibImpl::setLogger() call.

Bug: b/403363880

Test: cd hardware/google/gfxstream
      mma

Test: cd hardware/google/gfxstream
      mkdir build && cd build
      cmake .. -G Ninja
      ninja

Test: meson setup \
        -Ddefault_library=static \
        -Dgfxstream-build=host \
        build
      meson compile -C build

Test: cd <emu master dev repo>
      cd external/qemu
      python android/build/python/cmake.py --gfxstream

Test: cd <emu main next repo>
      prebuilts/bazel/linux-x86_64/bazel test \
      --platforms=@//build/bazel/platforms:linux_x64 \
     @gfxstream//...

Change-Id: Id52c6f756f85d0a5fb948601228234d7a84a14c2
2025-04-09 13:11:08 -07:00
Serdar Kocdemir 35db18236b Enable warnings as errors on cmake builds
And fix various compilation warnings.

Bug: N/A
Test: rebuild
Change-Id: Ife3489b29b1f2822f69d77ce4305b6b31b19d1cf
2025-03-14 14:01:26 +00:00
sergiuferentz 74f9a95f6a Enabling lavapipe --gpu lavapipe option
* We are keeping Swiftshader as GL driver while enabling lavapipe for VK

Test: emulator -gpu lavapipe -no-snapshot -avd p95 -verbose
adb shell dumpsys SurfaceFlinger | grep GLES -> swiftshader
adb shell cmd gpu vkjson | grep driver -> llvmpipe

Bug: 389597454

Change-Id: Ie90b23bc1e21dbca007bf568cb89a90f40eadc4e
2025-02-19 13:15:28 +00:00
Serdar Kocdemir fab4c9486c Revert^2 "Use VK_DRIVER_FILES instead of VK_ICD_FILENAMES"
55141140cb

Change-Id: Ie62845b26382dc0f1a760c7a501862fd9906c20e
2025-01-17 04:54:14 -08:00
Serdar Kocdemir 55141140cb Revert "Use VK_DRIVER_FILES instead of VK_ICD_FILENAMES"
Revert submission 3437479-VK_DRIVER_FILES1

Reason for revert: 388822941

(This topic also depends on 3438446 for relanding)

Reverted changes: /q/submissionid:3437479-VK_DRIVER_FILES1

Change-Id: I91051e71a5de5814511bee827f73fa67d4770f9c
2025-01-10 09:10:03 -08:00
Serdar Kocdemir a9bd42933e Use VK_DRIVER_FILES instead of VK_ICD_FILENAMES
VK_ICD_FILENAMES is deprecated, and the ICD selection
can be overridden by the user incorrectly if the new
parameter is set.

Bug: 370523649
Test: rebuild&run, CI
Change-Id: I8182fb0e588781c99514670351ed25cb2662930b
2025-01-09 06:57:21 -08:00
Jason Macnak f3819240f2 Remove nested loader option from VulkanDispatch
... as this is no longer used after kumquat.

Bug: n/a
Test: n/a
Change-Id: I66f4a52b84935933037347b4ec39a0739c0b1133
2024-11-12 11:32:48 -08:00
Serdar Kocdemir 79a5203c74 Use VK_EXT_external_memory_metal on MoltenVK mode
Use the new external memory extension for the management of
external images and buffers. Previous extension and usage was
depending on some workarounds on managing metal objects which
was causing issues with the usage of VVL.

Requires a new version of MoltenVK prebuilts/binaries.

Bug: 349066492
Bug: 368409646
Bug: 351765838
Test: -gpu host -feature GuestAngle
Change-Id: I47f0f13bde9d7e3dc95da1af3673deac649745d7
2024-10-25 12:16:13 +01:00
Serdar Kocdemir 1918fe5921 Disable metal argument buffers for MoltenVK
Avoid regression on MoltenVK by disabling the usage
of metal argument buffers.

Bug: 364055067
Test: rebuild and run with latest MoltenVK
Change-Id: I591db0ff428d6ea1a8625309bd6949077cfe60be
2024-09-03 00:06:10 +01:00
Serdar Kocdemir 33f2f6b9ac Reduce MoltenVK default logging level to errors
Test: run vulkan apps with -gpu host
Bug: 353392426
Change-Id: I4e0c91176d95d133babb9ee0e6cf88e200b6a438
2024-07-29 12:23:51 +00:00
Serdar Kocdemir 888860b174 Merge "Better logging for the loader library events" into main 2024-07-10 08:49:35 +00:00
Serdar Kocdemir c9fe49cd7c Better logging for the loader library events
Adjusting the logging messages given when the loader library cannot be
found to be more information only and use common logging functionalities.

Bug: 350022582
Test: build and run emulator
Change-Id: Ib5655a3f3f8c99bb73f9780c6c2b6e7fcee0f425
2024-07-09 16:16:15 +00:00
Serdar Kocdemir 3c42d8f3a4 Disable usage of VVL in MoltenVK path
VVL, when enabled implicitly, can cause errors due to the
current handling of external memory in the emulator. This
will be fixed after some spec or MoltenVK side changes.
It can be enabled with VK_LOADER_LAYERS_ALLOW=VK_LAYER_KHRONOS_validation

Bug: 351765838
Test: run with vkconfig using -gpu host -guest-angle on MacOS
Change-Id: I68c2c4ed9f398a00499997c7871365a6ccb5255c
2024-07-08 13:48:01 +01:00
Serdar Kocdemir fa050d101b Remove direct usages of MoltenVK library functions
These APIs and the related extension are deprecated in favor of the new
metal_objects extension to make sure the loader can intercept them, so that the layers, such as VVL, would work fine.
Removes necessity to load functions directly from a separate dylib.
VK_MVK_moltenvk extension support is still passed to the guest side
due to the existing checks for enabling the AHB extension.

Bug: 333460957
Test: run with swiftshader, host and use-host-vulkan arguments on MacOS
Change-Id: I17ce958bc6498029ad4c525e80764060f88df118
2024-06-27 10:06:59 +00:00
Serdar Kocdemir ee3dfa25d8 Configure MoltenVK library to use single queue
Enforce single queue family when using MoltenVK to satisfy
some ANGLE expectations when using -guest-angle option
and avoid crashes at the startup.

Bug: 333460957
Test: run with -guest-angle and host vulkan on Mac
Change-Id: I92075b855a0a8f10e604a87e3ebd3b4ef35d20da
2024-05-28 16:54:39 +00:00
Gurchetan Singh a4d121b666 gfxstream: random changes to support QNX
Fixed bug here.

BUG=287083974
TEST=compile

Change-Id: I1274d4b563b2b92ad96771f01d7c2d6d9a4651f2
2024-04-23 18:08:55 -07:00
Jason Macnak cb5ce07c55 Use a nested Vulkan Loader when GFXSTREAM_VK_ env var found
... and add script to build a version of the Vulkan Loader which
uses "GFXSTREAM" prefixed env vars and logging.

Bug: b/315317383
Test: deqp-vk w/ Gfxstream ICD
Change-Id: I7202379dbc27a9519b55434e889139810078020d
2023-12-11 02:38:04 +00:00
Jason Macnak 44ca278b74 Reorganize Vulkan Loader library finding
... to try to simplify the number of functions reading the same
envvars.

Bug: b/315317383
Test: cvd start --gpu_mode=gfxstream
Change-Id: I58ae665573f494c97196d75749fa66777c7b7cf5
2023-12-11 02:37:53 +00:00
Josh Simonot 541ec7969f Enable cmake build for QNX platform
Update cmake build files and add QNX implementations.
QNX build requires QNX SDP and configuring for cross-compilation.

BUG=287086290
TEST=QNX build, Linux build

Change-Id: I2639c77f2d3d630ef89f456c7603f368bc80b490
2023-08-25 14:45:57 -07:00
Jason Macnak 648a9edc06 Rename stream-servers to host
Bug: b/271464937
Test: m
Change-Id: I89553dfe2e27170e1e968e234b364f13e76b2f88
2023-05-19 15:09:46 -07:00