So ever since I switched my project to VS2015 and windows 10 it wont actually select the NV gpu as the gpu to render with. I have code in the project like this which should select the adapter that is not the intel adapter.
IDXGIAdapter* adapter = nullptr;
IDXGIFactory * pFactory;
HRESULT hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&pFactory));
if (hr == S_OK)
{
for (size_t counter = 0; hr == S_OK; ++counter)
{
adapter = nullptr;
hr = pFactory->EnumAdapters((UINT)counter, &adapter);
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "%d", counter);
if (adapter != nullptr)
{
DXGI_ADAPTER_DESC adapterDesc;
adapter->GetDesc(&adapterDesc);
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "vendor id: %x", adapterDesc.VendorId);
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "device id: %x", adapterDesc.DeviceId);
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "subsytem id: %x", adapterDesc.SubSysId);
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "revision: %d", adapterDesc.Revision);
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "Dedicated VRAM: %llu MiB", adapterDesc.DedicatedVideoMemory / (1024 * 1024));
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "Dedicated RAM: %llu MiB", adapterDesc.DedicatedSystemMemory / (1024 * 1024));
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "Shared RAM: %llu MiB", adapterDesc.SharedSystemMemory / (1024 * 1024));
std::string str;
convertToCString(adapterDesc.Description, str);
MSG_TRACE_CHANNEL("RENDER SYSTEM ADAPTER INFO:", "description: %s", str.c_str());
if (adapterDesc.VendorId != 0x8086) //This is intels vendor ID, I run this on NV and AMD/ATi chips
{
break;
}
}
}
pFactory->Release();
}
if (!m_deviceManager.createDevice(adapter))
{
ExitProcess(1); //Fix this exit cleanly
}
However when running this on a 970M GTX, even with the GPU preffered set to NV in the NV control panel, the game just wont render anything to the hwnd. I have done render doc traces that show me that the D3D runtime is actually drawing stuff.
I have traced all the windows and D3D calls and none of these are failing, they all return S_OK, which means everything should work.
Any idea how I can actually pick the NV Gpu to run the application on because the debug build on the iGPU bearly reaches 60fps and the game is not drawing all that much to begin with. So going forward keeping it on the iGPU is not going to be fast enough for me, debugging a slide show is a pain in the ass (I was CPU bound and because of that had 3fps I fixed those things).