Conversation
ProbeDevice() only screened for reboot-pending states, so a device that had been disabled in Device Manager was still reported as Valid. Disabling a device does not remove its registry values, so the loader went on to read OpenCLDriverName from the disabled adapter's HKR software key and register an ICD for hardware that can never supply an OpenCL device. The result is a platform with zero devices. That is legal, and clinfo handles it, but it is not useful, and applications that treat CL_DEVICE_NOT_FOUND as fatal fail to start even when another GPU in the system is present and working. Reject devices reporting CM_PROB_DISABLED so their ICD is never loaded. Only the HKR path is affected: enumeration uses CM_GETIDLIST_FILTER_PRESENT and a disabled device is still "present". The DXGK path uses D3DKMTEnumAdapters2, which returns started adapters only. Verified on a two-GPU Windows system with one GPU disabled. Before: two platforms, one reporting zero devices. After: one platform with the working GPU; the disabled device's ICD is never read or loaded.
jenatali
approved these changes
Sep 16, 2026
jenatali
left a comment
Contributor
There was a problem hiding this comment.
Seems reasonable to me.
Contributor
Author
|
I have signed CLA but its still not updating. Can someone please check. |
Contributor
You need to address this:
|
Contributor
Author
|
I added my email to my profile and commit shows verified user now. Signed the CLA again, but doesn't seem to get updated |
Contributor
Author
|
CLA is signed now. Can we get workflow approval? |
Contributor
Author
|
@bashbaug How do i get the workflow approved? |
22 of 28 tasks
bashbaug
approved these changes
Sep 22, 2026
bashbaug
left a comment
Contributor
There was a problem hiding this comment.
Merging as discussed in the September 22nd teleconference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows,
ProbeDevice()in the HKR enumeration path only screens for reboot-pending states. A device that has been disabled in Device Manager is still reported asValid.Disabling a device does not remove its registry values, so the loader goes on to read
OpenCLDriverNamefrom the disabled adapter's HKR software key and registers an ICD for hardware that can never supply an OpenCL device.The result is a platform with zero devices. That is legal, and
clinfohandles it, but it is not useful — and applications that treatCL_DEVICE_NOT_FOUNDas fatal fail to start even when another GPU in the system is present and working.Why the HKR path specifically
Enumeration uses
CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT. In Windows terms present means physically installed — a disabled device is still present — so it is returned byCM_Get_Device_ID_ListW()andProbeDevice()is the only gate after that.The DXGK path is unaffected: it uses
D3DKMTEnumAdapters2, which returns started adapters only.Fix
Reject devices reporting
CM_PROB_DISABLEDso their ICD is never loaded. Both existing call sites already useif (ProbeDevice(...) != Valid) continue;, so no caller changes are needed, andCM_PROB_DISABLEDcomes fromcfgmgr32.h, which is already included.The check is deliberately narrow. It screens only the unambiguous, persistent case — a device a user explicitly disabled.
CM_PROB_FAILED_STARTand a broader!(ulStatus & DN_STARTED)test were both considered and left out: the former can be transient (mid driver install, resource conflict), andProbeDevice()is also called on software-component devnodes, whereDN_STARTEDsemantics are less certain and a false rejection would hide a working ICD.Verification
Reproduced on a two-GPU Windows system with one GPU disabled in Device Manager:
0devices. Loader trace shows the disabled device accepted and its ICD path read.WARNING: device is disabled (0x1802400), skipping..., and the disabled device'sOpenCLDriverNameis never read or its ICD loaded.clinfoexits0in both cases; the difference is that the useless empty platform is no longer advertised.🤖 Generated with Claude Code