Skip to content

Add support for Guest Lavapipe GPU mode#2873

Open
jmacnak wants to merge 1 commit into
google:mainfrom
jmacnak:guest-lavapipe-mode
Open

Add support for Guest Lavapipe GPU mode#2873
jmacnak wants to merge 1 commit into
google:mainfrom
jmacnak:guest-lavapipe-mode

Conversation

@jmacnak

@jmacnak jmacnak commented Jul 20, 2026

Copy link
Copy Markdown
Member

Based on @valentineburley arsp/4898478.

This introduces a couple of new guest config values to determine if
various vulkan apexes are supported in order to work around the fact
that Cuttlefish at HEAD currently has both gfxstream and swiftshader
in a single apex (aosp/2818460). After this change is released, the
lavapipe vulkan apex can be introduced and the pre-existing gfxstream
plus swiftshader apex can be split.

Bug: b/530070181
Bug: b/536966381

Test: bazel run //cuttlefish/package:cvd -- create \
      (on main with pre-existing vulkan apex)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=guest_swiftshader
      (on main with pre-existing vulkan apex)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=gfxstream_guest_angle
      (on main with pre-existing vulkan apex)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=gfxstream_guest_angle
      (on main with separated vulkan apexes from ag/41081278)

Test: bazel run //cuttlefish/package:cvd -- create \
      (on main with separated vulkan apexes from ag/41081278)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=guest_lavapipe
      (on main with separated vulkan apexes from ag/41081278)

Test: bazel run //cuttlefish/package:cvd -- create \
      --config_file=spec.json
       (where spec.json specifies older udc image)

@jmacnak
jmacnak force-pushed the guest-lavapipe-mode branch 6 times, most recently from 94cf17c to 3aa837c Compare July 21, 2026 15:42
@jmacnak
jmacnak requested a review from Databean July 21, 2026 19:19
Comment on lines +328 to +346
const GpuMode gpu_mode = instance.gpu_mode();
if (gpu_mode != GpuMode::None) {
if (IsGfxstreamMode(gpu_mode)) {
if (instance.has_vulkan_gfxstream_apex()) {
bootconfig_args["androidboot.vendor.apex.com.google.cf.vulkan"] =
"com.google.cf.vulkan.gfxstream";
}
} else if (gpu_mode == GpuMode::GuestLavapipe) {
if (instance.has_vulkan_lavapipe_apex()) {
bootconfig_args["androidboot.vendor.apex.com.google.cf.vulkan"] =
"com.google.cf.vulkan.lavapipe";
}
} else if (gpu_mode == GpuMode::GuestSwiftshader) {
if (instance.has_vulkan_swiftshader_apex()) {
bootconfig_args["androidboot.vendor.apex.com.google.cf.vulkan"] =
"com.google.cf.vulkan.swiftshader";
}
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be some default value for this in bootconfig if guest_config doesn't set anything? Or is every build that needs this config set guaranteed to have the guest config member defined?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, there is a single apex that has both the gfxstream and swiftshader vulkan drivers. IIUC, you do not need to specify the bootconfig arg when there is only a single option (as we are not currently setting a value AFAICT). The assumption is that if the guest config does not report having the specific apex, you are using an older build which is either pre-aosp/2818460 and does not have a vulkan apex or has only the apex from aosp/2818460. After this PR is released and available, we can submit ag/41081278 to break apart the existing one and add the lavapipe apex.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was my experience as well. As long as there's only a single vulkan apex, it gets picked automatically. The bootconfig only becomes necessary once a second option is introduced.

Comment thread base/cvd/cuttlefish/host/libs/vm_manager/gem5_manager.cpp Outdated
Based on valentine.burley@collabora's arsp/4898478.

This introduces a couple of new guest config values to determine if
various vulkan apexes are supported in order to work around the fact
that Cuttlefish at HEAD currently has both gfxstream and swiftshader
in a single apex (aosp/2818460). After this change is released, the
lavapipe vulkan apex can be introduced and the pre-existing gfxstream
plus swiftshader apex can be split.

Bug: b/530070181
Bug: b/536966381

Test: bazel run //cuttlefish/package:cvd -- create \
      (on main with pre-existing vulkan apex)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=guest_swiftshader
      (on main with pre-existing vulkan apex)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=gfxstream_guest_angle
      (on main with pre-existing vulkan apex)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=gfxstream_guest_angle
      (on main with separated vulkan apexes from ag/41081278)

Test: bazel run //cuttlefish/package:cvd -- create \
      (on main with separated vulkan apexes from ag/41081278)

Test: bazel run //cuttlefish/package:cvd -- create \
      --gpu_mode=guest_lavapipe
      (on main with separated vulkan apexes from ag/41081278)

Test: bazel run //cuttlefish/package:cvd -- create \
      --config_file=spec.json
       (where spec.json specifies older udc image)
@jmacnak
jmacnak force-pushed the guest-lavapipe-mode branch from 3aa837c to 30ae964 Compare July 21, 2026 21:45
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

Successfully merging this pull request may close these issues.

3 participants