simvx.graphics.gpu.device

Physical/logical device selection and queue management.

Module Contents

Classes

Functions

select_physical_device

Pick a suitable VkPhysicalDevice. Returns (physical_device, queue_families).

create_logical_device

Create a VkDevice. Returns (device, graphics_queue, present_queue, compute_queue, transfer_queue).

Data

API

simvx.graphics.gpu.device.__all__

[‘select_physical_device’, ‘create_logical_device’, ‘QueueFamilies’]

simvx.graphics.gpu.device.log

‘getLogger(…)’

class simvx.graphics.gpu.device.QueueFamilies[source]
graphics: int

None

present: int

None

simvx.graphics.gpu.device.select_physical_device(instance: Any, surface: Any) tuple[Any, simvx.graphics.gpu.device.QueueFamilies][source]

Pick a suitable VkPhysicalDevice. Returns (physical_device, queue_families).

simvx.graphics.gpu.device.create_logical_device(physical_device: Any, queue_families: simvx.graphics.gpu.device.QueueFamilies, *, compute_qf: int | None = None, transfer_qf: int | None = None, external_memory_fd: bool = False) tuple[Any, Any, Any, Any, Any][source]

Create a VkDevice. Returns (device, graphics_queue, present_queue, compute_queue, transfer_queue).

compute_qf / transfer_qf are the dedicated queue families probed by

Func:

probe_dedicated_queue_families (RenderCapabilities.dedicated_*_qf). When supplied (the async-compute / dedicated-DMA path on multi-queue GPUs), a queue is created on each and its handle returned; otherwise the corresponding return is None. A family that coincides with graphics or present is ignored (it is already covered by the universal queue), so on a single-universal-family box (compute_qf=transfer_qf=None) the queue set is exactly graphics+present as before: byte-identical device creation.

external_memory_fd adds VK_KHR_external_memory_fd (and the VK_KHR_external_memory dependency) to the enabled device extensions. It is requested only by the D8 multi-GPU path so the dma-buf zero-copy cross-device transfer can later export/import image memory as an fd; the staging-copy floor needs nothing extra. Default False keeps single-GPU device creation byte-identical. The extension must be enabled here (not merely probed) for

Class:

~simvx.graphics.gpu.multi_device.TransferMethod.DMABUF selection to be valid; until both devices enable it the staging-copy floor is chosen.