microsoft / microsoft/DirectX-Graphics-Samples

Hello world crashes when creating swap chain. Access violation

Open
#847 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question sdklayers
Dominant language
C++
Stars
6.8k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

I can't get these samples to run on my new laptop. I get a crash here at the call to CreateSwapChain: https://github.com/microsoft/DirectX-Graphics-Samples/blob/b5f92e2251ee83db4d4c795b3cba5d470c52eaf8/Samples/Desktop/D3D12HelloWorld/src/HelloTriangle/D3D12HelloTriangle.cpp#L94

The error message doesn't help me:

Exception thrown at 0x00007FFAEA06B3A7 (d3d12SDKLayers.dll) in D3D12HelloTriangle.exe: 0xC0000005: 
Access violation reading location 0x0000000000000000.

Any idea what that is? Or how I might debug it? I had sample code running on a Microsoft Surface, but when I tried this Asus Zenbook, this happens.

The stack trace in Visual Studio...

 	d3d12SDKLayers.dll!00007ffaea06b3a7()	Unknown
 	d3d12SDKLayers.dll!00007ffaea0636b0()	Unknown
 	d3d12SDKLayers.dll!00007ffaea05893a()	Unknown
 	d3d12SDKLayers.dll!00007ffaea058dc1()	Unknown
 	d3d12SDKLayers.dll!00007ffaea045965()	Unknown
 	dxgi.dll!00007ffb97d42f71()	Unknown
 	dxgi.dll!00007ffb97cf74a1()	Unknown
 	dxgi.dll!00007ffb97cc6d4f()	Unknown
 	dxgi.dll!00007ffb97cc45f7()	Unknown
 	dxgi.dll!00007ffb97cc4159()	Unknown
 	dxgi.dll!00007ffb97cc3ffd()	Unknown
 	dxgi.dll!00007ffb97cc3f11()	Unknown
 	dxgi.dll!00007ffb97cc4c41()	Unknown
 	dxgi.dll!00007ffb97d28f6c()	Unknown
 	dxgi.dll!00007ffb97d28cec()	Unknown
>	D3D12HelloTriangle.exe!D3D12HelloTriangle::LoadPipeline() Line 94	C++
 	D3D12HelloTriangle.exe!D3D12HelloTriangle::OnInit() Line 27	C++
 	D3D12HelloTriangle.exe!Win32Application::Run(DXSample * pSample, HINSTANCE__ * hInstance, int nCmdShow) Line 55	C++

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash in Samples/Desktop/D3D12HelloWorld/src/HelloTriangle/D3D12HelloTriangle.cpp at line 94, using the Visual Studio stack trace and the provided machine difference as context. Compare the sample's behavior on the two laptops and inspect the CreateSwapChain call. Done means identifying a reproducible cause and documenting a confirmed fix or diagnostic explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.