Fix Windows Adapter Enumeration to ensure Render/Compute support

- On Windows, if one uses remote desktop to connect to their windows machine,
  then attempts to run compute workloads, a shadow intel graphics device
  is created and L0/OpenCL will report 2 devices for a single device.
- This second device is not valid and if used will cause workload failures.
- to ensure that only usable devices are reported by L0/OpenCL, we now check
  the Adapter for its Support in D3DKMT_ADAPTERTYPE which for our use must
  have RenderSupported. The Shadow devices only support display and not
  rendering/compute, so this check will avoid reporting a display only
  intel device for compute usage.

Change-Id: Ib619c454aea2deb91135e7958efbca1cee5a05eb
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Spruit, Neil R
2020-09-03 11:49:39 -07:00
committed by sys_ocldev
parent 9ea9baf1ad
commit 3c44c6f942
4 changed files with 87 additions and 29 deletions

View File

@@ -245,6 +245,20 @@ std::unique_ptr<HwDeviceId> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &os
return nullptr;
}
D3DKMT_ADAPTERTYPE queryAdapterType = {};
QueryAdapterInfo.hAdapter = OpenAdapterData.hAdapter;
QueryAdapterInfo.Type = KMTQAITYPE_ADAPTERTYPE;
QueryAdapterInfo.pPrivateDriverData = &queryAdapterType;
QueryAdapterInfo.PrivateDriverDataSize = sizeof(queryAdapterType);
status = osEnvironment.gdi->queryAdapterInfo(&QueryAdapterInfo);
if (status != STATUS_SUCCESS) {
DEBUG_BREAK_IF("queryAdapterInfo failed");
return nullptr;
}
if (0 == queryAdapterType.RenderSupported) {
return nullptr;
}
return std::make_unique<HwDeviceId>(OpenAdapterData.hAdapter, adapterLuid, &osEnvironment);
}