Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This pull request introduces several changes to enhance GPU handling in the codebase, including the addition of a
GpuType
enum, updates to theGPU
struct, and improvements in GPU activation logic. The most important changes are summarized below:Enhancements to GPU Handling:
Added
GpuType
enum to classify different types of GPUs (kGpuTypeOther
,kGpuTypeIntegrated
,kGpuTypeDiscrete
,kGpuTypeVirtual
,kGpuTypeCpu
,kGpuTypeMaxEnum
). ([engine/common/hardware_common.hR72-R81](https://github.com/menloresearch/cortex.cpp/pull/2029/files#diff-adc20b97e31aa35d61ede3a2523f0126b79c4f0a2008165890d01e5ba9a6f335R72-R81)
)Updated
GPU
struct to include a newgpu_type
field for storing the type of GPU. ([engine/common/hardware_common.hR93](https://github.com/menloresearch/cortex.cpp/pull/2029/files#diff-adc20b97e31aa35d61ede3a2523f0126b79c4f0a2008165890d01e5ba9a6f335R93)
)Improvements in GPU Activation Logic:
HardwareService::UpdateHardwareInfos
to deactivate integrated GPUs by default and only activate Nvidia GPUs if both AMD and Nvidia GPUs are present. ([engine/services/hardware_service.ccL326-R354](https://github.com/menloresearch/cortex.cpp/pull/2029/files#diff-6c5bdad74c539cf749ffac42cc1728ea62c51388ece867102fd2ce2e4fd1c956L326-R354)
)Vendor Constants and GPU Type Integration:
Changed vendor constants to use a consistent naming convention (
kNvidiaVendor
,kAmdVendor
,kIntelVendor
,kArmVendor
) and added corresponding string constants (kAmdStr
,kNvidiaStr
,kIntelStr
,kArmStr
). ([engine/utils/hardware/gpu/vulkan/vulkan_gpu.hL27-R46](https://github.com/menloresearch/cortex.cpp/pull/2029/files#diff-4d54c52435d403a598d3f7cf4b82bbc50ec768d7ccde9d107a552fe4faa2e385L27-R46)
)Updated
VulkanGpu
class to use the new vendor constants and set thegpu_type
field based on the device type. ([[1]](https://github.com/menloresearch/cortex.cpp/pull/2029/files#diff-4d54c52435d403a598d3f7cf4b82bbc50ec768d7ccde9d107a552fe4faa2e385L449-R455)
,[[2]](https://github.com/menloresearch/cortex.cpp/pull/2029/files#diff-4d54c52435d403a598d3f7cf4b82bbc50ec768d7ccde9d107a552fe4faa2e385L460-R466)
)Updated
GetGPUInfo
function to set thegpu_type
field toGpuType::kGpuTypeDiscrete
for all GPUs. ([engine/utils/hardware/gpu_info.hL58-R59](https://github.com/menloresearch/cortex.cpp/pull/2029/files#diff-9c36f24988079b524e8b6e58945df24ca2ce26a3f02d95fa4c43a3fa9ef64413L58-R59)
)Fixes Issues
Self Checklist