Skip to content

fix: default GPUs setting #2029

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

Merged
merged 1 commit into from
Feb 27, 2025
Merged

fix: default GPUs setting #2029

merged 1 commit into from
Feb 27, 2025

Conversation

vansangpfiev
Copy link
Contributor

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 the GPU 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 new gpu_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:

  • Modified 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 the gpu_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 the gpu_type field to GpuType::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

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@vansangpfiev vansangpfiev self-assigned this Feb 25, 2025
@vansangpfiev vansangpfiev force-pushed the s/fix/gpu-default-setting branch from 87b7c07 to c2f8393 Compare February 25, 2025 05:46
@vansangpfiev vansangpfiev marked this pull request as ready for review February 25, 2025 05:52
@vansangpfiev vansangpfiev merged commit 510ae28 into dev Feb 27, 2025
16 checks passed
@vansangpfiev vansangpfiev deleted the s/fix/gpu-default-setting branch February 27, 2025 01:59
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.

2 participants