Fork me on GitHub
#uncomplicate
<
2017-12-18
>
chunsj01:12:48

Though Rather slightly off topic, can I use openblas instead of MKL? If it’s a matter of changing the name of library in loadLibrary… Or else?

blueberry03:12:59

@chunsj No. OpenBlas is BLAS only, while MKL also implements LAPACK and lots of other extra functions that Neanderthal uses.

qqq11:12:58

@blueberry: does either OpenCL, Neandertheral, or Cuda have an webasembly backend ?

qqq11:12:19

I'm trying to write one piece of code, and have it be able to run both on my dual 1080 GTX as well as webassembly

blueberry11:12:24

I don't know.

qqq11:12:45

okay, but I guess there's no plan to have WebAsembly as a backend to Neanderthal, so I'm on my own if I want this ?

blueberry12:12:36

never say never

jsa-aerial16:12:10

@blueberry I'm on Linux and have MKL for it. I moved all the mentioned libs (literally copied them) to /usr/local/lib. Actually, let me just give the list here of the ones I moved:

jsa-aerial16:12:18

`libiomp5.so libmkl_avx2.so libmkl_avx512.so libmkl_core.so libmkl_def.so libmkl_intel_lp64.so libmkl_intel_thread.so libmkl_rt.so libmkl_vml_def.so`

jsa-aerial16:12:40

Most things work, but when playing around with the new flare lib (for rnns) I stumbled at one point upon this:

jsa-aerial16:12:48

java: symbol lookup error: /tmp/libneanderthal-mkl-0.17.0283772954573527292.so: undefined symbol: vdFmax

jsa-aerial16:12:13

Presumably I need to move another lib (or more) to where it is visible, but I'm not sure which or what. Thanks for any info!

rustam.gilaztdinov18:12:08

@blueberry hello! I want to try to execute simple OpenCL function

(with-default
  (with-default-engine
    (asum (fv 1 -2 3))))
but get this exception
Unhandled java.lang.UnsupportedOperationException
The function clCreateCommandQueueWithProperties is not supported
I came across closed issue on github clojurecl repo and try yours suggestions for similar problem, like this:
(def dev (first (devices (first (platforms)))))

(let [err (int-array 1)
      res (CL/clCreateContext nil 1 (into-array [dev]) nil nil err)]
  (println (aget  err 0))
  res)

 => 0
#object[org.jocl.cl_context 0x9ca7a72 "cl_context[0x7fa8c790a500]"]


(defn context-fixed
  ([devices properties ch user-data]
   (clojurecl/context* (into-array cl_device_id devices)
                       (and (seq properties) (clojurecl/context-properties properties))
                       ch user-data))
  ([devices]
   (context-fixed devices nil nil nil))
  ([]
   (with-release [devs (devices)]
     (context-fixed devs))))

(context-fixed (devices (first (platforms))))
=> #object[org.jocl.cl_context 0x78acfdd5 "cl_context[0x7fa8c7a8a660]"]
I work on Mac, opencl version 1.2, this is my clinfo output:
Platform #0
Name: Apple
Version: OpenCL 1.2 (Nov 13 2017 23:06:50)

Device #0
Name: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Type: CPU
Version: OpenCL 1.2
Global memory size: 16 GB
Local memory size: 32 kB
Max work group size: 1024
Max work item sizes: (1024, 1, 1)

Device #1
Name: Iris Pro
Type: GPU
Version: OpenCL 1.2
Global memory size: 1 GB 512 MB
Local memory size: 64 kB
Max work group size: 512
Max work item sizes: (512, 512, 512)
I can reproduce exactly the same problem with old 2010 mac on opencl 1.0

blueberry20:12:11

@jsa-aerial are you sure you have the latest MKL 2018?

blueberry20:12:28

@rustam.gilaztdinov Your mac supports OpenCL 1.2, so you have to use a few legacy functions with -1 suffix in names. See the docs and the hello-world example, particularly https://github.com/uncomplicate/neanderthal/blob/master/examples/hello-world/src/hello_world/opencl1.clj

jsa-aerial20:12:12

@blueberry No - I just figured that out (before seeing your msg) and now have 2018 installed. I will test and confirm it works. Thanks.

jsa-aerial21:12:26

@blueberry That was it alright. Confirmed: with new 2018 install all tests pass. Thanks again!