Sign in to follow this  

D3D12CreateDevice fails

This topic is 388 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

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

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

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.

 

:wacko: I am kinda sure the code for the swap chain is fine. It works on amd & warp without any validation error/warning. It's also very straightforward. I was assuming GPU validation would not completely crash the application if there was something wrong. The message I get before the crash seems wrong, it basically complains that a resource is not in the right state but ask for the resource to be in that exact state (present 0x0). Disabling GPU validation works, the app is behaving exactly as expected. I am not excluding the possibility I messed up, but I gpu validation is a relatively new feature and I have the feeling my experience with it was worth reporting.

Share this post


Link to post
Share on other sites

Looks like you are hitting a suspected bug in GPU-Based Validation that we are having a difficult time reproducing here at MS.  At least one other customer has reported a similar error.  Sounds like you are getting this error and also getting a crash.  Any chance you can share a crash dump?

Share this post


Link to post
Share on other sites

We are working on a theory.  Any chance you are explicitly transitioning the back buffer to the COMMON state in a Copy command list using a ResourceBarrier?  We have found a possible bug (working on a repro) that could produce the error you are seeing.

Share this post


Link to post
Share on other sites

Ok, new theory.  We think this has to do with using GBV on hybrid systems and we think we know how to fix it.  Thanks for reporting this.


I should add that we don't think this is an application error.  You can also ignore my previous question about transitioning the back buffer in Copy command queue. Looks like that would not cause this problem.

Share this post


Link to post
Share on other sites

This topic is 388 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this