ArrayFire.jl v1.0.1 released

ArrayFire.jl v1.0.1 has been released to fully support Julia v1.x . It is a wrapper around excellent GPU computing and graphics library ArrayFire.

The most important “feature” of this release is that the need for manual memory management is gone. By hooking up Julia’s incremental garbage collector with GC.gc(false) it is now possible to achieve even better performance than it was possible with @afgc (to track scope) and manual finalize. You can fine tune by setafgcthreshold to about half of your GPU available memory (default is 4Gb == 8Gb GPU ram) and that’s it.

Feedback much appreciated.

9 Likes

There is a link to arrayfire but not to arrayfire.jl. hehe

Apologies if this is a dumb question, but how do I install this?

After downloading the installer for mac, and looking at the readme, the only libaf files I can find are in /opt/arrayfire/lib, and but this doesn’t work:

julia> ENV["LD_LIBRARY_PATH"] = "/opt/arrayfire/lib"
"/opt/arrayfire/lib"

julia> using ArrayFire
[ Info: Recompiling stale cache file /Users/improbable22/.julia/compiled/v1.1/ArrayFire/SIACH.ji for ArrayFire [b19378d9-d87a-599a-927f-45f220a2c452]
ERROR: InitError: error compiling __init__: could not load library "libaf"
dlopen(libaf.dylib, 1): image not found
Stacktrace:
 [1] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:633

Sorry, I’m not on a mac, can you try following workarounds suggested in Installation error on macOS with Julia 0.6.2 · Issue #205 · JuliaGPU/ArrayFire.jl · GitHub ?

Ah thanks, I didn’t look in the issues. I tried some things from there… and I can get different errors! But am not sure what to make of them:

julia> using Libdl,Random,SparseArrays,LinearAlgebra,FFTW,DSP,Statistics
[ Info: Recompiling stale cache file /Users/.../.julia/compiled/v1.1/DSP/OtML7.ji for DSP [717857b8-e6f2-59f4-9121-6e50c889abd2]

julia> ENV["DYLD_LIBRARY_PATH"]
"/opt/arrayfire/lib"

julia> using ArrayFire
[ Info: Recompiling stale cache file /Users/.../.julia/compiled/v1.1/ArrayFire/SIACH.ji for ArrayFire [b19378d9-d87a-599a-927f-45f220a2c452]
ERROR: InitError: ArrayFire Error (501) : Failed to load dynamic library. 
Error in af_err unified::AFSymbolManager::call(const char *, CalleeArgs...) [CalleeArgs = <>]
In file src/api/unified/symbol_manager.hpp:61
Failed to load dynamic library. See http://www.arrayfire.com/docs/unifiedbackend.htm for instructions to set up environment for Unified backend.

Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] _error(::UInt32, ::Bool) at /Users/.../.julia/packages/ArrayFire/Tx4Iq/src/util.jl:96
 [3] _error at /Users/.../.julia/packages/ArrayFire/Tx4Iq/src/util.jl:85 [inlined]
 [4] afinit at /Users/.../.julia/packages/ArrayFire/Tx4Iq/src/wrap.jl:996 [inlined]

When I try otool as suggested I get this error:

$ otool -L af
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: 'af': No such file or directory

That error comes from array fire library itself, not the wrapper. You can try asking it on the Create a better error message for unified backend failures · Issue #2346 · arrayfire/arrayfire · GitHub or enter a bug that is mac specific .

OK, thanks! Will try a bit more next week.