Programatically selecting the best graphics card for DirectX rendering
<p>I am working on a product that uses DirectX to render some more intensive images. Up until now, knowing that some computers have multiple GPUs, I have selected the GPU to render on by finding the one that has the largest <code>AdapterRam</code> via the following method:</p>

<pre><code>using ( ManagementObjectSearcher searcher = new ManagementObjectSearcher( "select * from Win32_VideoController" ) ) {
    foreach ( ManagementObject mo in searcher.Get() ) {
       var adapterRam = mo.Properties[ "AdapterRAM" ].Value;
       //Use this one if it is the largest
    }
}
</code></pre>

<p>I have some users experiencing an issue where they have an integrated Intel video card that is lying about how much <code>AdapterRAM</code> it has and so it gets selected. I think it is reporting some amount of System RAM that it has been allocated. The drawing operation proves too intensive for this card and crashes the video drivers. The computer does have a perfectly capable Nvidia card that should have been the one that was selected.</p>

<p>I'm thinking that a good way to get around this issue is to never choose an integrated card over an installed card, but I haven't yet been able to find a way to programatically figure out if a card is integrated.</p>

<p>Is there any way to detect if a card is integrated vs installed?</p>

<p>Is there a better way to select which GPU is superior?</p>