c# - Programmatically determine if system has switchable graphics -
we struggling following problem on laptops switchable graphics (amd radeon 7670m + intel 4000) in our wpf application:
the d3dimage use display video shows black frame. happens when discrete graphics (amd) active application (mode set high performance). intel graphics active (mode set power saving) works. looks not alone issue. search on google revealed following posts in amd forums:
- urgent: switchable graphics , resources sharing
- d3dimage not show when configure switable graphics radeon adapter
i have found workaround using d3dimage.copybackbuffer - looks backbuffer indeed contain right frame - try display instead.
but in order apply workaround when necessary, brings me subject of question: how find out if system has switchable graphics?
suppose there might ways using wmi or looking through registry, glad if point me in right direction or might have example how so.
update:
i have tried enumdisplaydevices , system.management.managementobjectsearcher. first not returning devices while latter does. perhaps there still better way?
combining this question , this one solution use system.management this:
internal class program { private static void main(string[] args) { managementobjectsearcher searcher = new managementobjectsearcher("select * win32_videocontroller"); var mos = searcher.get(); foreach (managementobject mo in mos) { foreach (propertydata property in mo.properties) { if (property.name == "description") { console.writeline(property.value); } } } console.readkey(); } } my hardware is:
and result is:
since have not-really-hardware device called "dameware development mirror" can @ videoprocessor property. nvidea , intel have value, non-existing device there null.
if (property.name == "description") console.writeline(property.value); if (property.name == "videoprocessor") console.writeline(property.value); and determine active videocard can check if "currentbitsperpixel" property has value



Comments
Post a Comment