Jump to content
  • Advertisement
Sign in to follow this  
Shnoutz

D3D12CreateDevice fails

This topic is 759 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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). 

Share this post


Link to post
Share on other sites

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 :(

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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 ??

Share this post


Link to post
Share on other sites

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.

Edited by markypooch

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!