Skip to content

Build issue: 'opencl-c-base.h' file not found #183

Closed

Description

@jinz2014

I am building the compute runtime, and got the error on CentOS7. Thanks for your instructions!

[ 72%] Generating ../../../bin/built_ins/x64/gen9/aux_translation_Gen9lp.spv, ../../../bin/built_ins/x64/gen9/aux_translation_Gen9lp.bin, ../../../bin/built_ins/x64/gen9/aux_translation_Gen9lp.cpp, ../../../bin/built_ins/x64/gen9/aux_translation_Gen9lp.gen
In file included from :1:
./opencl-c.h:12:10: fatal error: 'opencl-c-base.h' file not found
#include "opencl-c-base.h"
^~~~~~~~~~~~~~~~~

Activity

  1. AlexeySachkov commented on Jun 22, 2019

    @AlexeySachkov

    Hi @jinz2014,

    Probably this is a bug in intel/intel-graphics-compiler rather than in intel/compute-runtime, but I'm not sure.

    As I can see in this commit, opencl-c.h header file has been split into opencl-c-base.h and opencl-c.h.

    However, as you can see here, only opencl-c.h is being installed.

    You could try to update IGC/BiFModule/CMakeLists.txt to copy new header too to workaround the problem.

    One more note: according to IGC build instructions you should use release_80 version of LLVM - I don't know if it is supported to build compiler/runtime using LLVM master branch

  2. jinz2014 commented on Jun 22, 2019

    @jinz2014
    Author

    Hi Alexey,

    Thanks for explaining the issue ! I am not very familiar with CMake. Please let me know how I can copy the new header to IGC/BiFModule/CMakeLists.txt. I am using LLVM master branch and building the runtime on CentOS 7. Is it right that I will need to build IGC again ?

    Thanks

  3. lwesiers commented on Jun 24, 2019

    @lwesiers
    Contributor

    Hello there,

    @jinz2014

    Is it right that I will need to build IGC again ?

    No, you don't need to rebuild the IGC. You should manually install the missing header.
    If you was building IGC with opencl-clang, then please follow this commands:

    cd <workspace-of-igc>
    sudo cp llvm_source/tools/clang/lib/Headers/opencl-c-base.h /usr/local/include
    

    I made a fix for this and soon it will be available on https://github.com/intel/intel-graphics-compiler

  4. jinz2014 commented on Jun 24, 2019

    @jinz2014
    Author

    Thanks for the instruction!

    The build is successful and it generates two .rpm files:
    intel-opencl-19.25.0-1.el7.x86_64.rpm
    intel-opencl-ocloc-19.25.0-1.el7.x86_64.rpm

    Does a user need to install both rpms ?

    When running the command:
    sudo rpm -i intel-opencl-19.25.0-1.el7.x86_64.rpm

    I got the error:
    Failed dependencies:
    intel-gmmlib is needed by intel-opencl-19.25.0-1.el7.x86_64
    intel-igc-opencl is needed by intel-opencl-19.25.0-1.el7.x86_64

    However, I did build the gmmlib as described in https://github.com/intel/gmmlib, and igc

    Something is missing, so how can I generate intel-gmmlib and intel-gmmlib after building gmmlibs and igc for the rpm to find the dependencies ?

    Thanks again

  5. JacekDanecki commented on Jun 24, 2019

    @JacekDanecki
    Contributor

    You can see this wiki page as reference.
    Below command will create package

    make package
    
  6. lwesiers commented on Jun 24, 2019

    @lwesiers
    Contributor

    The fix for igc is available ac50dc601f4035ed7daafa1cdf32713e4b0c4795.

  7. jinz2014 commented on Jun 24, 2019

    @jinz2014
    Author

    Thanks for the wiki page and fix for igc!

    Typing the command 'make package' generates the RPM files. However, there are conflicts when installing intel-gmmlib-9.0.0-1.el7.x86_64.rpm:

    $ sudo rpm -i intel-gmmlib-9.0.0-1.el7.x86_64.rpm
    file /usr/local from install of intel-gmmlib-9.0.0-1.el7.x86_64.rpm conflicts with file from package
    filesystem-3.2.25.el7.x86_64.rpm
    file /usr/local/lib64 from install of intel-gmmlib-9.0.0-1.el7.x86_64.rpm conflicts with file from package
    filesystem-3.2.25.el7.x86_64.rpm

    I am not sure if you encountered such issue when building on CentOS7.

    Thanks

  8. JacekDanecki commented on Jun 25, 2019

    @JacekDanecki
    Contributor

    We've observed similar issue last year in Neo, but it was fixed with this commit.
    I cannot reproduce this issue on my side, but I've prepared this change on my fork. Can you confirm whether it fixes problem?

  9. jinz2014 commented on Jun 25, 2019

    @jinz2014
    Author

    Thanks for your chang on your fork. It fixes the problem of installing intel-gmmlib. Then, there are other conflicts when installing intel-gmmlib-devel and intel-opencl-ocloc. I am not clear if there is an order regarding which RPMs need to be installed first. Thanks for your fixes.

    $ sudo rpm -i intel-gmmlib-devel-9.0.0-1.el7.x86_64.rpm
    file /usr/local/include from install of intel-gmmlib-devel-9.0.0-1.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
    file /usr/local/include from install of intel-gmmlib-devel-9.0.0-1.x86_64 conflicts with file from package intel-igc-opencl-devel-1.0.9-1.x86_64
    file /usr/local/lib64/pkgconfig from install of intel-gmmlib-devel-9.0.0-1.x86_64 conflicts with file from package intel-igc-opencl-devel-1.0.9-1.x86_64


    $ sudo rpm -i intel-opencl-ocloc-19.25.0-1.el7.x86_64.rpm
    file /usr/local/bin from install of intel-ocloc-19.25.0-1.el7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
    file /usr/local/bin from install of intel-ocloc-19.25.0-1.el7.x86_64 conflicts with file from package intel-igc-opencl-devel-1.0.9-1.x86_64
    file /usr/local/bin from install of intel-ocloc-19.25.0-1.el7.x86_64 conflicts with file from package intel-igc-media-1.0.9-1.x86_64


    I think I can ignore the following error when installing intel-igc-opencl because I can use export LD_LIBRARY_PATH=/path/to/libopencl-clang.so.9svn(). Is that right ?

    error: Failed dependencies:
    libopencl-clang.so.9svn()(64bit) is needed by intel-igc-opencl-1.0.9-1.x86_64

    Thanks again

  10. JacekDanecki commented on Jun 25, 2019

    @JacekDanecki
    Contributor

    I've updated change for gmmlib here

    For intel-opencl-ocloc change is here

    Can you verify them and confirm whether it works for you?

    I suppose libopencl-clang.so.9 will be installed into /usr/local/lib64, so you can set:

    export LD_LIBRARY_PATH=/usr/local/lib64
    

    or add file igc.conf containing

    /usr/local/lib64
    

    to directory /etc/ld.so.conf.d and run:

    sudo ldconfig
    

    and install igc using:

    rpm -i --nodeps intel-igc-opencl-1.0.9-1.el7.x86_64.rpm
    
  11. jinz2014 commented on Jun 25, 2019

    @jinz2014
    Author

    Yes, they fixes the conflicts.

    These are the package installed:
    $ yum search intel-

    intel-cmt-cat.x86_64 : Provides command line interface to CMT, MBM, CAT and CDP
    : technologies
    intel-gmmlib.x86_64 : Intel(R) Graphics Memory Management Library Package
    intel-gmmlib-devel.x86_64 : Intel(R) Graphics Memory Management Library Package
    intel-gpu-tools.x86_64 : Debugging tools for Intel graphics chips
    intel-igc-core.x86_64 : IGC built using CMake
    intel-igc-media.x86_64 : IGC built using CMake
    intel-igc-opencl.x86_64 : IGC built using CMake
    intel-igc-opencl-devel.x86_64 : IGC built using CMake
    intel-ocloc.x86_64 : Intel OpenCL GPU driver
    intel-opencl.x86_64 : Intel OpenCL GPU driver
    libva-intel-hybrid-driver.x86_64 : VA driver for Intel G45 & HD Graphics family
    nasm.x86_64 : A portable x86 assembler which uses Intel-like syntax
    xorg-x11-drv-intel-devel.i686 : Xorg X11 Intel video driver development package
    xorg-x11-drv-intel-devel.x86_64 : Xorg X11 Intel video driver development
    : package

  12. JacekDanecki commented on Jun 26, 2019

    @JacekDanecki
    Contributor

    I saw you'd issue with clinfo. Have you added your user to video group, as described here?
    You can use strace command to check basic issues with configuration:

    strace -s 255 -f -o log.txt clinfo
    
  13. mprogram commented on Jul 30, 2019

    @mprogram

    I have just hit this bug, when followed the instructions from intel/intel-graphics-compiler#54 against system installed dependencies, which I managed to work around with two very helpful suggestions from the above. Thank you, Łukasz, aka @lwesiers:

    No, you don't need to rebuild the IGC. You should manually install the missing header.
    If you was building IGC with opencl-clang, then please follow this commands:

    cd <workspace-of-igc>
    sudo cp llvm_source/tools/clang/lib/Headers/opencl-c-base.h /usr/local/include
    

    I made a fix for this and soon it will be available on https://github.com/intel/intel-graphics-compiler

    I believe somebody may have a second look at why it could not have found opencl-c-base.h under the referenced scenario even after IGC was patched.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions