Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable GPU support on all provisioned Android devices #1983

Closed
zuziaka opened this issue May 31, 2021 · 1 comment · Fixed by #1991
Closed

Enable GPU support on all provisioned Android devices #1983

zuziaka opened this issue May 31, 2021 · 1 comment · Fixed by #1991

Comments

@zuziaka
Copy link
Contributor

zuziaka commented May 31, 2021

Enable GPU support on all provisioned Android devices so that the pilot companies get the best possible performance.

corellium/corellium-api@413858e

@jan-goral
Copy link
Contributor

jan-goral commented May 31, 2021

SDD

Motivation

GPU acceleration is a valuable improvement if can speed up overall execution on virtual devices.

Goal

Providing control over enabling/disabling GPU acceleration.

Non-Goal

Converting the existing devices without into devices with GPU acceleration

API

  • cli - flank.corellium.cli.RunTestCorelliumAndroidCommand.Config.gpuAcceleration: Boolean (gpu-acceleration) (default: false)
  • domain - flank.corellium.domain.RunTestCorelliumAndroid.Args.gpuAcceleration: Boolean
  • api - flank.corellium.api.AndroidInstance.Config.gpuAcceleration: Boolean

Design

The flank is currently able to create or reuse the required amount of devices just before the test execution.
According to that, there is a simple way to implement partial support for this feature without extending or changing the current logic of device management. But solution design for the full support will require some additional investigation that will be explained later.

Partial support

The partial support will work correctly for the case where the virtual devices weren't created previously.

Implementation can be described in the following steps:

  1. Add property to domain Args.
  2. Add option to cli command Config.
  3. Update Config -> Args mapper.
  4. Add option to AndroidInstance.Config
  5. Pass added option in flank.corellium.domain.run.test.android.step.invokeDevices
  6. Pass option to Instance.BootOptions in flank.corellium.adapter.invokeAndroidDevices

The drawback is the partial support doesn't update already created virtual devices for gpu-acceleration so it's required to remove devices manually before the running execution or run execution on a fresh project without created devices.

Full support

Before implementing full support could be necessary to make a decision what is the best way for managing the virtual devices for testing in the project scope which isn't a trivial problem. Specifying real use-cases and collecting requirements from the end-users will be extremely helpful. Explaining a complete solution for the full support is not in the scope of this document and should be treated as separated issue.

blocked by #1984

@mergify mergify bot closed this as completed in #1991 Jun 1, 2021
mergify bot pushed a commit that referenced this issue Jun 1, 2021
Fixes #1983 

## Test Plan
> How do we know the code works?

1. Remove previously created virtual devices in Corellium project.
2. Run `flank corellium test android run -c="./flank_corellium.yml"`
3. Check the newly created devices have enabled GPU acceleration
    * Debug `RunTestAndroidCorelliumExample` and check `flank.corellium.adapter.getCreatedInstances` are returning instances with properly configured `BootOptions`|
    * Or find another way for checking if GPU acceleration is enabled.

## Checklist

- [x] Documented
- [x] Unit tested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants