Describes support in D3D12 for multi-engine adapter systems, covering scenarios where applications explicitly target multiple GPU adapters, and scenarios where drivers implicitly use multiple GPU adapters on behalf of an application.
- Multi-adapter Overview
- Sharing heaps across adapters
- Multi-adapter APIs
- Related topics
A GPU adapter can be any graphics adapter (including an on-board adapter), from any manufacturer, that supports D3D12.
Multiple adapters are referenced as nodes. in the API. These nodes are indexed from zero, but in the bit masks used to refer to the nodes, zero translates to bit 1, 1 to bit 2, and so on. A number of elements, such as the queues, apply to each node, so if there are two nodes, there will be two default 3D queues. Other elements, such as the pipeline state and root and command signatures, can refer to one or more or all of the nodes, as shown in the following diagram.
Sharing heaps across adapters
Refer to the Shared Heaps section.
Similar to previous D3D APIs, each set of linked adapters is enumerated as a single IDXGIAdapter3 object. All outputs attached to any adapter in the link are enumerated as attached to the single IDXGIAdapter3 object.
Applications can determine the number of physical adapters associated with a given device with a call to ID3D12Device::GetNodeCount. Many APIs in D3D12 accept a NodeMask, which indicates the set of nodes which the API call refers to.
When calling the following (single node) APIs, applications specify a single node that the API call will be associated with. Most of the time this is specified by a NodeMask. Each bit in the mask corresponds to a single node. For all of the APIs described in this section, exactly 1 bit must be set in the NodeMask.
- D3D12_COMMAND_QUEUE_DESC : has a NodeMask member.
- CreateCommandQueue : creates a queue from a D3D12_COMMAND_QUEUE_DESC structure.
- CreateCommandList : takes a nodeMask parameter.
- D3D12_DESCRIPTOR_HEAP_DESC : has a NodeMask member.
- CreateDescriptorHeap : creates a descriptor heap from a D3D12_DESCRIPTOR_HEAP_DESC structure.
- D3D12_QUERY_HEAP_DESC : has a NodeMask member.
- CreateQueryHeap : creates a query heap from a D3D12_QUERY_HEAP_DESC structure.
When calling the following APIs, applications specify a set of nodes that the API call will be associated with. Node affinity is specified as a bit mask. If the application passes 0 for the bit mask, then the D3D12 driver converts this to the bit mask 1 (indicating that the object is associated with node 0).
- D3D12_CROSS_NODE_SHARING_TIER : determines the support for cross node sharing.
- D3D12_FEATURE_DATA_D3D12_OPTIONS : structure referencing D3D12_CROSS_NODE_SHARING_TIER.
- D3D12_FEATURE_DATA_ARCHITECTURE : contains a NodeIndex member.
- D3D12_GRAPHICS_PIPELINE_STATE_DESC : has a NodeMask member.
- CreateGraphicsPipelineState : creates a graphics pipeline state object from a D3D12_GRAPHICS_PIPELINE_STATE_DESC structure.
- D3D12_COMPUTE_PIPELINE_STATE_DESC : has a NodeMask member.
- CreateComputePipelineState : creates a compute pipeline state object from a D3D12_COMPUTE_PIPELINE_STATE_DESC structure.
- CreateRootSignature: takes a nodeMask parameter.
- D3D12_COMMAND_SIGNATURE_DESC: has a NodeMask member.
- CreateCommandSignature : creates a command signature object from a D3D12_COMMAND_SIGNATURE_DESC structure.
Resource creation APIs
The following APIs reference node masks:
- D3D12_HEAP_PROPERTIES : has both CreationNodeMask and VisibleNodeMask members.
- GetResourceAllocationInfo : has a visibleMask parameter.
- GetCustomHeapProperties : has a nodeMask parameter.
When creating reserved resource no node index or mask is specified. The reserved resource can be mapped onto a heap on any node (following the cross-node sharing rules).
The method MakeResident works internally with adapter queues, there is no need for the application to specify anything for this.
When calling the following ID3D12Device APIs, applications do not need to specify a set of nodes that the API call will be associated with because the API call applies to all nodes:
- OpenSharedHandle : with a fence as a parameter. With a resource or a heap as parameters this method does not accept nodes as parameters because node masks are inherited from previously created objects.