Skip to content

Gather and transmit gpu_mode_used - #3283

Draft
cjreynol wants to merge 14 commits into
google:mainfrom
cjreynol:calculated_gpu_mode_gathering
Draft

cjreynol wants to merge 14 commits into
google:mainfrom
cjreynol:calculated_gpu_mode_gathering

Conversation

@cjreynol

@cjreynol cjreynol commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Bug: 481846356

The passed in (or default) flag value was assigned instead of the
calculated one.

This vector of values was only used for `CheckSnapshotCompatibility`.

Bug: 481846356
The goal is to separate the `GpuMode` calculating logic from the
`CuttlefishConfig::MutableInstanceSpecific` mutation/setting logic.  We
need to be able to re-use the calculation logic for metrics without
making any modifications.

The plan is to pick apart the mixed logic to separate everything, then
put all of the determination logic back together.

Bug: 481846356
Piecemeal stripping out logic from the monolithic function with mutation.

Bug: 481846356
So both `#ifdef __APPLE__` and `#ifndef` have the same interface.  This
will make it easier to use for metrics.

Bug: 481846356
To avoid the extra calls and conditionals in the logic for setting
config values.

Bug: 481846356
The entire anonymous namespace belonged in the same block.  The
[[maybe_unused]] notation is not necessary with this condensing.

The only remaining `#ifdef __APPLE__` code should be the alternative
versions of `GetGraphicsAvailability` and `SelectGpuMode`.

Bug: 481846356
The calculated, used GPU mode will be added next.

Bug: 481846356
@cjreynol cjreynol self-assigned this Oct 1, 2026
CF_EXPECT(GpuModeFlag::FromGlobalGflags());
std::vector<GpuMode> gpu_mode_used;
gpu_mode_used.reserve(gpu_mode_requested.Size());
// TODO CJR: finish after rebasing with GuestConfigs and VmManagerFlag

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Waiting on #3248

const std::string& guest_renderer_preload_arg, VmmMode vmm,
const GuestConfig& guest_config,
CuttlefishConfig::MutableInstanceSpecific& instance);
Result<GpuMode> SelectGpuMode(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Waiting on #3264 for this function to become available

This branch has not been deployed

No deployments
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.

1 participant