Last updated: 2026-06-12

Hardware Detection

GPU Detect

All API Sections

Inspect the selected Vulkan device and derive architecture-specific tuning defaults.

The heuristics here convert raw Vulkan device properties into the settings used by DMMV, matmul, and attention dispatch code.

3 exports 2 methods src/vulkan/gpu_detect.zig

3 exports shown

enum

GpuVendor

#
pub const GpuVendor = enum

GPU vendor and architecture buckets used by ZINC's tuning heuristics.

src/vulkan/gpu_detect.zig:12

struct

GpuConfig

#
pub const GpuConfig = struct

Auto-detected GPU capabilities and derived tuning parameters.

src/vulkan/gpu_detect.zig:31

Methods

2

method

GpuConfig.nameSlice

#
pub fn nameSlice(self: *const GpuConfig) []const u8

Return the device name as a byte slice covering only the populated prefix.

Returns

A slice of `device_name[0..device_name_len]`; no null terminator or padding included.

src/vulkan/gpu_detect.zig:71

method

GpuConfig.log_info

#
pub fn log_info(self: *const GpuConfig) void

Log the detected GPU name, vendor, memory, wave size, cooperative-matrix support, and all derived tuning parameters at info level.

src/vulkan/gpu_detect.zig:76

function

detect

#
pub fn detect(instance: *const Instance) GpuConfig

Inspect Vulkan device properties and derive runtime tuning defaults.

Parameters

instance
Active Vulkan instance whose selected physical device should be classified.

Returns

A GpuConfig populated from Vulkan limits plus ZINC-specific vendor heuristics.

Notes

The classification is heuristic and intentionally biased toward sensible defaults rather than exact SKU detection.

src/vulkan/gpu_detect.zig:96