Skip to content

Fix OpenCL GPU enumeration error handling#50

Open
zZoMROT wants to merge 1 commit into
1inch:masterfrom
zZoMROT:master
Open

Fix OpenCL GPU enumeration error handling#50
zZoMROT wants to merge 1 commit into
1inch:masterfrom
zZoMROT:master

Conversation

@zZoMROT
Copy link
Copy Markdown

@zZoMROT zZoMROT commented May 9, 2026

Change Summary

What does this PR change?
This PR fixes OpenCL GPU enumeration by checking clGetDeviceIDs return values and skipping platforms without usable GPU devices. It prevents invalid or uninitialized devices from being added to the device list and causing context creation failures.

Related Issue/Ticket:
N/A

Testing & Verification

How was this tested?

  • Unit tests
  • Integration tests
  • Manual testing (describe steps)
  • Verified on staging

Manual testing:

  • Built the project successfully with make.
  • Reproduced the issue on a server with NVIDIA CUDA and PoCL OpenCL platforms installed.
  • Verified that platforms without usable GPU devices are skipped instead of producing invalid GPU entries.
  • Confirmed that OpenCL context creation proceeds using the valid NVIDIA GPU.

Risk Assessment

Risk Level:

  • Low - Minor changes, no operational impact
  • Medium - Moderate changes, limited impact, standard rollback available
  • High - Significant changes, potential operational impact, complex rollback

Risks & Impact
This change only affects OpenCL device discovery error handling. The main risk is that unsupported or misconfigured OpenCL platforms will now be skipped instead of being included, which is the intended behavior. No migrations, downtime, or breaking changes are expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants