CLArrays.jl
CLArrays.jl copied to clipboard
'using CLArrays' fails with segfault
Platform Ubuntu 16.04 Julia 0.6.2
julia> using CLArrays INFO: Precompiling module CLArrays.
signal (11): Segmentation fault while loading /home/phil/.julia/v0.6/CLArrays/src/3rdparty.jl, in expression starting on line 72 _ZN4llvm2cl16AddLiteralOptionERNS0_6OptionEPKc at /home/phil/build/julia/usr/bin/../lib/libLLVM-3.9.so (unknown line) _ZN4llvm12PassRegistry13enumerateWithEPNS_24PassRegistrationListenerE at /usr/lib/x86_64-linux-gnu/libLLVM-3.6.so.1 (unknown line) unknown function (ip: 0x7fa39522c715) unknown function (ip: 0x7fa3b8e286b9) unknown function (ip: 0x7fa3b8e287ca) unknown function (ip: 0x7fa3b8e2d8e1) unknown function (ip: 0x7fa3b8e28563) unknown function (ip: 0x7fa3b8e2cda8) dlopen_doit at /build/glibc-bfm8X4/glibc-2.23/dlfcn/dlopen.c:66 unknown function (ip: 0x7fa3b8e28563) ... main at /home/phil/build/julia/ui/repl.c:264 __libc_start_main at /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291 unknown function (ip: 0x401668) Allocations: 5611578 (Pool: 5610154; Big: 1424); GC: 10 ERROR: Failed to precompile CLArrays to /home/phil/.julia/lib/v0.6/CLArrays.ji. Stacktrace: [1] compilecache(::String) at ./loading.jl:710 [2] _require(::Symbol) at ./loading.jl:497 [3] require(::Symbol) at ./loading.jl:405
I suspect this is some sort of mismatch between the version of a shared lib installed on the system vs what CLArrays is expecting.
This should be related to https://github.com/JuliaGPU/OpenCL.jl/issues/137 in one way or the other!
https://github.com/JuliaLang/julia/pull/24890
Hm, I can't find the correct instructions + issues anymore. But I think compiling julia to statically link LLVM should fix this!
Would that be adding the following to the Make.user?
USE_SYSTEM_LLVM = 0 USE_LLVM_SHLIB = 0
I think it was USE_LLVM_SHLIB = 1. I'm surprised i can't find that issue :( I'm not at my pc right now, but maybe you have more luck googling for it!
ah no, you're right... this is the issue i had in mind: https://github.com/JuliaGL/GLFW.jl/issues/96#comment-265580404
Tried rebuilding julia with those options in the Make.user and oddly enough I'm able to use CLArrays even though prior to that I had tried: Pkg.test("OpenCL") and that segfaulted. But 'using CLArrays' no longer segfaults.
When I ran the package test, though, it failed:
julia> Pkg.test("CLArrays") INFO: Testing CLArrays ASSERTION FAILED: isScalarType(type) at file /build/beignet-5qGeBM/beignet-1.1.1/backend/src/llvm/llvm_gen_backend.cpp, function gbe::ir::Type gbe::getType(gbe::ir::Context&, const llvm::Type*), line 117 ==============================[ ERROR: CLArrays ]===============================
failed process: Process(
/home/phil/build/julia/usr/bin/julia -Cnative -J/home/phil/build/julia/usr/lib/julia/sys.so --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=yes --compilecache=yes /home/phil/.julia/v0.6/CLArrays/test/runtests.jl, ProcessSignaled(5)) [0]================================================================================ ERROR: CLArrays had test errors
thats a pretty weird error, and likely related to beignet! did you try the fix in the first issue i linked? @ssfrr was building beignet from source to fix an issue!
i know that quite a lot has happened for beignet lately and intel is trying to make it their official opencl implementation - maybe their version has a fix for it! or maybe you're using it already and it is the problem ;) not sure, i had quite a few problems with setting up beignet on linux!
"Oh, the yaks you will shave!" Dr. Suess book for programmers. :)
Running into a lot of problems building beignet - what did you have to do to get it to build? It's complained about not being able to find OCL_ICD headers (even though ocl-icd-dev is installed on my system), so I disabled ICD support. Now it's complaining about CLANG_LIB being set to NOTFOUND - not sure why that is, seems like the old configure script way of doing things would find that for you.
I don't have any ideas other than the process that worked for me. Maybe double-check that the generated cmake config is looking at the right versions of clang and llvm? (use ccmake to inspect and modify the configuration)
@ssfrr How do you tell cmake to use clang-3.9? I'm finding that after running cmake as you suggest above that when I look in the CMakeCache.txt file that clang-3.6 is being used.