ArrayFire.jl
ArrayFire.jl copied to clipboard
ReadOnlyMemoryError() on ccall
Hello. After installing ArrayFire I'm facing ReadOnlyMemoryError() when I try to call AFInfo() or any other ArrayFire function interfacing with device (openCL backend on AMD card).
ERROR: ReadOnlyMemoryError()
in af_info() at /home/morodeer/.julia/v0.5/ArrayFire/src/wrap.jl:1192
in AFInfo() at /home/morodeer/.julia/v0.5/ArrayFire/src/utils.jl:116
where wrap.jl:1192 is
err = ccall((:af_info, af_lib), Cint, () )
If I exit julia after that it tells me the following:
signal (11): Ошибка сегментирования
while loading no file, in expression starting on line 0
unknown function (ip: 0x7f2e017be539)
_ZN4llvm2cl19generic_parser_base10findOptionEPKc at /home/morodeer/Загрузки/julia-3c9d75391c/bin/../lib/julia/libLLVM-3.7.1.so (unknown line)
unknown function (ip: 0x7f2e00c2e2ec)
_ZN4llvm19MachinePassRegistry6RemoveEPNS_23MachinePassRegistryNodeE at /usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1 (unknown line)
__run_exit_handlers at /build/glibc-jxM2Ev/glibc-2.24/stdlib/exit.c:83
exit at /build/glibc-jxM2Ev/glibc-2.24/stdlib/exit.c:105
jl_exit at /home/centos/buildbot/slave/package_tarball64/build/src/jl_uv.c:551
exit at ./initdefs.jl:22
unknown function (ip: 0x7f2dfcbb6a48)
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1942
do_call at /home/centos/buildbot/slave/package_tarball64/build/src/interpreter.c:66
eval at /home/centos/buildbot/slave/package_tarball64/build/src/interpreter.c:190
jl_toplevel_eval_flex at /home/centos/buildbot/slave/package_tarball64/build/src/toplevel.c:558 [inlined]
jl_toplevel_eval at /home/centos/buildbot/slave/package_tarball64/build/src/toplevel.c:580
jl_toplevel_eval_in_warn at /home/centos/buildbot/slave/package_tarball64/build/src/builtins.c:590
eval at ./boot.jl:234
unknown function (ip: 0x7f2dfc9b54df)
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1942
eval_user_input at ./REPL.jl:64
unknown function (ip: 0x7f2bec4e30e6)
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1942
macro expansion at ./REPL.jl:95 [inlined]
#3 at ./event.jl:68
unknown function (ip: 0x7f2bec4dbf2f)
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1942
jl_apply at /home/centos/buildbot/slave/package_tarball64/build/src/julia.h:1392 [inlined]
start_task at /home/centos/buildbot/slave/package_tarball64/build/src/task.c:253
unknown function (ip: 0xffffffffffffffff)
Allocations: 1754492 (Pool: 1753569; Big: 923); GC: 0
Ошибка сегментирования (сделан дамп памяти)
Launching julia from gdb gives following:
julia> using ArrayFire
INFO: Recompiling stale cache file /home/morodeer/.julia/lib/v0.5/Compat.ji for module Compat.
julia> AFInfo()
[New Thread 0x7ffdd7d06700 (LWP 29549)]
[New Thread 0x7ffdd7505700 (LWP 29550)]
[New Thread 0x7ffdd2d04700 (LWP 29551)]
Thread 1 "julia" received signal SIGSEGV, Segmentation fault.
0x00007ffdc45abef8 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1
(gdb) where
#0 0x00007ffdc45abef8 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1
#1 0x00007ffff7de87ca in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffe028, env=env@entry=0x21c49b0) at dl-init.c:72
#2 0x00007ffff7de88db in call_init (env=0x21c49b0, argv=0x7fffffffe028, argc=1, l=<optimized out>) at dl-init.c:30
#3 _dl_init (main_map=main_map@entry=0x2de42e0, argc=1, argv=0x7fffffffe028, env=0x21c49b0) at dl-init.c:120
#4 0x00007ffff7ded866 in dl_open_worker (a=a@entry=0x7fffffffc160) at dl-open.c:575
#5 0x00007ffff7de8674 in _dl_catch_error (objname=objname@entry=0x7fffffffc150, errstring=errstring@entry=0x7fffffffc158,
mallocedp=mallocedp@entry=0x7fffffffc14f, operate=operate@entry=0x7ffff7ded510 <dl_open_worker>, args=args@entry=0x7fffffffc160) at dl-error.c:187
#6 0x00007ffff7dece49 in _dl_open (file=0x2cf7f10 "libMesaOpenCL.so.1", mode=-2147483647, caller_dlopen=0x7ffdcc5ab2fb, nsid=-2, argc=<optimized out>,
argv=<optimized out>, env=0x21c49b0) at dl-open.c:660
#7 0x00007ffff75d1ee9 in dlopen_doit (a=a@entry=0x7fffffffc390) at dlopen.c:66
#8 0x00007ffff7de8674 in _dl_catch_error (objname=0x6253c0, errstring=0x6253c8, mallocedp=0x6253b8, operate=0x7ffff75d1e90 <dlopen_doit>,
args=0x7fffffffc390) at dl-error.c:187
#9 0x00007ffff75d2571 in _dlerror_run (operate=operate@entry=0x7ffff75d1e90 <dlopen_doit>, args=args@entry=0x7fffffffc390) at dlerror.c:163
#10 0x00007ffff75d1f82 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#11 0x00007ffdcc5ab2fb in ?? () from /usr/lib/x86_64-linux-gnu/libOpenCL.so.1
#12 0x00007ffdcc5ab459 in ?? () from /usr/lib/x86_64-linux-gnu/libOpenCL.so.1
#13 0x00007ffdcc5ab9e5 in ?? () from /usr/lib/x86_64-linux-gnu/libOpenCL.so.1
#14 0x00007ffdcc5ac263 in clGetPlatformIDs () from /usr/lib/x86_64-linux-gnu/libOpenCL.so.1
#15 0x00007ffdcd1eb484 in opencl::DeviceManager::DeviceManager() () from /usr/local/lib/libafopencl.so.3
#16 0x00007ffdcd1f15c2 in opencl::getDeviceInfo[abi:cxx11]() () from /usr/local/lib/libafopencl.so.3
#17 0x00007ffdcd9c6213 in af_info () from /usr/local/lib/libafopencl.so.3
#18 0x00007ffddf51fe10 in af_err unified::AFSymbolManager::call<>(char const*) () from /usr/local/lib/libaf.so
#19 0x00007ffddfc39eb0 in ?? ()
#20 0x00007fffffffcfc0 in ?? ()
#21 0x00007ffddfc39ce0 in ?? ()
#22 0x00007fffffffcfd0 in ?? ()
#23 0x00007ffddfc39d00 in ?? ()
#24 0x00007fffffffd070 in ?? ()
#25 0x00007ffff78116b0 in jl_call_method_internal (nargs=1, args=0x7fffffffd090, meth=0x7ffdf4298c70)
at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:210
#26 jl_apply_generic (args=0x7fffffffd090, nargs=<optimized out>) at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1950
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
versions:
julia> versioninfo()
Julia Version 0.5.1
Commit 6445c82 (2017-03-05 13:25 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
julia> ArrayFire.getVersionNumber()
(3,5,0)
Tested both on 0.5.0 and 0.5.1
I should add that today I've met similar error in OpenCL package.
ERROR: ReadOnlyMemoryError()
in clGetPlatformIDs(::Int64, ::Ptr{Void}, ::Base.RefValue{UInt32}) at /home/morodeer/.julia/v0.5/OpenCL/src/api.jl:17
in macro expansion at /home/morodeer/.julia/v0.5/OpenCL/src/macros.jl:4 [inlined]
in platforms() at /home/morodeer/.julia/v0.5/OpenCL/src/platform.jl:21
in create_some_context() at /home/morodeer/.julia/v0.5/OpenCL/src/context.jl:235
in create_compute_context() at /home/morodeer/.julia/v0.5/OpenCL/src/util.jl:2
Looks like there are some problems with accessing device. Any ideas how to debug that?
@prodoelmit could you tell me how you installed the c++ library on your system? Did you build it from source?
@prodoelmit I am having the exact same ReadOnlyMemoryError() with OpenCL.jl, I opened an issue there but we still don't know what is the cause: https://github.com/JuliaGPU/OpenCL.jl/issues/137
@ranjanan I compiled Julia v0.6 (release-0.6 branch), do you know what may be causing this? I am fighting with this for days already and couldn't solve it.
Probably https://github.com/JuliaLang/julia/issues/19606