intel / intel-graphics-compiler

Other
605 stars 158 forks source link

Building on Fedora Fails when following instructions "build dependencies from source" #259

Closed alheinecke closed 1 year ago

alheinecke commented 2 years ago

I'm doing

mkdir build_igc && cd build_igc
git clone https://github.com/intel/vc-intrinsics vc-intrinsics
git clone -b llvmorg-11.1.0 https://github.com/llvm/llvm-project llvm-project
git clone -b ocl-open-110 https://github.com/intel/opencl-clang llvm-project/llvm/projects/opencl-clang
git clone -b llvm_release_110 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/llvm-spirv
git clone https://github.com/KhronosGroup/SPIRV-Tools.git SPIRV-Tools
git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Headers
git clone -b igc-1.0.12149.1 https://github.com/intel/intel-graphics-compiler igc
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/intel-gpu/igc/ ../igc
make -j`nproc`
make install
cd ../../

But it fails during cmake setup with:

-- [OPENCL-CLANG] source code direcotry: /swtools/intel-gpu-src/build_igc/build/IGC/llvm-deps/src/clang
-- [OPENCL-CLANG] Using SPIRV-LLVM-Translator source code directory: /swtools/intel-gpu-src/build_igc/build/IGC/llvm-deps/src/llvm/projects/llvm-spirv
-- [OPENCL-CLANG] Patching repository /swtools/intel-gpu-src/build_igc/build/IGC/llvm-deps/src
-- [OPENCL-CLANG] Validating release/11.x in repository
fatal: ambiguous argument 'release/11.x': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
-- [OPENCL-CLANG] ref release/11.x not exists in repository, using current HEAD:1fdec59bffc11ae37eb51a1b9869f0696bfd5312
-- [OPENCL-CLANG] Switched to a new branch 'ocl-open-110' which starts from ref : 1fdec59bffc11ae37eb51a1b9869f0696bfd5312
-- [OPENCL-CLANG] Checking if patch c75654c34bb8c5ba3877558ce7c7c94bf55d8f9f is present in repository
fatal: Not a valid commit name c75654c34bb8c5ba3877558ce7c7c94bf55d8f9f
-- [OPENCL-CLANG] Not present - Applying: OpenCL 3.0 support

-- [OPENCL-CLANG] Checking if patch c6d8168c10e50e64e378a5de3a9d6754f0033fa9 is present in repository
fatal: Not a valid commit name c6d8168c10e50e64e378a5de3a9d6754f0033fa9
-- [OPENCL-CLANG] Not present - Applying: Remove __IMAGE_SUPPORT__ macro for SPIR since SPIR doesn't require image support

-- [OPENCL-CLANG] Checking if patch 60854c328d8729b2ef10b9bb4dcbcc282f43c5e7 is present in repository
-- [OPENCL-CLANG] Not present - Applying: Avoid calling ParseCommandLineOptions in BackendUtil if possible

-- [OPENCL-CLANG] Checking if patch 03199b43a351be2bf34efdf9e02851f9c2319180 is present in repository
fatal: Not a valid commit name 03199b43a351be2bf34efdf9e02851f9c2319180
-- [OPENCL-CLANG] Not present - Applying: support cl_ext_float_atomics

-- [OPENCL-CLANG] Checking if patch b04769b380e1bd46710b103877cae35382ce153a is present in repository
fatal: Not a valid commit name b04769b380e1bd46710b103877cae35382ce153a
-- [OPENCL-CLANG] Not present - Applying: Add cl_khr_integer_dot_product

-- [OPENCL-CLANG] Checking if patch c86c43b70e029b102543e8a85d269cbeb5c00279 is present in repository
fatal: Not a valid commit name c86c43b70e029b102543e8a85d269cbeb5c00279
-- [OPENCL-CLANG] Not present - Applying: Memory leak fix for Managed Static Mutex

-- [OPENCL-CLANG] Checking if patch ff0a6da84b94c16c4519c649f1f7bed3cdf89bbb is present in repository
fatal: Not a valid commit name ff0a6da84b94c16c4519c649f1f7bed3cdf89bbb
-- [OPENCL-CLANG] Not present - Applying: Remove repo name in LLVM IR

-- [OPENCL-CLANG] Checking if patch 3b6c7f2ea3ff7509769e4567ca242d0e993d425f is present in repository
fatal: Not a valid commit name 3b6c7f2ea3ff7509769e4567ca242d0e993d425f
-- [OPENCL-CLANG] Not present - Applying: Add missing include limit in benchmark

-- [OPENCL-CLANG] Patching repository /swtools/intel-gpu-src/build_igc/build/IGC/llvm-deps/src/llvm/projects/llvm-spirv
-- [OPENCL-CLANG] Validating llvm_release_110 in repository
-- [OPENCL-CLANG] Switched to a new branch 'ocl-open-110' which starts from ref : llvm_release_110
-- [OPENCL-CLANG] Checking if patch 246d76d6244c94870da16288864be4e7b36578ed is present in repository
fatal: Not a valid commit name 246d76d6244c94870da16288864be4e7b36578ed
-- [OPENCL-CLANG] Not present - Applying: update SPIR-V headers for SPV_INTEL_split_barrier

-- [OPENCL-CLANG] Checking if patch 5bd7212589d21e3866d2f92229b7c9d909284b76 is present in repository
fatal: Not a valid commit name 5bd7212589d21e3866d2f92229b7c9d909284b76
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
-- [OPENCL-CLANG] Not present - Applying: Add support for split barriers extension SPV_INTEL_split_barrier
Using index info to reconstruct a base tree...
M       include/LLVMSPIRVExtensions.inc
M       lib/SPIRV/OCLToSPIRV.cpp
M       lib/SPIRV/OCLUtil.cpp
M       lib/SPIRV/OCLUtil.h
M       lib/SPIRV/SPIRVReader.cpp
M       lib/SPIRV/SPIRVToOCL.cpp
M       lib/SPIRV/SPIRVToOCL.h
M       lib/SPIRV/SPIRVToOCL12.cpp
M       lib/SPIRV/SPIRVToOCL20.cpp
M       lib/SPIRV/libSPIRV/SPIRVInstruction.h
M       lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
M       lib/SPIRV/libSPIRV/SPIRVOpCode.h
M       lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h
Falling back to patching base and 3-way merge...
Auto-merging lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h
CONFLICT (content): Merge conflict in lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h
Auto-merging lib/SPIRV/libSPIRV/SPIRVOpCode.h
Auto-merging lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
Auto-merging lib/SPIRV/libSPIRV/SPIRVInstruction.h
CONFLICT (content): Merge conflict in lib/SPIRV/libSPIRV/SPIRVInstruction.h
Auto-merging lib/SPIRV/SPIRVToOCL20.cpp
Auto-merging lib/SPIRV/SPIRVToOCL12.cpp
Auto-merging lib/SPIRV/SPIRVToOCL.h
Auto-merging lib/SPIRV/SPIRVToOCL.cpp
Auto-merging lib/SPIRV/SPIRVReader.cpp
CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVReader.cpp
Auto-merging lib/SPIRV/OCLUtil.h
Auto-merging lib/SPIRV/OCLUtil.cpp
Auto-merging lib/SPIRV/OCLToSPIRV.cpp
Auto-merging include/LLVMSPIRVExtensions.inc
CONFLICT (content): Merge conflict in include/LLVMSPIRVExtensions.inc
Patch failed at 0001 Add support for split barriers extension SPV_INTEL_split_barrier
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

CMake Error at /swtools/intel-gpu-src/build_igc/build/IGC/llvm-deps/src/llvm/projects/opencl-clang/cmake/modules/CMakeFunctions.cmake:163 (message):
  [OPENCL-CLANG] Failed to apply patch!
Call Stack (most recent call first):
  /swtools/intel-gpu-src/build_igc/build/IGC/llvm-deps/src/llvm/projects/opencl-clang/CMakeLists.txt:161 (apply_patches)
mnaczk commented 2 years ago

Thanks for your submission The issue is caused by an outdated spirv patch in OpenCL-clang: https://github.com/intel/opencl-clang/blob/ocl-open-110/patches/spirv/0002-Add-support-for-split-barriers-extension-SPV_INTEL_s.patch We are currently working on deleting it.

I will let you know when this is completed.

alheinecke commented 2 years ago

Great, Many thanks!

mnaczk commented 2 years ago

The patches which caused errors were removed with commit https://github.com/intel/opencl-clang/commit/83dc927a5997a2a8ba6ad55d84cbf78f76b300f8 @alheinecke Could you check if the problem is resolved, and if so please close the issue.

mnaczk commented 1 year ago

The issue is fixed with the commit https://github.com/intel/opencl-clang/commit/83dc927a5997a2a8ba6ad55d84cbf78f76b300f8 I close the issue.