ArrayFire.jl icon indicating copy to clipboard operation
ArrayFire.jl copied to clipboard

Segmentation Fault

Open mouryarahul opened this issue 6 years ago • 8 comments

Hi Though I do not get issues while using ArrayFire, but I always get Segmentation Fault while exiting from Julia after using ArrayFire. Please see the screen capture below:

JuliaShot

Any workaround to resolve this problem?

Thanks in advance! Rahul

mouryarahul avatar May 27 '19 15:05 mouryarahul

That should not be happening, can you try with a more recent ArrayFire (latest is v3.6.4)? Something about your environment is different, some libraries missing / old? What is your OS?

ghost avatar May 27 '19 16:05 ghost

I am having a pre segment fault on Mac OS, the building is fine, but somehow the using is not:

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc (2019-05-16 04:10 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 8

julia> using Libdl

julia> dlopen("libaf")
Ptr{Nothing} @0x00007f8f99f3aae0

julia> using ArrayFire
[1]    36449 segmentation fault  julia

Thanks!

shipengcheng1230 avatar May 29 '19 15:05 shipengcheng1230

That's a different issue, the only thing that happens when you call using ArrayFire is that it tries to print current hardware configuration. Apparently it fails even at that stage - could be https://github.com/arrayfire/arrayfire itself is not installed properly, did you try running the C++ helloworld example that ships with it?

ghost avatar May 29 '19 15:05 ghost

Hi @gaika, I just download the binary lib on the website and verified the "helloword" (opencl and cpu) does works:

➜  helloworld ./helloworld_cpu 
ArrayFire v3.6.4 (CPU, 64-bit Mac OSX, build 1b8030c5)
[0] Intel: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz, 16384 MB, Max threads(8) 
Create a 5-by-3 matrix of random floats on the GPU
A
[5 3 1 1]
    0.6010     0.5497     0.1583 
    0.0278     0.2864     0.3712 
    0.9806     0.3410     0.3543 
    0.2126     0.7509     0.6450 
    0.0655     0.4105     0.9675 
...

I tried more, for instance qr and svd both works. So I assume my ArrayFire is installed properly. Any other thing for julia to work with this besides setting LD_LIBRARY_PATH and JULIA_ARRAYFIRE_BACKEND?

shipengcheng1230 avatar May 29 '19 15:05 shipengcheng1230

JULIA_ARRAYFIRE_BACKEND is optional, also did you turn off SIP https://github.com/nteract/nteract/issues/1523#issuecomment-284027093 ? Your last option is to recompile arrayfire from source - https://github.com/JuliaGPU/ArrayFire.jl/issues/205

ghost avatar May 29 '19 15:05 ghost

I choose to recompile and it's really time-consuming on my machine. While waiting, I can also confirm the segment fault on Linux:

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) Gold 6136 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 8

julia> using ArrayFire
ERROR: GLFW wasn't able to initalize
ArrayFire v3.6.4 (CUDA, 64-bit Linux, build 1b8030c)
Platform: CUDA Toolkit 10.0, Driver: 418.67
[0] Quadro P400, 1967 MB, CUDA Compute 6.1

julia> 

signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0x7fd3982ff89f)
Allocations: 8006636 (Pool: 8004884; Big: 1752); GC: 16

[1]    141577 segmentation fault (core dumped)  julia

shipengcheng1230 avatar May 29 '19 17:05 shipengcheng1230

@gaika My System is: Linux rahul-Alienware-15-R3 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

mouryarahul avatar May 31 '19 15:05 mouryarahul

I am experiencing a similar issue to the segmentation fault on the "using" from REPL as @shipengcheng1230

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.1 (2019-05-16)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using ArrayFire
Segmentation fault: 11
Leons-MacBook-Pro:~ lwabeke$ 

However it works from command line:

ArrayFire v3.5.0 (OpenCL, 64-bit Mac OSX, build 05999f3)
[0] APPLE: AMD Radeon R9 M370X Compute Engine, 2048 MB
-1- APPLE: Iris Pro, 1536 MB
Array(b) ./ a = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0]
b ./ AFArray(a) = AFArray: [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0]
Leons-MacBook-Pro:~ lwabeke$

Also from within REPL I can do: ]test ArrayFire

It runs through, but gives the same 8 FFT failures mentioned in #243

Julia Version 1.1.1
Commit 55e36cc (2019-05-16 04:10 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)

(v1.1) pkg> status
    Status `~/.julia/environments/v1.1/Project.toml`
  [b19378d9] ArrayFire v1.0.1
  [c52e3926] Atom v0.8.5
  [6e4b80f9] BenchmarkTools v0.4.2
  [ad839575] Blink v0.12.0
  [336ed68f] CSV v0.5.9
  [35d6a980] ColorSchemes v3.3.0
  [5ae59095] Colors v0.9.5
  [8f4d0f93] Conda v1.3.0
  [5a033b19] CurveFit v0.3.2
  [717857b8] DSP v0.5.2
  [7a1cc6ca] FFTW v0.3.0
  [5789e2e9] FileIO v1.0.7
  [91ca9103] GAFramework v0.2.0+ [`~/.julia/dev/GAFramework`]
  [0ef565a4] Geodesy v0.5.0
  [cd3eb016] HTTP v0.8.4
  [7073ff75] IJulia v1.18.1
  [86fae568] ImageView v0.9.0
  [916415d5] Images v0.18.0
  [c601a237] Interact v0.10.2
  [682c06a0] JSON v0.21.0
  [e5e0dc1b] Juno v0.7.0
  [b964fa9f] LaTeXStrings v1.0.3
  [ee78f7c6] Makie v0.9.4
  [f28f55f0] Memento v0.12.1
  [4d1e1d77] Nullables v0.0.8
  [47be7bcc] ORCA v0.2.1
  [08131aa3] OpenCL v0.8.0+ [`~/.julia/dev/OpenCL`]
  [f0f68f2c] PlotlyJS v0.12.5
  [91a5bcdd] Plots v0.26.0
  [438e738f] PyCall v1.91.2
  [d330b81b] PyPlot v2.8.1
  [b0e4dd01] RollingFunctions v0.6.2
  [fdea26ae] SIMD v2.6.0
  [90137ffa] StaticArrays v0.11.0
  [bd369af6] Tables v0.2.10
  [cbff2730] Unmarshal v0.2.1
  [d6d074c3] VideoIO v0.6.9
  [0f1e0344] WebIO v0.8.8
  [9a3f8284] Random 

I guess this is similar to the issue I found on OpenCL: https://github.com/JuliaGPU/OpenCL.jl/issues/176

lwabeke avatar Jul 26 '19 12:07 lwabeke