XRT icon indicating copy to clipboard operation
XRT copied to clipboard

Fedora 42 build fails: OpenCL-ICD-Loader 3.x incompatibility (xocl) and GCC 15 Werror in aiebu; deps script conflicts

Open Ankk98 opened this issue 4 months ago • 2 comments

Environment

  • OS: Fedora 42
  • Kernel: Linux 6.16.0-264.vanilla.fc42.x86_64
  • gcc: 15.2.1
  • cmake: 3.31.6
  • OpenCL loader packages present by default: OpenCL-ICD-Loader 3.0.6 (+ devel)
  • Branch: HEAD detached at d0a52f139 based on main branch of xdna-driver

Repro steps

  • Install deps:
    sudo ./src/runtime_src/tools/scripts/xrtdeps.sh
    
    • DNF reports conflicts (see Observed).
  • Build:
    cd build
    ./build.sh -opt -noert -disable-werror -j $(nproc)
    

Observed behavior

  • Deps script conflicts on Fedora 42 because it prefers ocl-icd while Fedora ships OpenCL-ICD-Loader by default:
    • Conflicts between OpenCL-ICD-Loader{,-devel} and ocl-icd{,-devel} (also i686 pulled in).
  • Build error in xocl against Fedora’s loader headers:
    src/runtime_src/xocl/api/icd/ocl_icd_bindings.cpp:212:1: error: too many initializers for ‘const cl_icd_dispatch’ {aka ‘const _cl_icd_dispatch’}
    
    • Indicates the dispatch struct layout/definition differs from what ocl_icd_bindings.* expects (appears tailored to ocl-icd 2.x, not Khronos OpenCL-ICD-Loader 3.x).
  • Separate build stops due to -Werror enforced inside aiebu with GCC 15 warnings:
    core/common/aiebu/src/cpp/preprocessor/preprocessor_input.h:80:30: error: ‘virtual std::vector<char>& ...::get_data(const std::string&)’ was hidden [-Werror=overloaded-virtual=]
    
    • -DXRT_ENABLE_WERROR=0 does not disable Werror in the aiebu submodule.

Expected behavior

  • XRT should build on Fedora 42 with the distro-default Khronos OpenCL-ICD-Loader 3.x without package swaps.
  • A project-wide “disable Werror” switch should also cover submodules like aiebu, or the warnings should be fixed/gated for GCC 15.

Requests

  • ICD compatibility: Make xocl ICD bindings compatible with OpenCL-ICD-Loader 3.x headers/ABI, or detect the loader variant and initialize the dispatch table accordingly.
  • Deps script: Update xrtdeps.sh for Fedora 42 to:
    • Accept OpenCL-ICD-Loader{,-devel} as valid alternatives to ocl-icd{,-devel}.
    • Avoid pulling i686 ocl-icd which conflicts with 64-bit loader.
  • Werror control: Provide a cmake option that reliably disables -Werror across all submodules including aiebu, or fix the GCC 15 warnings in aiebu.

Ankk98 avatar Aug 18 '25 10:08 Ankk98

The Werror bug seems to be partly solved. Compile without werror works for me on Fedora 42. Seems to be fixed by e37368b819b0acd30cec262d4b76c5f967d29cf6

akshaytolwani123 avatar Sep 21 '25 12:09 akshaytolwani123

Maintainers, Any plans on when this will be picked up? I have zero experience with this tech, but I can try to contribute if someone can mentor.

Ankk98 avatar Oct 23 '25 18:10 Ankk98