Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit a84b935

Browse files
fix: filter out Intel GPUs (#2015)
Co-authored-by: sangjanai <sang@jan.ai>
1 parent 54432ad commit a84b935

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

engine/utils/hardware/gpu/vulkan/vulkan_gpu.h

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,20 @@
2424
#endif
2525

2626
namespace cortex::hw {
27+
constexpr const uint32_t NVIDIA_VENDOR = 0x10DE;
28+
constexpr const uint32_t AMD_VENDOR = 0x1002;
29+
constexpr const uint32_t INTEL_VENDOR = 0x8086;
30+
constexpr const uint32_t ARM_VENDOR = 0x13B5;
31+
2732
inline std::string GetVendorStr(uint32_t vendor_id) {
2833
switch (vendor_id) {
29-
case 0x1002:
34+
case AMD_VENDOR:
3035
return "AMD";
31-
case 0x10DE:
36+
case NVIDIA_VENDOR:
3237
return "NVIDIA";
33-
case 0x8086:
38+
case INTEL_VENDOR:
3439
return "INTEL";
35-
case 0x13B5:
40+
case ARM_VENDOR:
3641
return "ARM";
3742
default:
3843
return std::to_string(vendor_id);
@@ -441,16 +446,19 @@ class VulkanGpu {
441446
#endif
442447
int free_vram_MiB =
443448
total_vram_MiB > used_vram_MiB ? total_vram_MiB - used_vram_MiB : 0;
444-
gpus.emplace_back(cortex::hw::GPU{
445-
.id = std::to_string(id),
446-
.device_id = device_properties.deviceID,
447-
.name = device_properties.deviceName,
448-
.version = std::to_string(device_properties.driverVersion),
449-
.add_info = cortex::hw::AmdAddInfo{},
450-
.free_vram = free_vram_MiB,
451-
.total_vram = total_vram_MiB,
452-
.uuid = uuid_to_string(device_id_properties.deviceUUID),
453-
.vendor = GetVendorStr(device_properties.vendorID)});
449+
if (device_properties.vendorID == NVIDIA_VENDOR ||
450+
device_properties.vendorID == AMD_VENDOR) {
451+
gpus.emplace_back(cortex::hw::GPU{
452+
.id = std::to_string(id),
453+
.device_id = device_properties.deviceID,
454+
.name = device_properties.deviceName,
455+
.version = std::to_string(device_properties.driverVersion),
456+
.add_info = cortex::hw::AmdAddInfo{},
457+
.free_vram = free_vram_MiB,
458+
.total_vram = total_vram_MiB,
459+
.uuid = uuid_to_string(device_id_properties.deviceUUID),
460+
.vendor = GetVendorStr(device_properties.vendorID)});
461+
}
454462
id++;
455463
}
456464

0 commit comments

Comments
 (0)