D3D12CreateDevice fails

Started by
13 comments, last by Shnoutz 7 years, 4 months ago

Hi,

I just updated to the new sdk 10.0.14393.33 and if I activate the D3D12 Debug layer D3D12CreateDevice simply fails.


// Enable the D3D12 debug layer
ComPtr< ID3D12Debug > debugController;
if(SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debugController))))
{
	debugController->EnableDebugLayer();
	//ComPtr< ID3D12Debug1 > debugController1;
	//if(FAILED(debugController->QueryInterface(IID_PPV_ARGS(&debugController1))))
	//	throw "Failed to retrieve debug controller";
	//debugController1->SetEnableGPUBasedValidation(true);
}

// Get adapter
ComPtr< IDXGIAdapter1 > dxgiAdapter;
if(FAILED(dxgiFactory->EnumAdapters1(0, &dxgiAdapter)))
	throw "Failed to retrieve default adapter";
if(FAILED(dxgiAdapter.As(&m_adapter)))
	throw "Failed to retrieve adapter";

// Create DirectX12 device
if(FAILED(D3D12CreateDevice(m_adapter.Get(), D3D_FEATURE_LEVEL_12_1, IID_PPV_ARGS(&m_device))))
	if(FAILED(D3D12CreateDevice(m_adapter.Get(), D3D_FEATURE_LEVEL_12_0, IID_PPV_ARGS(&m_device))))
		if(FAILED(D3D12CreateDevice(m_adapter.Get(), D3D_FEATURE_LEVEL_11_1, IID_PPV_ARGS(&m_device))))
			if(FAILED(D3D12CreateDevice(m_adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device))))
				throw "Failed to create DirectX12 device";

That used to work with 10.0.10586.0 ...

Advertisement

Is the "Graphics Tools" optional feature currently installed? This component is needed to enable the debug layer. The feature will sometimes get removed during an automatic update, and you have to re-install it to get the functionality back. You can check if it's currently installed by going into the "Manage Optional Features" dialog.

It's also possible you've got mismatched binaries, between D3D12SDKLayers.dll and D3D12.dll. There was an update (http://forums.directxtech.com/index.php?topic=5775.0) that required changes to the runtime and the debug layer.

In my case it was a missing windows update.

Now, GPU based validation works like a charm on my desktop with an AMD rx480 but crashes on my notebook with a GTX980m.

(The cash happens when I try to create a descriptor heap).

Just a quick question, is it possible that by updating windows it changes the supported level of features and resource binding tiers supported by a given gpu?

I have a gtx980m and since last windows update it reports feature level 11.1 and resource binding tier 1. I am sure this was at least feature level 12 and resource binding tier 2.

My app is not working anymore on my laptop :(

Are you sure you're running on the GTX980m and not an Intel part in your laptop?

Good point. Ill check when I get off work, It tends to revert back to the intel gpu after a driver update.

If you want to ensure that you're running on the dedicated GPU, then you should enumerate the adapters yourself and choose the one you want.

Yeah, I have been lazy and using the first adapter, I will take some time and enumerate the adapters...

Back to GPU validation, I get this message on my laptop and I am not sure what it means:

(at the "Present" call)

IGIESW ***.exe found in whitelist: NOIGIWHW Game ***.exe found in whitelist: NOD3D12 ERROR: GPU-BASED VALIDATION: Present, Back Buffer state invalid, Incompatible resource state: Resource: 0x0000025FF8FD0A50:'swapchain buffer', Subresource Index: [0], Resource State: D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0), Required State Bits: D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0), Draw Count [0], Dispatch Count [0], Command List: <deleted>, Resources used in COPY command lists must start out in the D3D12_RESOURCE_STATE_COMMON state. This includes Resources created in a COPY_SOURCE or COPY_DEST state. [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]

If I understand correctly, 'swapchain buffer' is in the state "D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0)" but should be in the "state "D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0)" o.O ??

Without seeing code it sounds like a Resource Hazard occurred somewhere.Be sure that your states are being recorded by the commandList according to how the corresponding Resources are being used.

This topic is closed to new replies.

Advertisement