aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-21 02:39:02 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-21 02:39:02 +0000
commitcd4dee124425158590a1ab4b99d614bd8801b7f3 (patch)
treee6ea91b422f3d076dbb678f16c1c16c8e76e0c10
parent24d5868a615cd52523fea8638fc42571b75e3a90 (diff)
parent9a40f288924f42150d2c6306ef845e09233abe7a (diff)
downloadacloud-cd4dee124425158590a1ab4b99d614bd8801b7f3.tar.gz
Merge "Update gpu args if instances created with any module of gpu." am: 9a40f28892
Change-Id: I376f5152d86411441f4046ee856feed84a3ed220
-rw-r--r--internal/lib/cvd_compute_client_multi_stage.py4
-rw-r--r--internal/lib/cvd_compute_client_multi_stage_test.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/lib/cvd_compute_client_multi_stage.py b/internal/lib/cvd_compute_client_multi_stage.py
index e833ad9b..2c31b25c 100644
--- a/internal/lib/cvd_compute_client_multi_stage.py
+++ b/internal/lib/cvd_compute_client_multi_stage.py
@@ -55,6 +55,7 @@ from acloud.pull import pull
logger = logging.getLogger(__name__)
_DECOMPRESS_KERNEL_ARG = "-decompress_kernel=true"
+_GPU_ARG = "-gpu_mode=drm_virgl"
_DEFAULT_BRANCH = "aosp-master"
_FETCHER_BUILD_TARGET = "aosp_cf_x86_phone-userdebug"
_FETCHER_NAME = "fetch_cvd"
@@ -290,6 +291,9 @@ class CvdComputeClient(android_compute_client.AndroidComputeClient):
if decompress_kernel:
launch_cvd_args.append(_DECOMPRESS_KERNEL_ARG)
+ if self._gpu:
+ launch_cvd_args.append(_GPU_ARG)
+
return launch_cvd_args
@staticmethod
diff --git a/internal/lib/cvd_compute_client_multi_stage_test.py b/internal/lib/cvd_compute_client_multi_stage_test.py
index b83bafb5..98ce7e43 100644
--- a/internal/lib/cvd_compute_client_multi_stage_test.py
+++ b/internal/lib/cvd_compute_client_multi_stage_test.py
@@ -109,13 +109,14 @@ class CvdComputeClientTest(driver_test_lib.BaseDriverTest):
# test GetLaunchCvdArgs with avd_spec
fake_avd_spec = avd_spec.AVDSpec(self.args)
expeted_args = ['-x_res=1080', '-y_res=1920', '-dpi=240', '-cpus=2',
- '-memory_mb=4096', '--setupwizard_mode=REQUIRED']
+ '-memory_mb=4096', '--setupwizard_mode=REQUIRED',
+ '-gpu_mode=drm_virgl']
launch_cvd_args = self.cvd_compute_client_multi_stage._GetLaunchCvdArgs(fake_avd_spec)
self.assertEqual(launch_cvd_args, expeted_args)
# test GetLaunchCvdArgs without avd_spec
expeted_args = ['-x_res=720', '-y_res=1280', '-dpi=160',
- '--setupwizard_mode=REQUIRED']
+ '--setupwizard_mode=REQUIRED', '-gpu_mode=drm_virgl']
launch_cvd_args = self.cvd_compute_client_multi_stage._GetLaunchCvdArgs(
avd_spec=None)
self.assertEqual(launch_cvd_args, expeted_args)