opencl: do not call OpenCL 3.0 API functions for older drivers - #25673
Merged
Conversation
clCreateBufferWithProperties and cl_mem_properties are OpenCL 3.0. Building with GGML_OPENCL_TARGET_VERSION < 300 fails to compile, and linking against a pre-3.0 driver fails with "cannot locate symbol clCreateBufferWithProperties" -- so the backend cannot be built for an Adreno whose driver predates 3.0 (e.g. the Adreno 642L, which reports OpenCL 2.0). The call is the cl_qcom_large_buffer allocation retry, which only runs when adreno_use_large_buffer is set. That is never the case on such a driver, so the path is dead there. Compile it out below 3.0. No functional change for any device that reports OpenCL 3.0.
lhez
marked this pull request as ready for review
July 14, 2026 20:58
lhez
approved these changes
Jul 14, 2026
max-krasnyansky
approved these changes
Jul 14, 2026
CowboyTim
pushed a commit
to aardbeiplantje/llama.cpp
that referenced
this pull request
Jul 21, 2026
smalinin
pushed a commit
to smalinin/llama.cpp
that referenced
this pull request
Aug 4, 2026
satindergrewal
pushed a commit
to satindergrewal/llama.cpp
that referenced
this pull request
Aug 12, 2026
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.
Overview
The PR is to fix a bug for older OpenCL drivers. The API functions clCreateBufferWithProperties and cl_mem_properties are OpenCL 3.0. Building with GGML_OPENCL_TARGET_VERSION < 300 fails to compile, and linking against a pre-3.0 driver fails with "cannot locate symbol clCreateBufferWithProperties" -- so the backend cannot be built for an Adreno whose driver predates 3.0 (e.g. the Adreno 642L, which reports OpenCL 2.0).
No functional change for any device that reports OpenCL 3.0.
Additional information
For Adreno A6x. A7x and beyond all supports OpenCL 3.0.
Requirements