Hi. We have issues when rendering overlay in D3D12 game (XSplit GameCaster + Rise of the tomb raider in DX12 mode). Win10 OS, latest OS build, latest drivers 376.33.
Desktop + GTX 950 - no issues
Laptop + GTX 870M - no issues
Laptop + GTX 970M - game crashes or freezes after 1-2 minutes
Desktop + 1060 - issue happens
Desktop + GTX 970 - issue happens (when SLI enabled and when disabled)
Simple test that runs before actual Present:
D3D12_COMMAND_QUEUE_DESC cq_desc = pDevice12_CQ->GetDesc();
// Create a command allocator
CComPtr<ID3D12CommandAllocator> pCommandAlloc;
if (SUCCEEDED(hr))
hr = pDevice->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, __uuidof(ID3D12CommandAllocator), (void **) &pCommandAlloc);
// Spin up a new command list
CComPtr<ID3D12GraphicsCommandList> pCommandList;
if (SUCCEEDED(hr))
hr = pDevice->CreateCommandList(cq_desc.NodeMask, D3D12_COMMAND_LIST_TYPE_DIRECT, pCommandAlloc, pPipelineState, __uuidof(ID3D12GraphicsCommandList), (void **) &pCommandList);
// Create a fence
CComPtr<ID3D12Fence> pFence;
if (SUCCEEDED(hr))
hr = pDevice->CreateFence(0, D3D12_FENCE_FLAG_NONE, __uuidof(ID3D12Fence), (void **) &pFence);
CComPtr<ID3D12DescriptorHeap> pSRV;
if (SUCCEEDED(hr)) {
// Describe and create a shader resource view (SRV) heap for the texture.
D3D12_DESCRIPTOR_HEAP_DESC srvHeapDesc = {};
srvHeapDesc.NumDescriptors = 1;
srvHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
srvHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
srvHeapDesc.NodeMask = cq_desc.NodeMask;
hr = pDevice->CreateDescriptorHeap(&srvHeapDesc, IID_PPV_ARGS(&pSRV));
}
if (SUCCEEDED(hr)) {
hr = pCommandList->Close();
}
if (SUCCEEDED(hr)) hr = pFence->SetPrivateDataInterface(privGuidPipelineState, pPipelineState);
if (SUCCEEDED(hr)) hr = pFence->SetPrivateDataInterface(privGuidCommandList, pCommandList);
if (SUCCEEDED(hr)) hr = pFence->SetPrivateDataInterface(privGuidSRV, pSRV);
if (SUCCEEDED(hr)) {
ID3D12CommandList* ppCommandLists[] = { pCommandList };
pDevice12_CQ->ExecuteCommandLists(_countof(ppCommandLists), ppCommandLists);
pDevice12_CQ->Signal(pFence, 1);
// queue results
pCtx->m_list_Fence.push_back(pFence.p);
}
pFence will be destroyed later (with all assigned resources) when command list execution completed.
Sometimes game freezes, sometimes I see DXGI_ERROR_DEVICE_HUNG message.
If I remove SRV from test - no issues.
If I just create and immediately destroy pSRV - also no issues.
If I add waiting for command list execution completion right after Signal call - no issues.
According with dump, freeze happens in CreateDescriptorHeap call and this thread eats CPU still.
Callstack looks following:
nvwgf2umx.dll!00007ffa60e9502d() Unknown
nvwgf2umx.dll!00007ffa60e9577f() Unknown
nvwgf2umx.dll!00007ffa61797f14() Unknown
nvwgf2umx.dll!00007ffa60e939f4() Unknown
nvwgf2umx.dll!00007ffa60ee6909() Unknown
nvwgf2umx.dll!00007ffa61654c48() Unknown
D3D12.dll!CDevice::VersionedCreateDescriptorHeap(struct D3D12DDIARG_CREATE_DESCRIPTOR_HEAP_0001 const *,struct D3D12DDI_HDESCRIPTORHEAP) Unknown
D3D12.dll!CDescriptorHeap::FinalConstruct(struct CDescriptorHeap::TConstructorArgs const &) Unknown
D3D12.dll!CLayeredObject<class CDescriptorHeap>::CreateInstance(struct CDescriptorHeap::TConstructorArgs const &,void *,void *,struct _GUID const &,void * *) Unknown
D3D12.dll!CDevice::CreateLayeredChild() Unknown
D3D12.dll!NOutermost::CDevice::CreateLayeredChild() Unknown
D3D12.dll!CDevice::CreateDescriptorHeap(struct D3D12_DESCRIPTOR_HEAP_DESC const *,struct _GUID const &,void * *) Unknown
I can provide dump of this freeze and more information.