-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added OpenCL Universal Driver Support for Win10 RS3 #21
Conversation
@bashbaug @kepatil There are some opens until we can call this complete:
I will update further soon. Thanks, |
References: |
Starting from Windows 10 RS3+ Graphics Drivers are no longer allowed to write HKLM entries, and hence the current registry key: HKLM\SOFTWARE\Khronos\OpenCL\Vendors Is no longer applicable to graphics drivers for registering their ICD. Instead, graphics drivers can write to either of the 2 registry keys below: 1) Display Adapter HKR 2) Software Components HKR Graphics Drivers (starting from RS3) have dedicated component INF files and are referenced via the CopyINF directive and/or (optional) "INF AddComponent directive". Every such component, e.g. OpenCL instance (ICD), is assigned a unique device instance ID (e.g. 0000, 0001, etc) under the "Software Component" GUID and use it to store the path to its ICD. Therefore we enumerate ICDs in the following places (and also in the following order): 1) Display Adapters HKRs (using the display adapter GUID) 2) Software Component HKRs (using the CM_* APIs to traverse the device tree) 3) The usual "Vendors" registry key (see above)
@bashbaug @kepatil Now that it has been tested more thoroughly and approved by Microsoft, we can start with the review process. P.S. a forked version of this code will be checked in to the Khronos Vulkan ICD Loader repository. Thanks, |
…y keys This change extends the functionality of searching for ICD JSONs by adding registry locations specific to given display adapter and software components associated with this display adapter. The exact locations in registry are queried using Windows public PnP Configuration Manager API[1]. This change is required, as previous ICD locations (constant path in "HKLM/Software") may be unreachable for drivers and their installers on Windows RS3[2]. Similar change is being made for OpenCL[2] [1]https://msdn.microsoft.com/en-us/library/windows/hardware/ff549713.aspx [2]KhronosGroup/OpenCL-ICD-Loader#21 Change-Id: I815c2b5dca9d56e1486760b9e0082ccac40af502
The changes are ready to go. |
This change extends the functionality of searching for ICD JSONs by adding registry locations specific to given display adapter and software components associated with this display adapter. The exact locations in registry are queried using Windows public PnP Configuration Manager API[1]. This change is required, as previous ICD locations (constant path in "HKLM/Software") may be unreachable for drivers and their installers on Windows RS3[2]. Similar change is being made for OpenCL[2] [1]https://msdn.microsoft.com/en-us/library/windows/hardware/ff549713.aspx [2]KhronosGroup/OpenCL-ICD-Loader#21
This change extends the functionality of searching for ICD JSONs by adding registry locations specific to given display adapter and software components associated with this display adapter. The exact locations in registry are queried using Windows public PnP Configuration Manager API[1]. This change is required, as previous ICD locations (constant path in "HKLM/Software") may be unreachable for drivers and their installers on Windows RS3[2]. Similar change is being made for OpenCL[2] [1]https://msdn.microsoft.com/en-us/library/windows/hardware/ff549713.aspx [2]KhronosGroup/OpenCL-ICD-Loader#21
This change extends the functionality of searching for ICD JSONs by adding registry locations specific to given display adapter and software components associated with this display adapter. The exact locations in registry are queried using Windows public PnP Configuration Manager API[1]. This change is required, as previous ICD locations (constant path in "HKLM/Software") may be unreachable for drivers and their installers on Windows RS3[2]. Similar change is being made for OpenCL[2] [1]https://msdn.microsoft.com/en-us/library/windows/hardware/ff549713.aspx [2]KhronosGroup/OpenCL-ICD-Loader#21
#ifdef _WIN64 | ||
static const char OPENCL_REG_SUB_KEY[] = "OpenCLDriverName"; | ||
#else | ||
static const char OPENCL_REG_SUB_KEY[] = "OpenCLDriverNameWow"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically, WoW refers only to executing 32-bit code on 64-bit OS.
To preserve this semantics, it would be better to change this #ifdef _WIN64
to checking for WoW with IsWow64Process() Windows API function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true in general, but in this case it is aligned with how OpenGL registers its ICDs, and uses the Wow suffix to refer to the 32-bit version of its ICD.
Besides, _WIN64 is compile-time, IsWow64Process() is run-time, we don't want the performance overhead incurred by this call if not actually needed.
@ofirc Changes to ICD extension spec were approved at the last working group call. I will act on this pull request shortly. |
I understand this is ready to go. Kedar, would you please commit? Our own tests show this is working as expected. |
Relevant updates to the ICD extension were accepted in KhronosGroup/OpenCL-Registry#30. |
Starting from Windows 10 RS3+ Graphics Drivers are no longer allowed to write HKLM entries, and hence the current registry key: HKLM\SOFTWARE\Khronos\OpenCL\Vendors Is no longer applicable to graphics drivers for registering their ICD. Instead, graphics drivers can write to either of the 2 registry keys below: 1) Display Adapter HKR 2) Software Components HKR Graphics Drivers (starting from RS3) have dedicated component INF files and are referenced via the CopyINF directive and/or (optional) "INF AddComponent directive". Every such component, e.g. OpenCL instance (ICD), is assigned a unique device instance ID (e.g. 0000, 0001, etc) under the "Software Component" GUID and use it to store the path to its ICD. Therefore we enumerate ICDs in the following places (and also in the following order): 1) Display Adapters HKRs (using the display adapter GUID) 2) Software Component HKRs (using the CM_* APIs to traverse the device tree) 3) The usual "Vendors" registry key (see above) Corresponding ICD extension updates were made with KhronosGroup/OpenCL-Registry#30.
Starting from Windows 10 RS3+ Graphics Drivers are no longer allowed to
write HKLM entries, and hence the current registry key:
HKLM\SOFTWARE\Khronos\OpenCL\Vendors
Is no longer applicable to graphics drivers for registering their ICD.
Instead, graphics drivers can write to either of the 2 registry keys
below:
Graphics Drivers (starting from RS3) have dedicated component INF files and are
referenced via the CopyINF directive and/or (optional) "INF AddComponent directive".
Every such component, e.g. OpenCL instance (ICD), is assigned a unique device
instance ID (e.g. 0000, 0001, etc) under the "Software Component" GUID and use it to
store the path to its ICD.
Therefore we enumerate ICDs in the following places (and also in the following order):