intel / intel-graphics-compiler

Other
606 stars 158 forks source link

Build failure both with system LLVM v12, and GCC v11 #228

Closed eero-t closed 2 years ago

eero-t commented 2 years ago

Setup / dependencies

Ubuntu 21.10 (container) packages:

Git builds of following source versions:

Build options

-DCMAKE_BUILD_TYPE=Release -DIGC_OPTIONLLVM_PREFERRED_VERSION=12 -DIGC_OPTION__SPIRV_TRANSLATOR_MODE=Source -DIGC_OPTIONLINK_KHRONOS_SPIRV_TRANSLATOR=ON

Build failures

First build failure:

-- [lld] No mode was specified, searching for lld
CMake Error at external/llvm/llvm_deps.cmake:50 (file):
  file COPY cannot find
  "/home/nobody/source/intel-graphics-compiler/IGC/DEFAULT_IGC_LLVM_SOURCES_DIR-NOTFOUND/libunwind/include/mach-o/compact_unwind_encoding.h":
  No such file or directory.

is due to change added by commit 661333ec59b6ecd944924c1e2dc270ee75ef07c1 to external/llvm/llvm_deps.cmake which breaks build when system LLVM is used (i.e. there's no path to LLVM sources). Reverting that change fixes the issue.

Note: I'm actually more interested about LLVM v13 support, but because the tests are not passing with it yet (according to IGC status page), I tried using v12 instead. Above issue is relevant for both though.

Next build failure:

visa/LocalScheduler/SWSB_G4IR.cpp: In member function 'vISA::SBNode* vISA::SWSB::reuseTokenSelection(const vISA::SBNode*) const':
visa/LocalScheduler/SWSB_G4IR.cpp:1459:34: error: 'numeric_limits' is not a member of 'std'
 1459 |         int maxTokenDelay = std::numeric_limits<int>::min(); //The delay may cause if reuse
      |                                  ^~~~~~~~~~~~~~
visa/LocalScheduler/SWSB_G4IR.cpp:1459:49: error: expected primary-expression before 'int'
 1459 |         int maxTokenDelay = std::numeric_limits<int>::min(); //The delay may cause if reuse
      |                                                 ^~~
visa/LocalScheduler/SWSB_G4IR.cpp:1460:37: error: 'numeric_limits' is not a member of 'std'
 1460 |         int minTokenDistance = std::numeric_limits<int>::max(); //The distance from the reused node
      |                                     ^~~~~~~~~~~~~~
visa/LocalScheduler/SWSB_G4IR.cpp:1460:52: error: expected primary-expression before 'int'
 1460 |         int minTokenDistance = std::numeric_limits<int>::max(); //The distance from the reused node
      |                                                    ^~~
eero-t commented 2 years ago

Same issue happens also when using older (2021) "igc-1.0.9636" release.

eero-t commented 2 years ago

Is "SWSB_G4IR.cpp" code built with LLVM or GCC?

The GCC version 11.2 in my Ubuntu 21.10 build container is the same one that will be in next Ubuntu 22.04 LTS release: https://packages.ubuntu.com/jammy/gcc

eero-t commented 2 years ago

Is "SWSB_G4IR.cpp" code built with LLVM or GCC?

The GCC version 11.2 in my Ubuntu 21.10 build container is the same one that will be in next Ubuntu 22.04 LTS release: https://packages.ubuntu.com/jammy/gcc

That build breakage is due to change in GCC v11 requiring C++ code to actually include the headers for the functions they use: https://www.gnu.org/software/gcc/gcc-11/porting_to.html#header-dep-changes

Fix is trivial, add following line to visa/LocalScheduler/SWSB_G4IR.cpp: #include <limits>

After that fix, and dropping the failing part of 661333ec59b6ecd944924c1e2dc270ee75ef07c1 commit, IGC builds.

PS. The latest "igc-1.0.10200" IGC release still contains both of these bugs.

eero-t commented 2 years ago

To me this looks like your CI is missing testing for:

When you'll fix the listed build errors, you could also look into improving your CI testing coverage in this respect (distro coverage needs occasional CI updates, external dep testing hopefully not).

mnaczk commented 2 years ago

Thanks for your feedback. We upgrade our open-source CI infrastructure. List of changes bellow:

Link to first upgraded build: https://github.com/intel/intel-graphics-compiler/actions/runs/1883449664

Please let me know if the issue you presented has been addressed.

eero-t commented 2 years ago

Please let me know if the issue you presented has been addressed.

Commit 4369c97 looks OK [1], but missed the new "igc-1.0.10395" IGC release. With the CI updates, it should fine, so I'll wait until (next) release containing the fix, before testing and closing this.

[1] "visa/LocalScheduler/SWSB_G4IR.cpp" issue that I was seeing, was fixed in earlier 4f510460 commit, so I wonder why I did not bump into limits header missing also from "visa/iga/IGALibrary/IR/SWSBSetter.hpp" fixed in 4369c97 (maybe that issue was introduced only in the "igc-1.0.10395" release?)

eero-t commented 2 years ago

maybe that issue was introduced only in the "igc-1.0.10395" release?

I tried building that IGC release, and yes, that issue was added there.

ArchangeGabriel commented 2 years ago

@eero-t Both of your issues have had PR for ages: https://github.com/intel/intel-graphics-compiler/pull/210 and https://github.com/intel/intel-graphics-compiler/pull/220. The second one is now merged as you have seen. Please confirm the first one fix your other issue.

ArchangeGabriel commented 2 years ago

Actually I realize that #210 is part of https://github.com/intel/intel-graphics-compiler/commit/4369c970d4e02258b3c53e854faaa34197124a33.

eero-t commented 2 years ago

Verified that the latest release contains the fixes => Closing.