Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eero-t opened this issue Feb 4, 2022 · 10 comments
Closed

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

eero-t opened this issue Feb 4, 2022 · 10 comments
Assignees

Comments

@eero-t
Copy link

eero-t commented Feb 4, 2022

Setup / dependencies

Ubuntu 21.10 (container) packages:

  • gcc g++ libc-dev flex bison pkg-config make cmake ninja-build libz-dev clang-12 llvm-12-dev liblld-12-dev libopencl-clang-dev
  • GCC = v11.2.0

Git builds of following source versions:

  • GMMlib: "intel-gmmlib-22.0.2" (latest tag)
  • SPIRV-Tools: "sdk-1.3.204.0" (latest tag)
  • SPIRV-Headers: "sdk-1.3.204.0" (latest tag)
  • SPIRV-LLVM-Translator: "llvm_release_120" (branch HEAD)
  • vc-intrinsics: "main" (branch HEAD)
    • Because that project is still missing tags and releases despite complaints from multiple distro maintainers
  • IGC: "igc-1.0.10200" (latest release), and several older ones

Build options

-DCMAKE_BUILD_TYPE=Release
-DIGC_OPTION__LLVM_PREFERRED_VERSION=12
-DIGC_OPTION__SPIRV_TRANSLATOR_MODE=Source
-DIGC_OPTION__LINK_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 661333e 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
Copy link
Author

eero-t commented Feb 8, 2022

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

@eero-t eero-t changed the title Build failures with (system) LLVM v12 Build failures with (system) LLVM v12 / GCC v11.2 Feb 8, 2022
@eero-t
Copy link
Author

eero-t commented Feb 8, 2022

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
Copy link
Author

eero-t commented Feb 21, 2022

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 661333e commit, IGC builds.

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

@eero-t eero-t changed the title Build failures with (system) LLVM v12 / GCC v11.2 Build failure both with system LLVM v12, and GCC v11 Feb 21, 2022
@eero-t
Copy link
Author

eero-t commented Feb 21, 2022

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

  • compilers in the latest distro releases (at least ones becoming next LTS), and
  • using external dependencies

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
Copy link
Contributor

mnaczk commented Feb 23, 2022

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

  • Add IGC build by gcc with LLVM 12 on Ubuntu20.04
  • Add IGC build by gcc with LLVM 12 on Ubuntu22.04
  • Add IGC build by gcc with LLVM 13 on Ubuntu22.04
  • Add IGC build by clang with LLVM 12 on Ubuntu20.04
  • Remove IGC build by clang with LLVM 10 on Ubuntu18.04
  • Remove IGC build by clang with LLVM 11 on Ubuntu18.04
  • Fix build IGC with LLVM 12 with prebuild by change in CMake
  • Fix build IGC on Ubuntu 22.04 by adding missing include

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
Copy link
Author

eero-t commented Feb 23, 2022

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 4f51046 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
Copy link
Author

eero-t commented Feb 25, 2022

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
Copy link
Contributor

@eero-t Both of your issues have had PR for ages: #210 and #220. The second one is now merged as you have seen. Please confirm the first one fix your other issue.

@ArchangeGabriel
Copy link
Contributor

Actually I realize that #210 is part of 4369c97.

@eero-t
Copy link
Author

eero-t commented Mar 29, 2022

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

@eero-t eero-t closed this as completed Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants