fixing phi physical device
Test / build_and_test (push) Failing after 20s
Build / build (push) Failing after 22s

This commit is contained in:
2026-07-01 16:08:11 +02:00
parent 5621c62e3d
commit 75637b7177
2 changed files with 54 additions and 19 deletions
+5
View File
@@ -4,6 +4,7 @@ const base = @import("base");
const soft = @import("soft"); const soft = @import("soft");
const flint = @import("flint"); const flint = @import("flint");
const phi = @import("phi");
const Dispatchable = base.Dispatchable; const Dispatchable = base.Dispatchable;
const VkError = base.VkError; const VkError = base.VkError;
@@ -43,6 +44,10 @@ pub fn create(allocator: std.mem.Allocator, infos: *const vk.InstanceCreateInfo)
errdefer flint_instance.deinit(allocator) catch {}; errdefer flint_instance.deinit(allocator) catch {};
self.backend_instances.append(allocator, flint_instance) catch return VkError.OutOfHostMemory; self.backend_instances.append(allocator, flint_instance) catch return VkError.OutOfHostMemory;
const phi_instance = try phi.Instance.create(allocator, infos);
errdefer phi_instance.deinit(allocator) catch {};
self.backend_instances.append(allocator, phi_instance) catch return VkError.OutOfHostMemory;
return &self.interface; return &self.interface;
} }
+49 -19
View File
@@ -64,11 +64,11 @@ pub fn create(allocator: std.mem.Allocator, instance: *base.Instance, mic_device
var pci = pci_value; var pci = pci_value;
defer pci.deinit(); defer pci.deinit();
interface.props.vendor_id = pci.vendorId(); interface.props.vendor_id = pci.vendorId() catch 0;
interface.props.device_id = pci.deviceId(); interface.props.device_id = pci.deviceId() catch 0;
for (pci_ids[0..]) |pci_info| { for (pci_ids[0..]) |pci_info| {
if (pci.id != pci.deviceId()) if (pci_info.id != pci.deviceId() catch 0)
continue; continue;
const len = @min(vk.MAX_PHYSICAL_DEVICE_NAME_SIZE, pci_info.name.len); const len = @min(vk.MAX_PHYSICAL_DEVICE_NAME_SIZE, pci_info.name.len);
@@ -195,24 +195,54 @@ pub fn create(allocator: std.mem.Allocator, instance: *base.Instance, mic_device
.non_coherent_atom_size = 256, .non_coherent_atom_size = 256,
}; };
interface.mem_props.memory_type_count = 1; {
interface.mem_props.memory_types[0] = .{ interface.mem_props.memory_type_count = 3;
.heap_index = 0,
.property_flags = .{ interface.mem_props.memory_types[0] = .{
.device_local_bit = true, .heap_index = 0,
.host_visible_bit = true, .property_flags = .{
.host_coherent_bit = true, .device_local_bit = true,
.host_cached_bit = true, },
}, };
};
interface.mem_props.memory_heap_count = 1; interface.mem_props.memory_types[1] = .{
interface.mem_props.memory_heaps[0] = .{ .heap_index = 1,
.size = std.process.totalSystemMemory() catch 0, .property_flags = .{
.flags = .{ .device_local_bit = true }, .host_visible_bit = true,
}; .host_coherent_bit = true,
},
};
interface.mem_props.memory_types[2] = .{
.heap_index = 1,
.property_flags = .{
.host_visible_bit = true,
.host_coherent_bit = true,
.host_cached_bit = true,
},
};
}
if (mic_device.memoryInfo()) |memory_value| {
var memory = memory_value;
defer memory.deinit();
interface.mem_props.memory_heap_count = 2;
interface.mem_props.memory_heaps[0] = .{
.size = memory.size() catch 0,
.flags = .{ .device_local_bit = true },
};
interface.mem_props.memory_heaps[0] = .{
.size = std.process.totalSystemMemory() catch 0,
.flags = .{},
};
} else |err| {
std.log.scoped(.MIC).err("Failed to fetch device PCI config: {s}", .{@errorName(err)});
return VkError.InitializationFailed;
}
interface.features = .{ interface.features = .{
.robust_buffer_access = .true,
.shader_float_64 = .true, .shader_float_64 = .true,
.shader_int_64 = .true, .shader_int_64 = .true,
.shader_int_16 = .true, .shader_int_16 = .true,