Skip to content

Commit 045cb1c

Browse files
committed
Update crosvm handling for gpu capture
* Disable the process restarter * Enable tap devices as raw fds are not passed in anymore Internal equivalent ag/36192006 Bug: n/a Test: cvd create --gpu_mode=gfxstream_guest_angle --gpu_capture_binary=ngfx
1 parent abbc960 commit 045cb1c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

base/cvd/cuttlefish/host/libs/vm_manager/crosvm_manager.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,12 @@ Result<std::vector<MonitorCommand>> CrosvmManager::StartCommands(
544544
first_time_argument = "--restore=" + restore_path;
545545
}
546546

547-
crosvm_cmd.ApplyProcessRestarter(instance.crosvm_binary(),
548-
first_time_argument, kCrosvmVmResetExitCode);
547+
const bool gpu_capture_enabled = !instance.gpu_capture_binary().empty();
548+
if (!gpu_capture_enabled) {
549+
crosvm_cmd.ApplyProcessRestarter(
550+
instance.crosvm_binary(), first_time_argument, kCrosvmVmResetExitCode);
551+
}
552+
549553
crosvm_cmd.Cmd().AddParameter("run");
550554
crosvm_cmd.AddControlSocket(instance.CrosvmSocketPath(),
551555
instance.crosvm_binary());
@@ -616,8 +620,6 @@ Result<std::vector<MonitorCommand>> CrosvmManager::StartCommands(
616620
}
617621
}
618622

619-
const auto gpu_capture_enabled = !instance.gpu_capture_binary().empty();
620-
621623
// crosvm_cmd.Cmd().AddParameter("--null-audio");
622624
crosvm_cmd.Cmd().AddParameter("--mem=", instance.memory_mb());
623625
if (instance.mte()) {
@@ -674,10 +676,8 @@ Result<std::vector<MonitorCommand>> CrosvmManager::StartCommands(
674676
crosvm_cmd.AddVhostUser("input", instance.keyboard_socket_path());
675677
crosvm_cmd.AddVhostUser("input", instance.switches_socket_path());
676678

677-
// GPU capture can only support named files and not file descriptors due to
678-
// having to pass arguments to crosvm via a wrapper script.
679679
#ifdef __linux__
680-
if (instance.enable_tap_devices() && !gpu_capture_enabled) {
680+
if (instance.enable_tap_devices()) {
681681
// The PCI ordering of tap devices is important. Make sure any change here
682682
// is reflected in ethprime u-boot variable.
683683
// TODO(b/218364216, b/322862402): Crosvm occupies 32 PCI devices first and

0 commit comments

Comments
 (0)