Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating the device, use the one with the most video memory. #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kuukunen
Copy link

I will also send an email too explaining it more fully.

I had problems running some of the examples, they had very obscure crashes, and it turned out to be because I have two adapters on my laptop: Intel's integrated and an Nvidia one. As a suggestion I'm now sending code that selects the adapter with the most memory. I'm not sure if this is the preferred solution, but here it is anyway.

@JoeSwindell
Copy link

Interesting...I have integrated graphics disabled in my bios so my only available adapters are my 2 970's. I wonder if anyone else with a newer processor with integrated graphics has run into this as well!

@kuukunen
Copy link
Author

Also btw, the error I got was just a weird access violation ""Exception thrown at 0x00007FFA866DF14C (D3D12.dll) in Ssao.exe: 0xC0000005: Access violation reading location 0x0000000000000018."
in CDevice::UMSetError_ inside D3D12.dll
originally from the line
"ThrowIfFailed(md3dDevice->CreateGraphicsPipelineState(&opaquePsoDesc, IID_PPV_ARGS(&mPSOs["opaque"])));"
It seemed like Intel's drivers were handling out of memory errors incorrectly and calling the function with a null pointer.
Just putting it here in case someone Googles for it. Took a while to find out what was happening.

@kuukunen
Copy link
Author

Also note that for the sake of actual correctness, it maybe "should" sort the adapters by memory size and then attempt to create the devices in order, just in case the biggest one doesn't support DirectX 12 or fails for some reason. But since it's sample code and the original wasn't doing anything like that, I left that kind of stuff out for simplicity as it felt like a pretty distant edge case.

@kuukunen
Copy link
Author

Seems like I don't get a crash on new Intel drivers any more, though.

In the MS example I checked, the global device variable was a raw pointer,
but in these samples it's actually a ComPtr, so .Detach() is unnecessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants