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

Example from README.md fails #8

Open
lruthotto opened this issue Jun 8, 2017 · 1 comment
Open

Example from README.md fails #8

lruthotto opened this issue Jun 8, 2017 · 1 comment

Comments

@lruthotto
Copy link

I'm looking for a julia way to do FFTs on the GPU and tried the example from the README.md page, which failed. Couldn't find the problem in the code, so maybe someone else can help. Thanks !

julia> CUDArt.devices(dev->capability(dev)[1] >= 2, nmax=1) do devlist
           A = rand(7,6)
           # Move data to GPU
           G = CudaArray(A)
           # Allocate space for the output (transformed array)
           GFFT = CudaArray(Complex{eltype(A)}, div(size(G,1),2)+1, size(G,2))
           # Compute the FFT
           pl! = plan(GFFT, G)
           pl!(GFFT, G, true)
           # Copy the result to main memory
           AFFTG = to_host(GFFT)
           # Compare against Julia's rfft
           AFFT = rfft(A)
           @test_approx_eq AFFTG AFFT
           # Now compute the inverse transform
           pli! = plan(G,GFFT)
           pli!(G, GFFT, false)
           A2 = to_host(G)
           @test_approx_eq A A2/length(A)
       end
An error was triggered:

 in checkerror(::Int32) at /home/lruthot/.julia/v0.5/CUFFT/src/libcufft.jl:15
 in #plan#1(::Symbol, ::CUDArt.Stream, ::Function, ::CUDArt.CudaArray{Complex{Float64},2}, ::CUDArt.CudaArray{Float64,2}) at /home/lruthot/.julia/v0.5/CUFFT/src/CUFFT.jl:86
 in (::##7#9)(::Array{Int64,1}) at ./REPL[26]:8
 in devices(::##7#9, ::Array{Int64,1}) at /home/lruthot/.julia/v0.5/CUDArt/src/device.jl:61
 in (::CUDArt.#kw##devices)(::Array{Any,1}, ::CUDArt.#devices, ::Function, ::Function) at ./<missing>:0
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68ERROR: UndefVarError: uint8 not defined
 in checkerror(::Int32) at /home/lruthot/.julia/v0.5/CUFFT/src/libcufft.jl:16
 in #plan#1(::Symbol, ::CUDArt.Stream, ::Function, ::CUDArt.CudaArray{Complex{Float64},2}, ::CUDArt.CudaArray{Float64,2}) at /home/lruthot/.julia/v0.5/CUFFT/src/CUFFT.jl:86
 in (::##7#9)(::Array{Int64,1}) at ./REPL[26]:8
 in devices(::##7#9, ::Array{Int64,1}) at /home/lruthot/.julia/v0.5/CUDArt/src/device.jl:61
 in (::CUDArt.#kw##devices)(::Array{Any,1}, ::CUDArt.#devices, ::Function, ::Function) at ./<missing>:0

My OS is ubuntu, CUDA driver are up to date and here is more about my julia version:

julia> versioninfo()
Julia Version 0.5.3-pre+0
Commit 42f8035* (2017-05-06 16:34 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
  WORD_SIZE: 64
  BLAS: libopenblas64_
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)
@KajWiik
Copy link

KajWiik commented Dec 6, 2017

I have the same problem, Pkg.test("CUFFT") fails with "UndefVarError: uint8 not defined".

julia> versioninfo()
Julia Version 0.6.0
Commit 9036443 (2017-06-19 13:05 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-2860QM CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, sandybridge)

The Readme.md example fails with segfault:

WARNING: @test_approx_eq is deprecated, use `@test AFFTG ≈ AFFT` instead
Stacktrace:
 [1] depwarn(::String, ::Symbol) at ./deprecated.jl:70
 [2] @test_approx_eq(::ANY, ::ANY) at ./deprecated.jl:1052
 [3] eval(::Module, ::Any) at ./boot.jl:235
 [4] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
 [5] macro expansion at ./REPL.jl:97 [inlined]
 [6] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
while loading no file, in expression starting on line 0
WARNING: Array{T}(::Type{T}, m::Int) is deprecated, use Array{T}(m) instead.
Stacktrace:
 [1] depwarn(::String, ::Symbol) at ./deprecated.jl:70
 [2] Array(::Type{Int32}, ::Int64) at ./deprecated.jl:57
 [3] plan_size(::CUDArt.CudaArray{Complex{Float64},2}, ::CUDArt.CudaArray{Float64,2}) at /home/kjwiik/.julia/v0.6/CUFFT/src/CUFFT.jl:53
 [4] #plan#1(::Symbol, ::CUDArt.Stream, ::Function, ::CUDArt.CudaArray{Complex{Float64},2}, ::CUDArt.CudaArray{Float64,2}) at /home/kjwiik/.julia/v0.6/CUFFT/src/CUFFT.jl:78
 [5] (::##1#3)(::Array{Int64,1}) at ./REPL[9]:7
 [6] devices(::##1#3, ::Array{Int64,1}) at /home/kjwiik/.julia/v0.6/CUDArt/src/device.jl:80
 [7] (::CUDArt.#kw##devices)(::Array{Any,1}, ::CUDArt.#devices, ::Function, ::Function) at ./<missing>:0
 [8] eval(::Module, ::Any) at ./boot.jl:235
 [9] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
 [10] macro expansion at ./REPL.jl:97 [inlined]
 [11] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
while loading no file, in expression starting on line 0
An error was triggered:

Stacktrace:
 [1] checkerror(::Int32) at /home/kjwiik/.julia/v0.6/CUFFT/src/libcufft.jl:15
 [2] #plan#1(::Symbol, ::CUDArt.Stream, ::Function, ::CUDArt.CudaArray{Complex{Float64},2}, ::CUDArt.CudaArray{Float64,2}) at /home/kjwiik/.julia/v0.6/CUFFT/src/CUFFT.jl:86
 [3] (::##1#3)(::Array{Int64,1}) at ./REPL[9]:7
 [4] devices(::##1#3, ::Array{Int64,1}) at /home/kjwiik/.julia/v0.6/CUDArt/src/device.jl:80
 [5] (::CUDArt.#kw##devices)(::Array{Any,1}, ::CUDArt.#devices, ::Function, ::Function) at ./<missing>:0
 [6] eval(::Module, ::Any) at ./boot.jl:235
 [7] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
 [8] macro expansion at ./REPL.jl:97 [inlined]
 [9] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73ERROR: 
signal (11): Segmentation fault
while loading no file, in expression starting on line 0
unknown function (ip: 0x7f97961f3089)
unknown function (ip: 0x7f979620134e)
unknown function (ip: 0x7f979612146f)
cuModuleUnload at /usr/lib/x86_64-linux-gnu/libcuda.so (unknown line)
macro expansion at /home/kjwiik/.julia/v0.6/CUDAdrv/src/base.jl:143 [inlined]
unsafe_unload! at /home/kjwiik/.julia/v0.6/CUDAdrv/src/module.jl:63
unknown function (ip: 0x7f97a326f4e2)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
jl_apply at /home/kjwiik/test/julia/src/julia.h:1424 [inlined]
run_finalizer at /home/kjwiik/test/julia/src/gc.c:111
jl_gc_run_finalizers_in_list at /home/kjwiik/test/julia/src/gc.c:200
run_finalizers at /home/kjwiik/test/julia/src/gc.c:234
jl_gc_enable_finalizers at /home/kjwiik/test/julia/src/gc.c:245
jl_mutex_unlock at /home/kjwiik/test/julia/src/./julia_threads.h:586 [inlined]
jl_typeinf_end at /home/kjwiik/test/julia/src/gf.c:2408
typeinf_code at ./inference.jl:2565
unknown function (ip: 0x7f97bf19929d)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
typeinf_ext at ./inference.jl:2603
unknown function (ip: 0x7f97bf177e32)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
jl_apply at /home/kjwiik/test/julia/src/julia.h:1424 [inlined]
jl_apply_with_saved_exception_state at /home/kjwiik/test/julia/src/rtutils.c:257
jl_type_infer at /home/kjwiik/test/julia/src/gf.c:269
jl_compile_for_dispatch at /home/kjwiik/test/julia/src/gf.c:1668
jl_compile_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:307 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:354 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
display_error at ./client.jl:137
unknown function (ip: 0x7f97a326ebad)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
do_call at /home/kjwiik/test/julia/src/interpreter.c:75
eval at /home/kjwiik/test/julia/src/interpreter.c:242
eval_body at /home/kjwiik/test/julia/src/interpreter.c:539
jl_toplevel_eval_body at /home/kjwiik/test/julia/src/interpreter.c:511
jl_toplevel_eval_flex at /home/kjwiik/test/julia/src/toplevel.c:571
jl_toplevel_eval_in at /home/kjwiik/test/julia/src/builtins.c:496
eval at ./boot.jl:235
unknown function (ip: 0x7f97bf2c799f)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
print_response at ./REPL.jl:137
unknown function (ip: 0x7f97a326e22d)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
print_response at ./REPL.jl:129
unknown function (ip: 0x7f97a3227afd)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
do_respond at ./REPL.jl:646
unknown function (ip: 0x7f97a3245551)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
do_call at /home/kjwiik/test/julia/src/interpreter.c:75
eval at /home/kjwiik/test/julia/src/interpreter.c:242
eval_body at /home/kjwiik/test/julia/src/interpreter.c:539
jl_toplevel_eval_body at /home/kjwiik/test/julia/src/interpreter.c:511
jl_toplevel_eval_flex at /home/kjwiik/test/julia/src/toplevel.c:571
jl_toplevel_eval_in at /home/kjwiik/test/julia/src/builtins.c:496
eval at ./boot.jl:235
unknown function (ip: 0x7f97bf2c799f)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
run_interface at ./LineEdit.jl:1583
unknown function (ip: 0x7f97bf32dd2f)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
run_frontend at ./REPL.jl:945
run_repl at ./REPL.jl:180
unknown function (ip: 0x7f97a317c342)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
_start at ./client.jl:413
unknown function (ip: 0x7f97bf30b298)
jl_call_fptr_internal at /home/kjwiik/test/julia/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/kjwiik/test/julia/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/kjwiik/test/julia/src/gf.c:1933
jl_apply at /home/kjwiik/test/julia/ui/../src/julia.h:1424 [inlined]
true_main at /home/kjwiik/test/julia/ui/repl.c:127
main at /home/kjwiik/test/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: 26546259 (Pool: 26523382; Big: 22877); GC: 72
Segmentation fault (core dumped)

CUDA version is 8.0.61 and driver is 375.26. Device is Quadro 2000M. The toolkit CUFFT examples simpleCUFFT_callback and simpleCUFFT compile and run without a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants