In DX11 and upwards you dont need optimus or the amd equivalent to select the graphics device, you can actually detect if the device has dedicated memory assigned to it, if so its a dGPU. When you select your DXGI adapter pass this to the Device construction function and you will always select a dGPU. The following piece of code shows you how to achieve what that article is listing for D3D11, with the exception that it will accept a NVidia or AMD chip as the rendering 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);
if (adapter != nullptr)
{
DXGI_ADAPTER_DESC adapterDesc;
adapter->GetDesc(&adapterDesc);
if (adapterDesc.VendorId != 0x8086)
{
break;
}
}
}
pFactory->Release();
}
Within windows the DX11 adapter selection will respect your choice, the only thing the preferred GPU setting in NV control panel does is list the NV GPU first in the adapter list which works for applications that always choose adapter 0.
BTW: VedorId 0x8086 is Intel you can find AMD (0x1002 this is actually ATI) and NV(0x10DE) on google easily