Unhandled task failure on v0.5
I have a 5K retina iMac with OpenCL.Device(AMD Radeon R9 M295X Compute Engine on Apple @0x0000000001021c00). I've started getting errors when I build kernels:
ERROR (unhandled task failure): OpenCL Error: OpenCL.Context error: ȧJ? in raise_context_error(::String, ::String) at /Users/sjbespa/.julia/v0.5/OpenCL/src/context.jl:56 in macro expansion at /Users/sjbespa/.julia/v0.5/OpenCL/src/context.jl:97 [inlined] in (::OpenCL.##45#48)() at ./task.jl:309
Running Pkg.test("OpenCL") results in about 1/2 dozen of the errors... with julia updated this morning.
Thanks for the report, could you try the branch https://github.com/JuliaGPU/OpenCL.jl/pull/109? The PR is still WIP, but master does not support v0.5 at the moment.
Fair enough. How do I select the vc/refactor branch? I tried doing a git checkout followed by a Pkg.build("OpenCL") but after that usual functions such as OpenCL.devices and create_some_context are missing.. or at least undefined.
hm Pkg.checkout("OpenCL", "vc/refactor") should be enough.
On Thu, 28 Jul 2016 at 04:45 protogeezer [email protected] wrote:
Fair enough. How do I select the vc/refactor branch? I tried doing a git checkout followed by a Pkg.build("OpenCL") but after that usual functions such as OpenCL.devices and create_some_context are missing.. or at least undefined.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JuliaGPU/OpenCL.jl/issues/111#issuecomment-235698187, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI3ai116CtG80t83QPCcTCrFIfm1OCVks5qZ7VzgaJpZM4JWb54 .
After the checkout functions like OpenCL.devices(), OpenCL.platforms(), and OpenCL.create_some_context() are still undefined.
Oh sorry I misread your comment.
On the refactored branch you will have to do
using OpenCL
cl.devices()
Thanks! I’ll try it out.
On Aug 5, 2016, at 8:51 AM, Valentin Churavy [email protected] wrote:
Oh sorry I misread your comment.
On the refactored branch you will have to do
using OpenCL cl.devices()
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Adding a small error to the examples/demo.jl (see below) results in different crashes depending on whether the problem is a warning or an error. For the version with an error:
sjbespa$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.0-rc0+22 (2016-07-27 15:49 UTC)
_/ |\__'_|_|_|\__'_| | Commit e474dd4 (9 days old master)
|__/ | x86_64-apple-darwin15.6.0
julia> include("demo.jl")
WARNING: deprecated syntax "flags::CL_mem_flags".
Use "local flags::CL_mem_flags" instead.
ERROR: LoadError: CLError(code=-11, CL_BUILD_PROGRAM_FAILURE)
in macro expansion at /Users/sjbespa/.julia/v0.5/OpenCL/src/macros.jl:6 [inlined]
in #build!#117(::String, ::Bool, ::Function, ::OpenCL.cl.Program) at /Users/sjbespa/.julia/v0.5/OpenCL/src/program.jl:84
in |>(::OpenCL.cl.Program, ::OpenCL.cl.#build!) at ./operators.jl:335
in include_from_node1(::String) at ./loading.jl:426
while loading /Users/sjbespa/ranking-code/demo.jl, in expression starting on line 27WARNING: String(p::Union{Ptr{Int8},Ptr{UInt8}}) is deprecated, use unsafe_string(p) instead.
julia> ::String, ::Symbol) at ./deprecated.jl:64
in String(::Ptr{Int8}) at ./deprecated.jl:50
in macro expansion at /Users/sjbespa/.julia/v0.5/OpenCL/src/context.jl:94 [inlined]
in (::OpenCL.cl.##44#46)() at ./task.jl:309
while loading no file, in expression starting on line 0
ERROR (unhandled task failure): MethodError: no method matching unsafe_string(::Ptr{Void})
Closest candidates are:
unsafe_string(::Cstring) at c.jl:187
unsafe_string(::Union{Ptr{Int8},Ptr{UInt8}}) at strings/basic.jl:56
unsafe_string(::Union{Ptr{Int8},Ptr{UInt8}}, ::Integer) at strings/basic.jl:52
in macro expansion at /Users/sjbespa/.julia/v0.5/OpenCL/src/context.jl:95 [inlined]
in (::OpenCL.cl.##44#46)() at ./task.jl:309
using OpenCL
if VERSION < v"0.4.9"
const cl = OpenCL
end
const sum_kernel_src = "
__kernel void sum(__global const float *a,
__global const float *b,
__global float *c)
{
int gid = get_global_id(0);
float d; // or c for an error not a warning
c[gid] = a[gid] + b[gid];
}
"
a = rand(Float32, 50_000)
b = rand(Float32, 50_000)
device, ctx, queue = cl.create_compute_context()
# create opencl buffer objects
# copies to the device initiated when the kernel function is called
a_buff = cl.Buffer(Float32, ctx, (:r, :copy), hostbuf=a)
b_buff = cl.Buffer(Float32, ctx, (:r, :copy), hostbuf=b)
c_buff = cl.Buffer(Float32, ctx, :w, length(a))
# build the program and construct a kernel object
p = cl.Program(ctx, source=sum_kernel_src) |> cl.build!
sum_kernel = cl.Kernel(p, "sum")
# call the kernel object with global size set to the size our arrays
sum_kernel[queue, size(a)](a_buff, b_buff, c_buff)
# perform a blocking read of the result from the device
r = cl.read(queue, c_buff)
# check to see if our result is what we expect!
if isapprox(norm(r - (a+b)), zero(Float32))
info("Success!")
else
error("Norm should be 0.0f")
end
I'm also getting this error:
ERROR (unhandled task failure): MethodError: no method matching unsafe_string(::Ptr{Void})
However strangely enough the error does not cause the algorithm to abort.
We are trying to revive the OpenCL.jl package. This issue is too old to be addressed in recent Julia versions. Closing it.