rusticl: clinfo aborts with "LLVM ERROR: Broken module found, compilation aborted!"
When trying to execute clinfo
, it starts printing some data, but at some point, it fails and aborts ...
Trying this on gentoo on amd64.
RUSTICL_ENABLE=llvmpipe gdb clinfo
(also tried iris
, same result).
Platform Name rusticl
Number of devices 1
Device Name llvmpipe (LLVM 16.0.5, 256 bits)
Device Vendor Mesa
Device Vendor ID 0
Device Version OpenCL 3.0
Device Numeric Version 0xc00000 (3.0.0)
Driver Version 23.1.3
Device OpenCL C Version OpenCL C 1.2
Device OpenCL C all versions OpenCL C 0xc00000 (3.0.0)
OpenCL C 0x402000 (1.2.0)
OpenCL C 0x401000 (1.1.0)
OpenCL C 0x400000 (1.0.0)
Device OpenCL C features __opencl_c_int64 0x400000 (1.0.0)
__opencl_c_images 0x400000 (1.0.0)
__opencl_c_3d_image_writes 0x400000 (1.0.0)
Latest conformance test passed v0000-01-01-00
Device Type CPU
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Linker Available Yes
Max compute units 8
Max clock frequency 300MHz
Device Partition (core)
Max number of sub-devices 0
Supported partition types None
Supported affinity domains (n/a)
Max work item dimensions 3
Max work item sizes 1024x1024x1024
Max work group size 1024
Preferred work group size multiple (device) 32
[New Thread 0x7fff51ffb6c0 (LWP 4939)]
Attribute does not match Module context!
memory(none)
%call = call spir_func i64 @_Z13get_global_idj(i32 noundef 0) #2
Attribute does not match Module context!
memory(none)
i64 (i32)* @_Z13get_global_idj
LLVM ERROR: Broken module found, compilation aborted!
Thread 1 "clinfo" received signal SIGABRT, Aborted.
0x00007ffff7e5a88c in __pthread_kill_implementation () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff7e5a88c in __pthread_kill_implementation () from /lib64/libc.so.6
#1 0x00007ffff7e0c6d2 in raise () from /lib64/libc.so.6
#2 0x00007ffff7df64b2 in abort () from /lib64/libc.so.6
#3 0x00007fffd9579906 in llvm::report_fatal_error(llvm::Twine const&, bool) [clone .cold] ()
from /usr/lib/llvm/16/lib64/libLLVM-16.so
#4 0x00007fffd98d66aa in llvm::report_fatal_error(char const*, bool) ()
from /usr/lib/llvm/16/lib64/libLLVM-16.so
#5 0x00007fffd9b5536e in llvm::VerifierPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) () from /usr/lib/llvm/16/lib64/libLLVM-16.so
#6 0x00007fffdb1e6131 in llvm::detail::PassModel<llvm::Module, llvm::VerifierPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) () from /usr/lib/llvm/16/lib64/libLLVM-16.so
#7 0x00007fffd9b26a2c in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) ()
from /usr/lib/llvm/16/lib64/libLLVM-16.so
#8 0x00007fffd6930c62 in (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile> >&) () from /usr/lib/llvm/16/lib64/libclang-cpp.so.16
#9 0x00007fffd6933e65 in clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) ()
from /usr/lib/llvm/16/lib64/libclang-cpp.so.16
#10 0x00007fffd6d127dc in clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
from /usr/lib/llvm/16/lib64/libclang-cpp.so.16
#11 0x00007fffd589f695 in clang::ParseAST(clang::Sema&, bool, bool) ()
from /usr/lib/llvm/16/lib64/libclang-cpp.so.16
#12 0x00007fffd75311a9 in clang::FrontendAction::Execute() ()
from /usr/lib/llvm/16/lib64/libclang-cpp.so.16
#13 0x00007fffd74c703a in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
from /usr/lib/llvm/16/lib64/libclang-cpp.so.16
#14 0x00007fffe0bbb8ff in clc_compile_to_llvm_module(llvm::LLVMContext&, clc_compile_args const*, clc_logger const*) () from /usr/lib64/libRusticlOpenCL.so.1
#15 0x00007fffe0bbcc1a in clc_c_to_spirv () from /usr/lib64/libRusticlOpenCL.so.1
#16 0x00007fffe0bb2219 in clc_compile_c_to_spirv () from /usr/lib64/libRusticlOpenCL.so.1
#17 0x00007fffe0a3712b in mesa_rust::compiler::clc::spirv::SPIRVBin::from_clc::hd53035f10c0be2e0 () from /usr/lib64/libRusticlOpenCL.so.1
#18 0x00007fffe099bfcc in rusticl::core::program::Program::do_compile::h622878f7cd47dd9f ()
from /usr/lib64/libRusticlOpenCL.so.1
#19 0x00007fffe099b7d6 in rusticl::core::program::Program::build::h182fe819ba9dac9f ()
from /usr/lib64/libRusticlOpenCL.so.1
#20 0x00007fffe0a0c738 in rusticl::api::program::build_program::hfc75d1f9a2e7ce82 ()
from /usr/lib64/libRusticlOpenCL.so.1
#21 0x00007fffe0974639 in rusticl::api::icd::cl_build_program::hd6b15614e44354b2 ()
from /usr/lib64/libRusticlOpenCL.so.1
#22 0x0000555555566e90 in getWGsizes ()
--Type <RET> for more, q to quit, c to continue without paging--
#23 0x0000555555567310 in device_info_wg ()
#24 0x0000555555569537 in printDeviceInfo ()
#25 0x000055555556a59a in printPlatformDevices ()
#26 0x000055555556a9ed in showDevices ()
#27 0x000055555555d7f0 in main ()