Describes support in Direct3D 12 for systems that have multiple adapters installed, covering scenarios where your application explicitly targets multiple GPU adapters, and scenarios where drivers implicitly use multiple GPU adapters on behalf of your application.
A GPU adapter can be any adapter (graphics or compute, discrete or integrated), from any manufacturer, that supports Direct3D 12.
Multiple adapters are referenced as nodes. 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 diagram.
Sharing heaps across adapters
See the Shared Heaps topic.
Multi-adapter APIs, and node masks
Similar to previous Direct3D 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.
Your application can determine the number of physical adapters associated with a given device by calling ID3D12Device::GetNodeCount.
Many APIs in Direct3D 12 accept a node mask (a bit mask), which indicates the set of nodes to which the API call refers. Each node has a zero-based index. But in the node mask, zero translates to bit 1; 1 translates to bit 2; and so on.
When calling the following (single node) APIs, your application specifies a single node with which the API call will be associated. Most of the time, this is specified by a node mask. Each bit in the mask corresponds to a single node. For all of the APIs described in this section, you must set exactly one bit in the node mask.
- 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 (multiple node) APIs, your application specifies a set of nodes with which the API call will be associated. You specify node affinity as a node mask, potentially with multiple bits set. If your application passes 0 for this bit mask, then the Direct3D 12 driver converts that 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 a 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 your application to specify anything for this.
When calling the following ID3D12Device APIs, your application doesn't 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.