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

Test failures #32

Open
musm opened this issue Apr 10, 2017 · 16 comments
Open

Test failures #32

musm opened this issue Apr 10, 2017 · 16 comments

Comments

@musm
Copy link
Contributor

musm commented Apr 10, 2017

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
@dlfivefifty
Copy link
Contributor

I get the same errors in OS X

@dfdx
Copy link
Contributor

dfdx commented Apr 30, 2017

Please, make sure you have:

  1. The latest version of OpenCL.jl.
  2. The latest version of CLBLAS.jl.
  3. 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).

@dlfivefifty
Copy link
Contributor

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))

@dfdx
Copy link
Contributor

dfdx commented May 1, 2017

@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.

@dlfivefifty
Copy link
Contributor

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

@dfdx
Copy link
Contributor

dfdx commented May 2, 2017

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.

@dlfivefifty
Copy link
Contributor

Hmm, I cloned CLBLAS but there's no INSTALL file...

@dfdx
Copy link
Contributor

dfdx commented May 3, 2017

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.

@dlfivefifty
Copy link
Contributor

OK it's building right now. How do I tell CLBLAS.jl to use the built library instead of homebrew?

@dfdx
Copy link
Contributor

dfdx commented May 3, 2017

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.

@dlfivefifty
Copy link
Contributor

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

@dfdx
Copy link
Contributor

dfdx commented May 3, 2017

But at least some tests passed without CL_INVALID_DEVICE. Can you try the trick with a custom libclBLAS.dylib?

@dlfivefifty
Copy link
Contributor

Did you mean macros.jl? It didn't seem to make a difference

@dfdx
Copy link
Contributor

dfdx commented May 4, 2017

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.

@dlfivefifty
Copy link
Contributor

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")

@vchuravy
Copy link
Member

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

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

4 participants