CLBLAS.jl
CLBLAS.jl copied to clipboard
Test failures
WARNING: deprecated syntax "typealias CL_float2 Complex64" at C:\Users\Mus\.julia\v0.6\CLBLAS\src\constants.jl:4.
Use "const CL_float2 = Complex64" instead.
WARNING: deprecated syntax "typealias CL_double2 Complex128" at C:\Users\Mus\.julia\v0.6\CLBLAS\src\constants.jl:5.
Use "const CL_double2 = Complex128" instead.
CLBLAS axpy: Error During Test
Got an exception of type OpenCL.cl.CLError outside of a @test
CLError(code=-33, CL_INVALID_DEVICE)
Stacktrace:
[1] #clblasDaxpy#56(::Array{Ptr{Void},1}, ::Function, ::UInt64, ::Float64, ::Ptr{Void}, ::UInt64, ::Int32, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\macros.jl:132
[2] #axpy!#444(::OpenCL.cl.CmdQueue, ::Function, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::OpenCL.cl.CLArray{Float64,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\highlevel.jl:23
[3] (::Base.LinAlg.#kw##axpy!)(::Array{Any,1}, ::Base.LinAlg.#axpy!, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::OpenCL.cl.CLArray{Float64,1}) at .\<missing>:0
[4] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:10 [inlined]
[5] macro expansion at .\test.jl:853 [inlined]
[6] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:0 [inlined]
[7] macro expansion at .\test.jl:853 [inlined]
[8] anonymous at .\<missing>:?
[9] include_from_node1(::String) at .\loading.jl:539
[10] include(::String) at .\sysimg.jl:14
[11] include_from_node1(::String) at .\loading.jl:539
[12] include(::String) at .\sysimg.jl:14
[13] process_options(::Base.JLOptions) at .\client.jl:305
[14] _start() at .\client.jl:371
CLBLAS scal: Error During Test
Got an exception of type OpenCL.cl.CLError outside of a @testERROR (unhandled task failure): MethodError: no method matching unsafe_string(::Ptr{Void})
Closest candidates are:
unsafe_string(::Cstring) at c.jl:79
unsafe_string(::Union{Ptr{Int8}, Ptr{UInt8}}, ::Integer) at strings/string.jl:35
unsafe_string(::Union{Ptr{Int8}, Ptr{UInt8}}) at strings/string.jl:39
Stacktrace:
[1] macro expansion at C:\Users\Mus\.julia\v0.6\OpenCL\src\context.jl:95 [inlined]
[2] (::OpenCL.cl.##43#44)() at .\task.jl:335
CLError(code=-33, CL_INVALID_DEVICE)
Stacktrace:
[1] #clblasDscal#26(::Array{Ptr{Void},1}, ::Function, ::UInt64, ::Float64, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\macros.jl:132
[2] clblasDscal(::UInt64, ::Float64, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\macros.jl:110
[3] (::Base.LinAlg.BLAS.#kw##scal!)(::Array{Any,1}, ::Base.LinAlg.BLAS.#scal!, ::Int64, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::Int64) at .\<missing>:0
[4] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:29 [inlined]
[5] macro expansion at .\test.jl:853 [inlined]
[6] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:0 [inlined]
[7] macro expansion at .\test.jl:853 [inlined]
[8] anonymous at .\<missing>:?
[9] include_from_node1(::String) at .\loading.jl:539
[10] include(::String) at .\sysimg.jl:14
[11] include_from_node1(::String) at .\loading.jl:539
[12] include(::String) at .\sysimg.jl:14
[13] process_options(::Base.JLOptions) at .\client.jl:305
[14] _start() at .\client.jl:371
Test Summary: | Pass Error Total
CLBLAS.L1 | 2 2 4
CLBLAS axpy | 1 1 2
CLBLAS scal | 1 1 2
ERROR: LoadError: LoadError: Some tests did not pass: 2 passed, 0 failed, 2 errored, 0 broken.
while loading C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl, in expression starting on line 1
while loading C:\Users\Mus\.julia\v0.6\CLBLAS\test\runtests.jl, in expression starting on line 11
====================================================================================================================================[ ERROR: CLBLAS ]====================================================================================================================================
failed process: Process(`'C:\Julia\Julia-0.6-latest\bin\julia' -Cnative '-JC:\Julia\Julia-0.6-latest\lib\julia\sys.dll' --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=yes --compilecache=yes 'C:\Users\Mus\.julia\v0.6\CLBLAS\test\runtests.jl'`, ProcessExited(1)) [1]
=========================================================================================================================================================================================================================================================================================
INFO: No packages to install, update or remove
ERROR: CLBLAS had test errors
I get the same errors in OS X
Please, make sure you have:
- The latest version of OpenCL.jl.
- The latest version of CLBLAS.jl.
- You can run Quick Example from OpenCL.jl's README.
If you've done all of it already, please post the output of:
using OpenCL
device, ctx, queue = cl.create_compute_context()
and check that device is what you expect it to be (e.g. GPU and not CPU or vice versa).
Yes I did 1–3, and the output returns:
julia> using OpenCL
julia> device, ctx, queue = cl.create_compute_context()
(OpenCL.Device(HD Graphics 4000 on Apple @0x0000000001024400), OpenCL.Context(@0x00007fc359532830 on HD Graphics 4000), OpenCL.CmdQueue(@0x00007fc358d7d100))
@dlfivefifty Just to make sure, do you get exactly the same error message as the original author (except for paths, of course)? If so, can you run CLBLAS tests (C API, should be installed with the libraries).
CL_INVALID_DEVICE
for all calls makes me think that CLBLAS is either totally broken on MacOS, or just misconfigured. So the first thing to figure out is what side - Julia or C - causes the error.
Yes I get the same errors, see below. How do I run CLBLAS tests?
julia> versioninfo()
Julia Version 0.6.0-pre.beta.437
Commit 552626cc97 (2017-04-30 05:06 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin16.5.0)
CPU: Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz
WORD_SIZE: 64
BLAS: libgfortblas
LAPACK: liblapack
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, ivybridge)
julia> Pkg.test("CLBLAS")
INFO: Computing test dependencies for CLBLAS...
INFO: No packages to install, update or remove
INFO: Testing CLBLAS
WARNING: deprecated syntax "typealias CL_float2 Complex64" at /Users/solver/.julia/v0.6/CLBLAS/src/constants.jl:4.
Use "const CL_float2 = Complex64" instead.
WARNING: deprecated syntax "typealias CL_double2 Complex128" at /Users/solver/.julia/v0.6/CLBLAS/src/constants.jl:5.
Use "const CL_double2 = Complex128" instead.
CLBLAS axpy: Error During Test
Got an exception of type OpenCL.cl.CLError outside of a @testERROR (unhandled task failure): MethodError: no method matching unsafe_string(::Ptr{Void})
Closest candidates are:
unsafe_string(::Cstring) at c.jl:79
unsafe_string(::Union{Ptr{Int8}, Ptr{UInt8}}, ::Integer) at strings/string.jl:35
unsafe_string(::Union{Ptr{Int8}, Ptr{UInt8}}) at strings/string.jl:39
Stacktrace:
[1] macro expansion at /Users/solver/.julia/v0.6/OpenCL/src/context.jl:95 [inlined]
[2] (::OpenCL.cl.##43#44)() at ./task.jl:335
CLError(code=-33, CL_INVALID_DEVICE)
Stacktrace:
[1] #clblasDaxpy#56(::Array{Ptr{Void},1}, ::Function, ::UInt64, ::Float64, ::Ptr{Void}, ::UInt64, ::Int32, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at /Users/solver/.julia/v0.6/CLBLAS/src/macros.jl:132
[2] #axpy!#444(::OpenCL.cl.CmdQueue, ::Function, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::OpenCL.cl.CLArray{Float64,1}) at /Users/solver/.julia/v0.6/CLBLAS/src/highlevel.jl:23
[3] (::Base.LinAlg.#kw##axpy!)(::Array{Any,1}, ::Base.LinAlg.#axpy!, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::OpenCL.cl.CLArray{Float64,1}) at ./<missing>:0
[4] macro expansion at /Users/solver/.julia/v0.6/CLBLAS/test/test_l1.jl:10 [inlined]
[5] macro expansion at ./test.jl:853 [inlined]
[6] macro expansion at /Users/solver/.julia/v0.6/CLBLAS/test/test_l1.jl:2 [inlined]
[7] macro expansion at ./test.jl:853 [inlined]
[8] anonymous at ./<missing>:?
[9] include_from_node1(::String) at ./loading.jl:539
[10] include(::String) at ./sysimg.jl:14
[11] include_from_node1(::String) at ./loading.jl:539
[12] include(::String) at ./sysimg.jl:14
[13] process_options(::Base.JLOptions) at ./client.jl:305
[14] _start() at ./client.jl:371
CLBLAS scal: Test Failed
Expression: cl.to_host(DX) ≈ hDX
Evaluated: [0.0, 1.061e-314, 1.061e-314, 1.061e-314, 0.0, 0.0, 1.061e-314, 1.061e-314, 0.0, 0.0, 1.061e-314, 1.061e-314, 0.0, 1.061e-314, 1.061e-314, 0.0, 0.566805, 0.22206, 0.766086, 0.849208, 0.00594686, 0.334882, 0.643584, 0.0570114, 0.290533, 0.00998774, 0.788418, 0.228115, 0.0862312, 0.817396, 0.842124, 0.59352] isapprox [0.533443, 1.98955, 0.262287, 0.207129, 0.475193, 1.61812, 0.69627, 0.156448, 1.1331, 1.1256, 0.0784997, 1.71629, 0.0828395, 1.5662, 1.21853, 1.80108, 1.13361, 0.44412, 1.53217, 1.69842, 0.0118937, 0.669765, 1.28717, 0.114023, 0.581066, 0.0199755, 1.57684, 0.456229, 0.172462, 1.63479, 1.68425, 1.18704]
Stacktrace:
[1] macro expansion at /Users/solver/.julia/v0.6/CLBLAS/test/test_l1.jl:32 [inlined]
[2] macro expansion at ./test.jl:853 [inlined]
[3] macro expansion at /Users/solver/.julia/v0.6/CLBLAS/test/test_l1.jl:17 [inlined]
[4] macro expansion at ./test.jl:853 [inlined]
[5] anonymous at ./<missing>:?
CLBLAS scal: Error During Test
Got an exception of type OpenCL.cl.CLError outside of a @test
CLError(code=-33, CL_INVALID_DEVICE)
Stacktrace:
[1] #clblasZscal#32(::Array{Ptr{Void},1}, ::Function, ::UInt64, ::Complex{Float64}, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at /Users/solver/.julia/v0.6/CLBLAS/src/macros.jl:132
[2] clblasZscal(::UInt64, ::Complex{Float64}, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at /Users/solver/.julia/v0.6/CLBLAS/src/macros.jl:110
[3] (::Base.LinAlg.BLAS.#kw##scal!)(::Array{Any,1}, ::Base.LinAlg.BLAS.#scal!, ::Int64, ::Complex{Float64}, ::OpenCL.cl.CLArray{Complex{Float64},1}, ::Int64) at ./<missing>:0
[4] macro expansion at /Users/solver/.julia/v0.6/CLBLAS/test/test_l1.jl:29 [inlined]
[5] macro expansion at ./test.jl:853 [inlined]
[6] macro expansion at /Users/solver/.julia/v0.6/CLBLAS/test/test_l1.jl:17 [inlined]
[7] macro expansion at ./test.jl:853 [inlined]
[8] anonymous at ./<missing>:?
[9] include_from_node1(::String) at ./loading.jl:539
[10] include(::String) at ./sysimg.jl:14
[11] include_from_node1(::String) at ./loading.jl:539
[12] include(::String) at ./sysimg.jl:14
[13] process_options(::Base.JLOptions) at ./client.jl:305
[14] _start() at ./client.jl:371
Test Summary: | Pass Fail Error Total
CLBLAS.L1 | 2 1 2 5
CLBLAS axpy | 1 1 2
CLBLAS scal | 1 1 1 3
ERROR: LoadError: LoadError: Some tests did not pass: 2 passed, 1 failed, 2 errored, 0 broken.
while loading /Users/solver/.julia/v0.6/CLBLAS/test/test_l1.jl, in expression starting on line 1
while loading /Users/solver/.julia/v0.6/CLBLAS/test/runtests.jl, in expression starting on line 11
===============================[ ERROR: CLBLAS ]================================
failed process: Process(`/Users/solver/Projects/julia6/usr/bin/julia -Cnative -J/Users/solver/Projects/julia6/usr/lib/julia/sys.dylib --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=yes --compilecache=yes /Users/solver/.julia/v0.6/CLBLAS/test/runtests.jl`, ProcessExited(1)) [1]
================================================================================
INFO: No packages to install, update or remove
ERROR: CLBLAS had test errors
I don't have access to MacOS right now so can't really check, but I guess there's a test
directory somewhere near the libclBLAS.dylib
. I'd start by changing directory to the test
and running cmake . && make
or something similar.
If there's no test
directory, you can at least build CLBLAS from source and run the tests the same way from there.
I'll get access to MacBook after 10th of May and hopefully will be able to give more helpful suggestions.
Hmm, I cloned CLBLAS but there's no INSTALL file...
It's a bit more tricky than that. At the top-level, clBLAS uses CMake to build its binaries. CMake handles platform-specific details and generates a Makefile, which is then used by Make to actually build a target. On Linux, I was able to build and test clBLAS using:
cd <clBLAS/src>
cmake .
make
staging/test-correctness
This may take a while.
OK it's building right now. How do I tell CLBLAS.jl to use the built library instead of homebrew?
Firs you need to run tests (staging/test-correct
line from above or any other tests in the same directory). If they work, we will at least see that clBLAS works correctly on MacOS - don't forget that in most docs it's still marked as "not officially supported".
If tests pass, you can try to temporarily replace Homebrew's libclblas with your newly compiled. For simplicity, you can add a line like:
const libCLBLAS = "/absolute/path/to/libclBLAS.dylib"
to the top of macro.jl
.
Unfortunately, it crashes (after many tests pass):
[ OK ] SelectedBig_0/GEMM.zgemm/1 (0 ms)
[----------] 8 tests from SelectedBig_0/GEMM (32366 ms total)
[----------] 8 tests from SelectedBig_1/GEMM
[ RUN ] SelectedBig_1/GEMM.sgemm/0
Abort trap: 6
But at least some tests passed without CL_INVALID_DEVICE. Can you try the trick with a custom libclBLAS.dylib
?
Did you mean macros.jl
? It didn't seem to make a difference
Do you mean that you changed the libCLBLAS
value in macro.jl, ran Pkg.test("CLBLAS")
and it outputted the same error as before? If so, I'm running out of ideas, so you'll have to wait until I get back to MacBook and can debug it myself.
In the files CLBLAS/src/macros.jl
I added the line
const libCLBLAS = "/Users/solver/Projects/clBLAS/src/library/libclBLAS.dylib"
And ran Pkg.test("CLBLAS")
I just encountered this error on a student laptops and it turned out that his laptop doesn't support Float64
compute. To test that you can use the following function that @SimonDanisch wrote for CLArrays
function supports_double(dev::cl.Device)
result = Ref{cl.CL_uint}()
cl.@check cl.api.clGetDeviceInfo(
dev.id, cl.CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE,
sizeof(cl.CL_uint), result, C_NULL)
result[] != 0
end