How to differentiate between dedicated and integrated gpu card via c++?
Asked Answered
M

2

11

I want to know via WMI or other means in c++ if the user has integrated or dedicated GPU card?

I have gone over Win32_VideoController and could not find anything that will help me to differentiate between the two.

Thanks in advance.

Malebranche answered 10/4, 2016 at 7:21 Comment(4)
Whats the reason to? You can try running a simulation and ask the user if he/she is using one or not.Begone
From what I can gather, the SOP on windows is to allow the end user to control the use of integrated/dedicated graphics.Ronda
Not really answering the question, but just for reference: this API learn.microsoft.com/en-us/windows/win32/api/dxgi1_6/… in combination with DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE lets you get a list of the GPUs in performance order. If you are sure that you have (at least) one discrete card, you can use this API to find it. Unfortunately, it doesn't let you know if you have a discrete card, or only an integrated one, which is very annoying.Jinnah
Thinking better about it, the DedicatedVideoMemory attribute in learn.microsoft.com/en-us/windows/win32/api/dxgi/… might be a good way to decide whether a card is integrated or not, at least assuming that an integrated card never has dedicated memory, or that a discrete card is defined by the fact that it has dedicated memory (not 100% sure).Jinnah
S
0

It is surprising that no one brought this idea up after so many years. Most people said it is impossible, and it is true that Windows natively does not provide any means to detect whether it is an iGPU or dGPU. However, I managed to make it work to a certain extent, if you could bear with the limitations. The general idea is that you can use wmic to get the name of CPU installed, and maintain a list of all CPUs that has integrated graphics (which may be very short, depending on what you need this feature for.) For newer CPU models like 9th gen or newer Intel desktop processor and AMD Ryzen 1000 and newer, you can simply tell by the CPU naming. Intel processors without integrated graphics will end with letter F, while AMD processors with integrated graphics will end with letter G. Then you can use wmic to get list of all gpus (including iGPU), and by counting the number of gpus installed, you can easily tell if the user has an iGPU or dGPU, as it is impossible to have more than 1 iGPU. Thus, if you detect that the CPU comes with an iGPU, and if there is only 1 GPU reported by wmic, you know that it is definitely iGPU. On the other hand, if there are multiple GPUs reported, you know that one of them is definitely dGPU. Of course, this does not work if the user manually disabled iGPU themselves, thus I am saying this approach has limitations.

Sproul answered 7/9, 2021 at 11:39 Comment(2)
What about disabling iGPU in BIOS? That leaves you with 1 dGPU and a CPU matching iGPU list.Konopka
Yea I mentioned in the answer, there are limitations to this approach, like user manually disable their iGPUSproul
J
0

Very old question, but I guess it can still make sense if somebody is struggling with this. Starting from - I think - Windows 10, you can query the OS for a list of GPUs in performance order. This is done using IDXGIFactory6::EnumAdapterByGpuPreference method and requiring the list to be in performance order with DXGI_GPU_PREFERENCE::DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE. Now, if one excludes from the list the cards that have zero dedicated video memory, one should be able to get rid of the integrated cards. This can be done by looking at DedicatedVideoMemory variable in the card description.

Jinnah answered 3/7, 2024 at 14:44 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.