Skip to content

hexagon: fix OpenCL not found error when building hexagon backend#22946

Open
Russyyds wants to merge 1 commit into
ggml-org:masterfrom
Russyyds:master
Open

hexagon: fix OpenCL not found error when building hexagon backend#22946
Russyyds wants to merge 1 commit into
ggml-org:masterfrom
Russyyds:master

Conversation

@Russyyds
Copy link
Copy Markdown
Contributor

Overview

Fix compile error for hexagon backend

Additional information

Fixes #22945

Add OpenCL libs when compile hexagon backend.

  1. Download the OpenCL from Qualcomm website or KhronosGroup
  2. Add the OpenCL dir to environ and run the command below
export ANDROID_NDK_ROOT=/home/tom/codes/android-ndk-r27d
export OpenCL_LIBRARY=/path/to/opencl-sdk/libs/Android/libOpenCL.so
export OpenCL_INCLUDE_DIR=/path/to/opencl-sdk/inc
export HEXAGON_SDK_ROOT=/path/to/Hexagon_SDK/6.4.0.2
export HEXAGON_TOOLS_ROOT=/path/to/Hexagon_SDK/6.4.0.2/tools/HEXAGON_Tools/19.0.04

mkdir -p build-snapdragon
cp docs/backend/snapdragon/CMakeUserPresets.json .
cmake --preset arm64-android-snapdragon-release -B build-snapdragon
cmake --build build-snapdragon

Requirements

@Russyyds Russyyds requested a review from a team as a code owner May 11, 2026 15:48
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 11, 2026
@max-krasnyansky
Copy link
Copy Markdown
Member

@Russyyds
This is not Hexagon related, it's more of a Snapdragon build related.
ie enabling CPU/GPU/NPU backends in one build as we recommend by default in the README.
If you use the docker toolchain (see the readme) everything is installed in the correct locations so there is no need to add additional env/cmake vars.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile bug: [Hexagon Backend] Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR)

2 participants