intel / intel-graphics-compiler

Other
592 stars 154 forks source link

Exposed LLVM symbols #284

Closed Naghasan closed 6 months ago

Naghasan commented 1 year ago

Not sure this is the right place for this issue.

We enabled a kernel fusion extension in SYCL (intel/llvm), and for that purpose we have to pull some LLVM libraries in libsycl.so. By doing so, we started to see failure with the Intel GPU driver https://github.com/intel/llvm/pull/7831#issuecomment-1373236070.

It seems that the libraries don't isolate themselves from the users causing the user LLVM symbols to be picked up rather than the one it is shipped with.

We internalized the symbols on our side and that solved the issue. However, a build with shared libraries of the project no longer works with this driver and I assume any application using LLVM and this driver would face similar issues.

mnaczk commented 1 year ago

Thank you, @Naghasan, for raising the issue. Would it be possible for you to create a reproducible example where an application that utilizes LLVM encounters conflicts when operating with our driver?

chengjunlu commented 1 year ago

We met the same issue in Triton.

kurapov-peter commented 1 year ago

Hi! We encounter a similar issue from time to time while building a library that has LLVM as its dependency and submits kernels to IGC via level zero.

Naghasan commented 1 year ago

Hi @mnaczk, sorry for some reason I missed the notification.

With tip intel/llvm, you should be able to reproduce via this setup (sorry, that's going to be a bit long to build)

$ python3 <path to intel/llvm>/buildbot/configure.py --cmake-opt="-DSYCL_TEST_E2E_TARGETS=level_zero:gpu;opencl:gpu" -s <path to intel/llvm> -o <path to build folder> -t Release --shared-libs
$ cd <path to build folder>
$ ninja sycl-toolchain
$ llvm-lit <path to build folder>/tools/sycl/test-e2e/ -a --param sycl_be=opencl --param target_devices=gpu --filter KernelFusion

You should see failure when build with --shared-libs, but should pass if you don't provide the flag (if you want to build both consider adding --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=ccache" --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache" to the config script).

If the lit command doesn't work, you could simply try this (much longer though as it runs every tests...)

$ ninja check-sycl-e2e
etiotto commented 7 months ago

This issue is unassigned and has been exposed by various project which rely on IGC. Is there any way a fix can be prioritized ?

pszymich commented 6 months ago

Hi, fixed in https://github.com/intel/intel-graphics-compiler/commit/cf0dd6b8c8933d965da6b44c6cdff797d902e890 Thanks @MichalMroz12 for the fix!

sommerlukas commented 4 months ago

@pszymich Has this change landed in releases?

It seems that the changed from cf0dd6b8c8933d965da6b44c6cdff797d902e890 were reverted in ee6f20afb8ccfc7b0aa76a9190eac022dfdd6f36 again.

Also, nm on libigc from version 1.0.16510.2 still seems to show quite a lot of LLVM symbols being exported.

pjaaskel commented 1 month ago

I also encounter a somehow related issue which I reported to the Compute Runtime as it can be seen as a build issue https://github.com/intel/compute-runtime/issues/747.

pszymich commented 1 month ago

The patch has been reverted few times, we've since committed a final version of it in this commit: https://github.com/intel/intel-graphics-compiler/commit/d4ba7fbd5f9714aab00da032aafa33ec94480e66 This one has finished testing and won't be reverted. Its internal build version is 17325, thus it will be available in a future release >= 1.0.17325.