D3D12: IDXGISwapChain::Present crashing

Hi.

I wanted to experiment D3D12 development and decided to run some tutorials: Microsoft DirectX-Graphics-Samples, Braynzar Soft, 3dgep…Whatever sample I run, I’ve got the same crash.

All the initialization process is going well, no error, return codes ok, but as soon as the Present method is invoked on the swap chain, I’m encountering a crash with the following call stack:

[url]https://drive.google.com/open?id=10pdbqYEeRTZA5E6Jm7U5Dobpn-KE9uOg[/url]

I’m working on a notebook, a toshiba Qosmio x870 with two gpu’s: an integrated Intel HD 4000 and a dedicated NVIDIA GTX 670M ( Fermi based ). The HD 4000 is DX11 only and as far as I understand the GTX 670M is DX12 with a feature level 11_0.

I checked that the good adapter was chosen by the sample, and when the D3D12 device is asked in the sample with a 11_0 FL, it is created with no problem. Same for all the required interfaces ( swap chain, command queue…).

I tried a lot of things to solve the problem or get some info, like forcing the notebook to always use the NVIDIA gpu, disabling the debug layer, asking for a different feature level ( by the way 11_0 is the only one that allows me to create the device, any other FL will fail at device creation )…

I have the latest NVIDIA drivers ( 391.35 ), the latest Windows 10 sdk ( 10.0.17134.0 ) and I’m working under
Visual Studio 2017 Community.

Thanks to anybody who can help me find the problem…

Hello korben4leeloo

I had problem with IDXGISwapChain::Present and nvwgf2um.dll.

Maybe your crash reason is exception, you should check it via some Debugger(IDA Pro Debugger for example) and see if there is some exception and what is the exception code.

So, After deep investigation, I found one thing, nvwgf2um.dll (and maybe nvwgf2umx.dll too) is SETTING THREAD NAME and it’s Nvidia driver’s bug/problem generally! To set thread name on WIN platform, you need to raise exception with a specific code :

[url]Microsoft Docs - Developer tools, technical documentation and coding examples

maybe your executable is catching that exception …

If it’s exactly that exception code, you should disable/ignore it somehow.

P.S
You can switch to the Intel’s GPU and see is there any exception or not.