From 64c104fa870a280e593640808558936ddd514f1a Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Tue, 4 Aug 2026 08:57:55 -0700 Subject: [PATCH] Enable vhost user gpu by default Internal equivalent in ag/41359982 Bug: b/433561707 Test: bazel run //cuttlefish/package:cvd -- create Test: bazel run //cuttlefish/package:cvd -- create \ --gpu_mode=guest_swiftshader --- .../commands/assemble_cvd/graphics_flags.cc | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc b/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc index fcef013afe8..1ad90e4267b 100644 --- a/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc +++ b/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc @@ -624,38 +624,20 @@ Result SelectGpuMode( return selected_gpu_mode; } -Result SelectGpuVhostUserMode(const GpuMode gpu_mode, - const std::string& gpu_vhost_user_mode_arg, +Result SelectGpuVhostUserMode(const std::string& gpu_vhost_user_mode_arg, VmmMode vmm) { CF_EXPECT(gpu_vhost_user_mode_arg == kGpuVhostUserModeAuto || gpu_vhost_user_mode_arg == kGpuVhostUserModeOn || gpu_vhost_user_mode_arg == kGpuVhostUserModeOff); if (gpu_vhost_user_mode_arg == kGpuVhostUserModeAuto) { - if (IsGuestRenderingMode(gpu_mode)) { - VLOG(0) << "GPU vhost user auto mode: not needed for --gpu_mode=" - << GpuModeString(gpu_mode) << ". Not enabling vhost user gpu."; - return false; - } - if (!VmManagerIsCrosvm(vmm)) { VLOG(0) << "GPU vhost user auto mode: not yet supported with " << vmm << ". Not enabling vhost user gpu."; return false; } - // Android built ARM host tools seem to be incompatible with host GPU - // libraries. Enable vhost user gpu which will run the virtio GPU device - // in a separate process with a VMM prebuilt. See b/200592498. - const auto host_arch = HostArch(); - if (host_arch == Arch::Arm64) { - VLOG(0) << "GPU vhost user auto mode: detected arm64 host. Enabling " - "vhost user gpu."; - return true; - } - - VLOG(0) << "GPU vhost user auto mode: not needed. Not enabling vhost " - "user gpu."; - return false; + VLOG(0) << "GPU vhost user auto mode: enabling vhost user gpu."; + return true; } return gpu_vhost_user_mode_arg == kGpuVhostUserModeOn; @@ -939,7 +921,7 @@ Result ConfigureGpuSettings( const GpuMode gpu_mode = CF_EXPECT( SelectGpuMode(gpu_mode_arg, vmm, guest_config, graphics_availability)); const bool enable_gpu_vhost_user = - CF_EXPECT(SelectGpuVhostUserMode(gpu_mode, gpu_vhost_user_mode_arg, vmm)); + CF_EXPECT(SelectGpuVhostUserMode(gpu_vhost_user_mode_arg, vmm)); if (gpu_mode == GpuMode::Custom) { std::vector requested_types =