-
Notifications
You must be signed in to change notification settings - Fork 21
How to select a preferred kind of gpu to infer on?
According to our WebNN Spec, we respect the power preference for adaptor selection. Currently, we have enabled setting power preference for selecting iGPUs (integrated GPUs) / dGPUs (discrete GPUs) on DML backend only when running C++ examples and end2end tests, for example:
- iGPUs:
out\Release\webnn_end2end_tests.exe --gtest_filter=*AddTests* -p low-power
- dGPUs:
out\Release\webnn_end2end_tests.exe --gtest_filter=*AddTests* -p high-performance
We enumerates graphics adapters based on a given GPU preference by DXGIFactory6::EnumAdapterByGpuPreference method. This method allows developers to select which GPU they think is most appropriate for each device their app creates and utilizes.
When DXGI_GPU_PREFERENCE_MINIMUM_POWER is specified for the GpuPreference parameter, the order of preference for the adapter returned in ppvAdapter will be:
- iGPUs (integrated GPUs)
- dGPUs (discrete GPUs)
- xGPUs (external GPUs)
When DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE is specified for the GpuPreference parameter, the order of preference for the adapter returned in ppvAdapter will be:
- xGPUs
- dGPUs
- iGPUs
Please notice that you should ensure that all of the iGPUs and dGPUs you want to specify have been installed successfully with proper drivers and enabled in the BIOS configuration. ("Internal Graphics" in the "Chipset" column should be in mode "Enabled" not "Auto".) Otherwise, the computer's primary (NULL) adapter might also be called "Microsoft Basic Render Driver" may be used.