JuliaGPU / ArrayFire.jl

Julia wrapper for the ArrayFire library
Other
204 stars 37 forks source link

Pkg.test error with julia 0.5.2 on Windows #154

Open BoundaryValueProblems opened 7 years ago

BoundaryValueProblems commented 7 years ago

Hello. I think I installed arrayfire library (version 3.4.2) for Windows correctly. My julia version is 0.5.2. Upon running Pkg.test("ArrayFire"), I got the following errors. I want to note that there was no problem with Pkg.test("ArrayFire") on my Mac OS X though. Here are the errors on my Windows machine:

Error During Test
  Test threw an exception of type ErrorException
  Expression: 
sumabs2(Array(chol(ad * ad')) - chol(a * a')) < 1.0e-5
  ArrayFire Error (998) : Internal error
   in throwAFerror(::Int32) at C:\Users\BVP\.julia\v0.5\ArrayFire\src\error.jl:50
   in af_matmul(::Base.RefValue{Ptr{Void}}, ::ArrayFire.AFArray{Float32,2}, ::ArrayFire.AFArray{Float32,2}, ::Int64, ::Int64) at C:\Users\BVP\.julia\v0.5\ArrayFire\src\wrap.jl:978
   in #*#91(::Int64, ::Int64, ::Function, ::ArrayFire.AFArray{Float32,2}, ::ArrayFire.AFArray{Float32,2}) at C:\Users\BVP\.julia\v0.5\ArrayFire\src\linalg.jl:161
   in (::Base.#kw##*)(::Array{Any,1}, ::Base.#*, ::ArrayFire.AFArray{Float32,2}, ::ArrayFire.AFArray{Float32,2}) at .\<missing>:0
   in A_mul_Bc(::ArrayFire.AFArray{Float32,2}, ::ArrayFire.AFArray{Float32,2}) at C:\Users\BVP\.julia\v0.5\ArrayFire\src\linalg.jl:171
   in include_from_node1(::String) at .\loading.jl:488
   in process_options(::Base.JLOptions) at .\client.jl:265
   in _start() at .\client.jl:321
ERROR: LoadError: There was an error during testing
 in record(::Base.Test.FallbackTestSet, ::Base.Test.Error) at .\test.jl:397
 in do_test(::Base.Test.Threw, ::Expr) at .\test.jl:281
 in include_from_node1(::String) at .\loading.jl:488
 in process_options(::Base.JLOptions) at .\client.jl:265
 in _start() at .\client.jl:321
while loading C:\Users\BVP\.julia\v0.5\ArrayFire\test\runtests.jl, in expression starting on line 59
fatal: error thrown and no exception handler available.
ReadOnlyMemoryError()
RtlEnterCriticalSection at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
clGetCLObjectInfoINTEL at C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_dada2949e7e4cbd9\igdrcl64.dll (unknown line)
clGetCLObjectInfoINTEL at C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_dada2949e7e4cbd9\igdrcl64.dll (unknown line)
clReleaseProgram at C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_dada2949e7e4cbd9\igdrcl64.dll (unknown line)
af::translate at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::translate at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::translate at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::translate at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::translate at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::translate at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::translate at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::ycbcr2rgb at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::ycbcr2rgb at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
af::ycbcr2rgb at C:\Program Files\ArrayFire\v3\lib\afopencl.dll (unknown line)
RtlDeactivateActivationContextUnsafeFast at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
LdrShutdownProcess at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
RtlExitUserProcess at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
FatalExit at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
exit at C:\WINDOWS\System32\msvcrt.dll (unknown line)
initterm_e at C:\WINDOWS\System32\msvcrt.dll (unknown line)
jl_exit at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\jl_uv.c:551
_start at .\client.jl:368
unknown function (ip: 0000000061C8A17E)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:211 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1950
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/ui/../src\julia.h:1388 [inlined]
true_main at /home/Administrator/buildbot/slave/package_win6_2-x64/build/ui\repl.c:123
wmain at /home/Administrator/buildbot/slave/package_win6_2-x64/build/ui\repl.c:243
__tmainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-4.0.6-1/crt\crtexe.c:329
mainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-4.0.6-1/crt\crtexe.c:212
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
==============================[ ERROR: ArrayFire ]==============================

failed process: Process(`'C:\Program Files\Julia-0.5.2\bin\julia' -Cx86-64 '-JC:\Program Files\Julia-0.5.2\lib\julia\sys.dll' --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=no --compilecache=yes 'C:\Users\BVP\.julia\v0.5\ArrayFire\test\runtests.jl'`, ProcessExited(1)) [1]

================================================================================
ArrayFire had test errors

I would greatly appreciate your help! Best, BVP

BoundaryValueProblems commented 7 years ago

I investigated a bit more, and found out that the problems are mainly in Linear Algebra functions:

@test sumabs2(Array(chol(ad*ad')) - chol(a*a')) < 1e-5
@test sumabs2(Array(ctranspose(chol(ad*ad'))) - ctranspose(chol(a*a'))) < 1e-5
ud, sd, vtd = svd(ad)
u, s, v = svd(a)
@test sumabs(Array(ud) - u) < 1e-4
@test sumabs(Array(sd) - s) < 1e-4
@test sumabs(Array(vtd') - v) < 1e-4

If I comment out the above lines, the test proceeds much further. Yet one more issue I encountered. Pkg.test("ArrayFire") after commenting out those Linalg lines, I got the following warning and error upon exits:

Warning:  Program terminating, but clFFT resources not freed.
Please consider explicitly calling clfftTeardown( ).
==============================[ ERROR: ArrayFire ]==============================

failed process: Process(`'C:\Program Files\Julia-0.5.2\bin\julia' -Cx86-64 '-JC:\Program Files\Julia-0.5.2\lib\julia\sys.dll' --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=no --compilecache=yes 'C:\Users\BVP\.julia\v0.5\ArrayFire\test\runtests.jl'`, ProcessExited(3221225477)) [3221225477]

================================================================================
ArrayFire had test errors
in test at base\pkg\pkg.jl:258
in #test#3 at base\pkg\pkg.jl:258
in #cd at base\<missing>
in #cd#1 at base\pkg\dir.jl:31
in cd at base\file.jl:48
in #2 at base\pkg\dir.jl:31
in #test at base\<missing>
in #test#61 at base\pkg\entry.jl:748
ranjanan commented 7 years ago

Hi @BoundaryValueProblems, I have not tested this package on Windows properly to be honest. I think you need to have installed Visual Studio and a bunch of other things especially if you're installing ArrayFire built with CUDA. It looks like you installed the OpenCL version. Were you able to run the c++ tests too?

BoundaryValueProblems commented 7 years ago

Hi @ranjanan. Thanks for your reply. Well, I haven't tried to compile the c++ codes in ArrayFire/examples/ yet. I just installed make and cmake on my Windows machine. I already have installed GNU C, g++, etc., via git bash for windows. However, when I tried to compile those examples supplied by ArrayFire, cmake complains by saying that:

$ cmake ..
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (PROJECT):
  The CMAKE_C_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the NMake generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

Do I really need to install Visual Studio? Is GNU C/g++ not enough? By the way, I don't think I installed the OpenCL yet. I just want to use ArrayFire not for CUDA/OpenCL, but for my current CPU on my windows machine.

ranjanan commented 7 years ago

Did you make sure you followed the instructions here? It looks like it lists Visual Studio as a prerequisite.

BoundaryValueProblems commented 7 years ago

Well, Microsoft Visual Studio is a Microsoft software product, which I have to buy; Am I correct?

ranjanan commented 7 years ago

Ah I'm sure they have a community version which you can download for free.