Hello,
while preparing the pyfai package which contain OpenCL test, I got this error message from the rocm CI/CD
146s ======================================================================
146s ERROR: test_sort4 (pyFAI.opencl.test.test_collective.TestGroupFunction.test_sort4)
146s tests the sort of floating points in a workgroup
146s ----------------------------------------------------------------------
146s Traceback (most recent call last):
146s File "/usr/lib/python3/dist-packages/pyFAI/opencl/test/test_collective.py", line 91, in setUp
146s get_opencl_code("pyfai:openCL/collective/comb_sort.cl")).build()
146s ~~~~~^^
146s File "/usr/lib/python3/dist-packages/pyopencl/__init__.py", line 526, in build
146s self._prg, was_cached = self._build_and_catch_errors(
146s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
146s lambda: create_built_program_from_source_cached(
146s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146s self._context, self._source, options_bytes, devices,
146s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146s cache_dir=cache_dir, include_path=include_path),
146s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146s options_bytes=options_bytes, source=self._source)
146s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146s File "/usr/lib/python3/dist-packages/pyopencl/__init__.py", line 574, in _build_and_catch_errors
146s raise err
146s pyopencl._cl.RuntimeError: clBuildProgram failed: BUILD_PROGRAM_FAILURE - clBuildProgram failed: BUILD_PROGRAM_FAILURE - clBuildProgram failed: BUILD_PROGRAM_FAILURE
146s
146s Build on <pyopencl.Device 'gfx90a:sramecc+:xnack-' on 'AMD Accelerated Parallel Processing' at 0x92eb260>:
146s
146s fatal error: malformed or corrupted precompiled file: 'could not find file '/usr/lib/llvm-21/lib/clang/21/include/opencl-c-base.h' referenced by AST file '/tmp/comgr-90146f/include/opencl1.2-c.pch''
146s 1 error generated.
146s Error: Failed to compile source (from CL or HIP source to LLVM IR).
146s
146s (options: -I /usr/lib/python3/dist-packages/pyopencl/cl)
146s (source saved as /tmp/tmp3yrn6l5p.cl)
146s
146s ----------------------------------------------------------------------
146s Ran 44 tests in 11.785s
146s
146s FAILED (errors=28, skipped=4)
147s autopkgtest [14:57:42]: test opencl-rocm: -----------------------]
The autopkgtest depends only on rocm-opencl-icd
Test-Command: rocm-test-launcher debian/tests/opencl
Architecture: amd64 arm64 armel armhf i386
Depends:
bitshuffle,
rocm-opencl-icd,
pkg-rocm-tools,
python3-all,
python3-pyfai,
python3-tk,
xauth,
xvfb,
Features: test-name=opencl-rocm
Restrictions: allow-stderr, skip-not-installable, skippable
We can find this opencl-c-base.h files in different packages.
$ apt-file search opencl-c-base.h
castxml: /usr/share/castxml/clang/include/opencl-c-base.h
libclang-common-14-dev: /usr/lib/llvm-14/lib/clang/14.0.6/include/opencl-c-base.h
libclang-common-17-dev: /usr/lib/llvm-17/lib/clang/17/include/opencl-c-base.h
libclang-common-18-dev: /usr/lib/llvm-18/lib/clang/18/include/opencl-c-base.h
libclang-common-19-dev: /usr/lib/llvm-19/lib/clang/19/include/opencl-c-base.h
libclang-common-21-dev: /usr/lib/llvm-21/lib/clang/21/include/opencl-c-base.h
libopencl-clang-14-dev: /usr/include/cclang/opencl-c-base.h
libopencl-clang-17-dev: /usr/include/cclang/opencl-c-base.h
libopencl-clang-18-dev: /usr/include/cclang/opencl-c-base.h
libopencl-clang-19-dev: /usr/include/cclang/opencl-c-base.h
libpocl2-common: /usr/share/pocl/include/opencl-c-base.h
swiftlang: /usr/libexec/swift/lib/clang/17/include/opencl-c-base.h
It seems to me that something is missing in order to have a working OpenCL stack with rocm-openc-icd.
thanks for considering.
Frederic