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 AdapterRam
via the following method:
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
}
}
I have some users experiencing an issue where they have an integrated Intel video card that is lying about how much AdapterRAM
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.
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.
Is there any way to detect if a card is integrated vs installed?
Is there a better way to select which GPU is superior?
The DirectX way to enumerate adapters is covered in the Microsoft programming guide here https://msdn.microsoft.com/en-us/library/windows/desktop/ff476877(v=vs.85).aspx. I wouldn't recommend using Windows Management Objects to do this.
The resulting IDXGIAdapter interface contains all the capabilities of the adapter, the approach to identifying Integrated Adapters is covered in this post https://gamedev.stackexchange.com/questions/61938/how-to-check-if-user-has-integrated-graphics-card which unfortunately concludes that you will have to know the hardware ID of the adapters you wish to avoid - there is no setting which tells you it is integrated or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With