Problem
On ROCm 7.13 with newer integrated APUs (e.g., gfx1151), the OpenVX OpenCL backend fails to enumerate platforms even though the AMD OpenCL driver is installed.
Environment
- ROCm 7.13 installed at
/opt/rocm/core-7.13
- Device:
gfx1151 (AMD Radeon 8060S APU)
- MIVisionX built with
-DBACKEND=OPENCL
Observed error
Running runvx -affinity:GPU ... or the OpenVX conformance suite prints:
ERROR: clGetPlatformIDs(0,0,*) => -1001 (failed)
ERROR: vxVerifyGraph(graph) failed (-1:VX_FAILURE)
clinfo without any override also reports no platforms.
Root cause
/opt/rocm/lib/libOpenCL.so (which MIVisionX binaries pick up via CMAKE_BUILD_RPATH) appears to be an older/broken ICD loader that does not successfully enumerate the AMD platform on this hardware. The system ocl-icd loader (/usr/lib/x86_64-linux-gnu/libOpenCL.so.1) and the upstream Khronos OpenCL-ICD-Loader both work correctly.
Verified workaround (no sudo required)
- Build or use a working ICD loader. The simplest self-contained approach is to build the Khronos loader locally:
mkdir -p ~/.openclaw/opencl-khronos
git clone https://github.com/KhronosGroup/OpenCL-Headers.git ~/.openclaw/opencl-khronos/OpenCL-Headers
git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader.git ~/.openclaw/opencl-khronos/OpenCL-ICD-Loader
mkdir ~/.openclaw/opencl-khronos/OpenCL-ICD-Loader/build
cd ~/.openclaw/opencl-khronos/OpenCL-ICD-Loader/build
cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=$HOME/.openclaw/opencl-khronos/OpenCL-Headers \
-DCMAKE_INSTALL_PREFIX=$HOME/.openclaw/opencl-khronos/install ..
make -j$(nproc)
make install
- Create a local ICD vendor file pointing at the ROCm OpenCL driver:
mkdir -p ~/.openclaw/opencl-vendors
echo '/opt/rocm/core-7.13/lib/opencl/libamdocl64.so' > ~/.openclaw/opencl-vendors/amdocl64.icd
- Symlink the working loader into the MIVisionX OpenCL build lib directory so the binaries use it instead of the broken ROCm loader:
ln -sf $HOME/.openclaw/opencl-khronos/install/lib/libOpenCL.so.1 \
$HOME/.openclaw/workspace/MIVisionX-fork/build_opencl/lib/libOpenCL.so.1
- Set environment variables when running tests:
export OCL_ICD_VENDORS=$HOME/.openclaw/opencl-vendors
export LD_LIBRARY_PATH=$HOME/.openclaw/workspace/MIVisionX-fork/build_opencl/lib:/opt/rocm/core-7.13/lib/opencl:$LD_LIBRARY_PATH
Verification
After the workaround:
$ clinfo | grep -E 'Platform Version|ICD loader'
Platform Version OpenCL 2.1 AMD-APP (3581.0)
ICD loader Name Khronos OpenCL ICD Loader
ICD loader Vendor Khronos Group
ICD loader Version 3.1.0
ICD loader Profile OpenCL 3.1
Full Khronos OpenVX 1.3 CTS passes on OpenCL:
[ ALL DONE ] 5820 test(s) from 69 test case(s) ran
[ PASSED ] 5820 test(s)
[ FAILED ] 0 test(s)
Request
Please document this setup in the MIVisionX OpenCL backend README / build instructions. Users on ROCm 7.13 (and especially APUs like gfx1151) currently hit a non-obvious -1001 failure with the default ROCm loader, and a short "OpenCL ICD loader setup" section would save a lot of debugging time.
Problem
On ROCm 7.13 with newer integrated APUs (e.g.,
gfx1151), the OpenVX OpenCL backend fails to enumerate platforms even though the AMD OpenCL driver is installed.Environment
/opt/rocm/core-7.13gfx1151(AMD Radeon 8060S APU)-DBACKEND=OPENCLObserved error
Running
runvx -affinity:GPU ...or the OpenVX conformance suite prints:clinfowithout any override also reports no platforms.Root cause
/opt/rocm/lib/libOpenCL.so(which MIVisionX binaries pick up viaCMAKE_BUILD_RPATH) appears to be an older/broken ICD loader that does not successfully enumerate the AMD platform on this hardware. The systemocl-icdloader (/usr/lib/x86_64-linux-gnu/libOpenCL.so.1) and the upstream KhronosOpenCL-ICD-Loaderboth work correctly.Verified workaround (no sudo required)
Verification
After the workaround:
Full Khronos OpenVX 1.3 CTS passes on OpenCL:
Request
Please document this setup in the MIVisionX OpenCL backend README / build instructions. Users on ROCm 7.13 (and especially APUs like
gfx1151) currently hit a non-obvious-1001failure with the default ROCm loader, and a short "OpenCL ICD loader setup" section would save a lot of debugging time.