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

crash while compiling for the HIP backend #15562

Open
AuroraPerego opened this issue Sep 30, 2024 · 1 comment
Open

crash while compiling for the HIP backend #15562

AuroraPerego opened this issue Sep 30, 2024 · 1 comment
Labels
bug Something isn't working hip Issues related to execution on HIP backend.

Comments

@AuroraPerego
Copy link

Describe the bug

While compiling the tests of the alpaka library for the HIP backend, the compiler crashed with the following stacktrace:

 #0 0x00005564ac0ed4f3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x5f294f3)
 #1 0x00005564ac0ec2d0 llvm::sys::RunSignalHandlers() (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x5f282d0)
 #2 0x00005564ac0eda5b SignalHandler(int) Signals.cpp:0:0
 #3 0x00007ff86f187d20 __restore_rt (/lib64/libpthread.so.0+0x12d20)
 #4 0x00007ff86eded52f raise (/lib64/libc.so.6+0x4e52f)
 #5 0x00007ff86edc0e65 abort (/lib64/libc.so.6+0x21e65)
 #6 0x00007ff86ee2e727 __libc_message (/lib64/libc.so.6+0x8f727)
 #7 0x00007ff86eeeddb5 __fortify_fail_abort (/lib64/libc.so.6+0x14edb5)
 #8 0x00007ff86eeedd68 (/lib64/libc.so.6+0x14ed68)
 #9 0x00005564aaa010a7 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x483d0a7)
#10 0x00005564ab835ad1 llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalarizationOverhead(llvm::VectorType*, llvm::APInt const&, bool, bool, llvm::TargetTransformInfo::TargetCostKind) AMDGPUTargetMachine.cpp:0:0
#11 0x00005564ab835852 llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalarizationOverhead(llvm::VectorType*, bool, bool, llvm::TargetTransformInfo::TargetCostKind) AMDGPUTargetMachine.cpp:0:0
#12 0x00005564ab83637e llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getCommonMaskedMemoryOpCost(unsigned int, llvm::Type*, llvm::Align, bool, bool, llvm::TargetTransformInfo::TargetCostKind) AMDGPUTargetMachine.cpp:0:0
#13 0x00005564ab832aa7 llvm::TargetTransformInfo::Model<llvm::GCNTTIImpl>::getMaskedMemoryOpCost(unsigned int, llvm::Type*, llvm::Align, unsigned int, llvm::TargetTransformInfo::TargetCostKind) AMDGPUTargetMachine.cpp:0:0
#14 0x00005564a9f5ee9d llvm::vpo::VPlanTTICostModel::getLoadStoreCost(llvm::vpo::VPLoadStoreInst const*, llvm::Align, unsigned int, bool) const (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x3d9ae9d)
#15 0x00005564aa38db9d llvm::vpo::VPlanTTICostModel::getTTICostForVF(llvm::vpo::VPInstruction const*, unsigned int) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x41c9b9d)
#16 0x00005564aa38d9fc llvm::vpo::VPlanTTICostModel::getTTICost(llvm::vpo::VPInstruction const*) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x41c99fc)
#17 0x00005564a9f5d470 llvm::vpo::VPlanCostModelWithHeuristics<llvm::vpo::HeuristicsList<llvm::vpo::VPInstruction const>, llvm::vpo::HeuristicsList<llvm::vpo::VPBasicBlock const>, llvm::vpo::HeuristicsList<llvm::vpo::VPlanVector const, llvm::vpo::VPlanCostModelHeuristics::HeuristicSLP, llvm::vpo::VPlanCostModelHeuristics::HeuristicGatherScatter, llvm::vpo::VPlanCostModelHeuristics::HeuristicSpillFill, llvm::vpo::VPlanCostModelHeuristics::HeuristicPsadbw, llvm::vpo::VPlanCostModelHeuristics::HeuristicUnroll>>::getCostImpl(llvm::vpo::VPBasicBlock const*, llvm::raw_ostream*) Planner.cpp:0:0
#18 0x00005564aa389b86 llvm::vpo::VPInstructionCost llvm::vpo::VPlanCostModelWithHeuristics<llvm::vpo::HeuristicsList<llvm::vpo::VPInstruction const>, llvm::vpo::HeuristicsList<llvm::vpo::VPBasicBlock const>, llvm::vpo::HeuristicsList<llvm::vpo::VPlanVector const, llvm::vpo::VPlanCostModelHeuristics::HeuristicSLP, llvm::vpo::VPlanCostModelHeuristics::HeuristicGatherScatter, llvm::vpo::VPlanCostModelHeuristics::HeuristicSpillFill, llvm::vpo::VPlanCostModelHeuristics::HeuristicPsadbw, llvm::vpo::VPlanCostModelHeuristics::HeuristicUnroll>>::getRangeCost<llvm::iterator_range<llvm::vpo::sese_df_iterator<llvm::vpo::VPBasicBlock*>>>(llvm::iterator_range<llvm::vpo::sese_df_iterator<llvm::vpo::VPBasicBlock*>>, llvm::raw_ostream*) Planner.cpp:0:0
#19 0x00005564aa38ac4d llvm::vpo::VPlanCostModelWithHeuristics<llvm::vpo::HeuristicsList<llvm::vpo::VPInstruction const>, llvm::vpo::HeuristicsList<llvm::vpo::VPBasicBlock const>, llvm::vpo::HeuristicsList<llvm::vpo::VPlanVector const, llvm::vpo::VPlanCostModelHeuristics::HeuristicSLP, llvm::vpo::VPlanCostModelHeuristics::HeuristicGatherScatter, llvm::vpo::VPlanCostModelHeuristics::HeuristicSpillFill, llvm::vpo::VPlanCostModelHeuristics::HeuristicPsadbw, llvm::vpo::VPlanCostModelHeuristics::HeuristicUnroll>>::getCost(bool, llvm::vpo::VPlanPeelingVariant*, llvm::raw_ostream*) Planner.cpp:0:0
#20 0x00005564aac76971 llvm::vpo::LoopVectorizationPlanner::selectBestPlan() (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4ab2971)
#21 0x00005564aad33b4c llvm::vpo::DriverImpl::processLoop(llvm::PointerUnion<llvm::Loop*, llvm::loopopt::HLLoop*>, llvm::Function&, llvm::vpo::WRNVecLoopNode*) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4b6fb4c)
#22 0x00005564aa32c2c8 llvm::vpo::DriverImpl::runStandardMode(llvm::Function&) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x41682c8)
#23 0x00005564aa1d189b llvm::vpo::VPlanDriverHIRPass::runImpl(llvm::Function&, llvm::AnalysisManager<llvm::Function>&, llvm::loopopt::HIRFramework&) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x400d89b)
#24 0x00005564aa1d16c5 llvm::detail::PassModel<llvm::Function, llvm::vpo::VPlanDriverHIRPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) PassBuilder.cpp:0:0
#25 0x00005564aa3eaa85 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4226a85)
#26 0x00005564aa3ea7ed llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) X86CodeGenPassBuilder.cpp:0:0
#27 0x00005564aa3e7b4d llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4223b4d)
#28 0x00005564aa3e792d llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) X86CodeGenPassBuilder.cpp:0:0
#29 0x00005564aa3e3ffa llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x421fffa)
#30 0x00005564ab0f78e0 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>&, std::__1::unique_ptr<llvm::ToolOutputFile, std::__1::default_delete<llvm::ToolOutputFile>>&) BackendUtil.cpp:0:0
#31 0x00005564aa85d09f clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x469909f)
#32 0x00005564aa8e542a clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) CodeGenAction.cpp:0:0
#33 0x00005564aa1f4c0d clang::ParseAST(clang::Sema&, bool, bool) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4030c0d)
#34 0x00005564aaf54358 clang::CodeGenAction::ExecuteAction() (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4d90358)
#35 0x00005564aaf573ca clang::FrontendAction::Execute() (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4d933ca)
#36 0x00005564aaf56f10 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4d92f10)
#37 0x00005564ab05603e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4e9203e)
#38 0x00005564aade2e76 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4c1ee76)
#39 0x00005564ab05d2d5 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#40 0x00005564aade639a clang_main(int, char**, llvm::ToolContext const&) (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x4c2239a)
#41 0x00005564aaa618e5 main (/opt/intel/oneapi/compiler/2024.2/bin/compiler/clang+0x489d8e5)
#42 0x00007ff86edd97e5 __libc_start_main (/lib64/libc.so.6+0x3a7e5)
#43 0x00005564ab5d8e1a _start /localdisk2/test/toolchain-cross/src/glibc/csu/../sysdeps/x86_64/start.S:122:0
icpx: error: unable to execute command: Aborted (core dumped)
icpx: error: clang frontend command failed due to signal (use -v to see invocation)

To reproduce

  1. Include code snippet as short as possible
    I have created a single file that reproduces the problem and needs only boost as an external include: BlockSyncUnit.cpp
  2. Specify the command which should be used to compile the program
icpx -isystem /path/to/boost/include  -fsycl -fsycl-targets=amd_gpu_gfx90a  -frelaxed-template-template-args BlockSyncUnit.cpp -o BlockSyncUnit
  1. Indicate what is wrong and what was expected
    The command above crashes. The full stack trace and the files saved compiling with -save-temps -v are here:
    output.txt
    BlockSyncUnit-header-7dc52a.h
    BlockSyncUnit-footer-74bfbf.h
    BlockSyncUnit-sycl-amdgcn-amd-amdhsa-gfx90a.ii

Environment

  • OS: Linux
  • Target device and vendor: AMD GPU
  • DPC++ version:
    Intel(R) oneAPI DPC++/C++ Compiler 2024.2.1 (2024.2.1.20240711)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/intel/oneapi/compiler/2024.2/bin/compiler
    Configuration file: /opt/intel/oneapi/compiler/2024.2/bin/compiler/../icpx.cfg
    
  • Dependencies version:
    HIP version: 6.2.41133-dd7f95766
    AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.2.0 24292 26466ce804ac523b398608f17388eb6d605a3f09)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/rocm-6.2.0/lib/llvm/bin
    Configuration file: /opt/rocm-6.2.0/lib/llvm/bin/clang++.cfg
    


### Additional context

FYI @fwyzard @ivorobts
@AuroraPerego AuroraPerego added bug Something isn't working hip Issues related to execution on HIP backend. labels Sep 30, 2024
@npmiller
Copy link
Contributor

npmiller commented Oct 1, 2024

We've already ran into this issue, it's not present in the open-source and it will be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hip Issues related to execution on HIP backend.
Projects
None yet
Development

No branches or pull requests

2 participants