Skip to content

Conversation

@jramapuram
Copy link
Member

@9prady9 : Can you test opencl on linux? For some reason my linux box isn't building libafopencl. It should work as expected though. It does work fine on OSX though :)

     Running `target/debug/examples/unified`
There are 2 available backends
ArrayFire v3.2.0 (CPU, 64-bit Linux, build c607f62)
[0] Intel: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz Max threads(12) 
Create a 10-by-10 matrix of random floats on the compute device
No Name Array
[10 10 1 1]
    0.0000     0.3835     0.4175     0.9103     0.2470     0.7665     0.9047     0.5007     0.8278     0.2332 
    0.1315     0.5194     0.6868     0.7622     0.9826     0.4777     0.5045     0.3841     0.1254     0.3063 
    0.7556     0.8310     0.5890     0.2625     0.7227     0.2378     0.5163     0.2771     0.0159     0.3510 
    0.4587     0.0346     0.9304     0.0475     0.7534     0.2749     0.3190     0.9138     0.6885     0.5133 
    0.5328     0.0535     0.8462     0.7361     0.6515     0.3593     0.9866     0.5297     0.8682     0.5911 
    0.2190     0.5297     0.5269     0.3282     0.0727     0.1665     0.4940     0.4644     0.6295     0.8460 
    0.0470     0.6711     0.0920     0.6326     0.6316     0.4865     0.2661     0.9410     0.7362     0.4121 
    0.6789     0.0077     0.6539     0.7564     0.8847     0.8977     0.0907     0.0501     0.7254     0.8415 
    0.6793     0.3834     0.4160     0.9910     0.2727     0.9092     0.9478     0.7615     0.9995     0.2693 
    0.9347     0.0668     0.7012     0.3653     0.4364     0.0606     0.0737     0.7702     0.8886     0.4154 

ArrayFire v3.2.0 (CUDA, 64-bit Linux, build c607f62)
Platform: CUDA Toolkit 7.5, Driver: 352.39
[0] GeForce GTX TITAN X, 12285 MB, CUDA Compute 5.2
Create a 10-by-10 matrix of random floats on the compute device
No Name Array
[10 10 1 1]
    0.7402     0.7762     0.2080     0.3557     0.2849     0.9200     0.2674     0.9910     0.4942     0.1528 
    0.9210     0.2948     0.6110     0.7229     0.7793     0.1872     0.0208     0.8793     0.3031     0.0119 
    0.0390     0.7140     0.3073     0.2783     0.2133     0.1820     0.8331     0.9996     0.8094     0.1726 
    0.9690     0.3585     0.4156     0.6192     0.4131     0.5984     0.7218     0.2068     0.1293     0.4784 
    0.9251     0.6814     0.2343     0.5876     0.0328     0.7082     0.6087     0.4372     0.7832     0.8051 
    0.4464     0.2920     0.8793     0.3750     0.5360     0.0421     0.6301     0.3727     0.0732     0.6872 
    0.6673     0.3194     0.6462     0.2405     0.7214     0.7305     0.5298     0.4468     0.1236     0.3022 
    0.1099     0.8109     0.9264     0.4148     0.3546     0.9400     0.8127     0.2376     0.2229     0.8077 
    0.4702     0.1541     0.5786     0.0937     0.2527     0.8432     0.0593     0.0345     0.7420     0.4071 
    0.5132     0.4452     0.5538     0.6326     0.9847     0.6116     0.4797     0.7308     0.6273     0.7513 

OpenCL backend not available: Unkown Error

OSX Result:

     Running `target/debug/examples/unified`
There are 3 available backends
ArrayFire v3.2.0 (CPU, 64-bit Mac OSX, build c607f62)
[0] Intel: Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz Max threads(8)
Create a 10-by-10 matrix of random floats on the compute device
No Name Array
[10 10 1 1]
    0.0000     0.0895     0.2971     0.9362     0.6095     0.0840     0.5771     0.5042     0.9585     0.7989
    0.0850     0.5604     0.4261     0.4146     0.4323     0.1813     0.1639     0.4674     0.9908     0.5930
    0.6014     0.5822     0.8995     0.3085     0.5995     0.6167     0.6985     0.5790     0.1136     0.8967
    0.8916     0.8096     0.6530     0.5149     0.8449     0.5791     0.3348     0.6741     0.8706     0.2717
    0.9680     0.5919     0.9015     0.3954     0.4924     0.7393     0.4558     0.0934     0.6223     0.1980
    0.1897     0.5117     0.9615     0.7898     0.7728     0.3141     0.0762     0.0667     0.6727     0.2705
    0.5150     0.8766     0.1647     0.6891     0.0717     0.4388     0.1288     0.8327     0.6140     0.3964
    0.3980     0.9951     0.8580     0.5443     0.1919     0.4120     0.1745     0.3898     0.5877     0.0959
    0.2629     0.7262     0.9068     0.5924     0.2236     0.9089     0.4418     0.1909     0.1509     0.6481
    0.7435     0.9666     0.2940     0.0936     0.7804     0.9923     0.0373     0.1654     0.2550     0.6326

ArrayFire v3.1.1 (CUDA, 64-bit Mac OSX, build 2d75672)
Platform: CUDA Toolkit 7, Driver: CUDA Driver Version: 7000
[0] GeForce GT 750M, 2048 MB, CUDA Compute 3.0
Create a 10-by-10 matrix of random floats on the compute device
No Name Array
[10 10 1 1]
    0.7402     0.7762     0.2080     0.3557     0.2849     0.9200     0.2674     0.9910     0.4942     0.1528
    0.9210     0.2948     0.6110     0.7229     0.7793     0.1872     0.0208     0.8793     0.3031     0.0119
    0.0390     0.7140     0.3073     0.2783     0.2133     0.1820     0.8331     0.9996     0.8094     0.1726
    0.9690     0.3585     0.4156     0.6192     0.4131     0.5984     0.7218     0.2068     0.1293     0.4784
    0.9251     0.6814     0.2343     0.5876     0.0328     0.7082     0.6087     0.4372     0.7832     0.8051
    0.4464     0.2920     0.8793     0.3750     0.5360     0.0421     0.6301     0.3727     0.0732     0.6872
    0.6673     0.3194     0.6462     0.2405     0.7214     0.7305     0.5298     0.4468     0.1236     0.3022
    0.1099     0.8109     0.9264     0.4148     0.3546     0.9400     0.8127     0.2376     0.2229     0.8077
    0.4702     0.1541     0.5786     0.0937     0.2527     0.8432     0.0593     0.0345     0.7420     0.4071
    0.5132     0.4452     0.5538     0.6326     0.9847     0.6116     0.4797     0.7308     0.6273     0.7513

ArrayFire v3.2.0 (OpenCL, 64-bit Mac OSX, build c607f62)
[0] APPLE   : Iris Pro
-1- APPLE   : GeForce GT 750M
Create a 10-by-10 matrix of random floats on the compute device
No Name Array
[10 10 1 1]
    0.4107     0.6600     0.8395     0.9250     0.6530     0.8355     0.1033     0.9276     0.6742     0.2809
    0.8224     0.0764     0.1933     0.3063     0.5476     0.4878     0.2119     0.8662     0.9713     0.3084
    0.9518     0.0901     0.7270     0.9313     0.8577     0.2055     0.5955     0.3578     0.9878     0.1965
    0.1794     0.5933     0.0322     0.8684     0.8370     0.1794     0.3745     0.6263     0.0663     0.1459
    0.4198     0.1098     0.0012     0.6592     0.0618     0.5606     0.9165     0.9747     0.6043     0.2551
    0.0081     0.1046     0.8703     0.4387     0.4224     0.6767     0.9426     0.2002     0.5900     0.5746
    0.3775     0.8827     0.5259     0.3784     0.5293     0.6742     0.4817     0.2022     0.7482     0.3614
    0.3027     0.1647     0.1443     0.4002     0.0212     0.4523     0.9097     0.5389     0.2379     0.4471
    0.6456     0.8060     0.3253     0.4390     0.1103     0.1236     0.6821     0.5509     0.3121     0.0836
    0.5591     0.5938     0.5081     0.4718     0.4420     0.7924     0.6056     0.8180     0.8957     0.7878

fixes #29

src/defines.rs Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enum's value in ArrayFire is 4, this is probably the reason OpenCL is not working. ArrayFIre OpenCL libs will be built but i believe it can't be used if this value is not 4 since ArrayFire's native enum has 4 for this backend.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a recent change actually which is probably why it is not working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@9prady9
Copy link
Member

9prady9 commented Oct 22, 2015

On my home laptop(Linux), only CPU and Linux OpenCL backends ran fine in the unified example. haven't digged down yet, will post here once i have more information.

@jramapuram
Copy link
Member Author

Try now, should work. What is 'linux' backend?

@9prady9
Copy link
Member

9prady9 commented Oct 22, 2015

@jramapuram My bad, instead of OpenCL i wrote linux.

@jramapuram
Copy link
Member Author

@9prady9 : no worries. Can you pull latest changes & try with:

> git submodule update --init
> rm -rf arrayfire/build

@9prady9
Copy link
Member

9prady9 commented Oct 22, 2015

I did these also after the commands you pasted and it worked fine on my office machine (doesn't have CUDA though). I will have to test CUDA on another machine or later from my laptop.

> cargo clean
> cargo build

@jramapuram
Copy link
Member Author

👍

@jramapuram
Copy link
Member Author

@9prady9 : added the new function as well fyi

@9prady9
Copy link
Member

9prady9 commented Oct 23, 2015

@jramapuram I have tested on my laptop with cuda device, CUDA backend still doesn't work for me in the unified example. CPU and OpenCL are running fine though.

@jramapuram
Copy link
Member Author

@9prady9 : Hmm, not sure what is going on. It is working fine for me on linux and osx. Couple things:

  1. Is your sdk_lib_dir in build.conf specified correctly? It might be lib64 or lib based on your OS
  2. Is your cuda_sdk specified correctly?
  3. Is your LD_LIBRARY_PATH pointing to the correct location of the new libafcuda.so ?
  4. Is there a libafcuda.so in arrayfire/build/package/lib ?

@9prady9
Copy link
Member

9prady9 commented Oct 23, 2015

Sdk path may be the reason, will check it out. I would assume cmkae will
pick Cuda sdk paths from standard location but in any case will check it
out.

On Fri, Oct 23, 2015, 8:48 AM Jason Ramapuram notifications@github.com
wrote:

@9prady9 https://github.com/9prady9 : Hmm, not sure what is going on.
It is working fine for me on linux and osx. Couple things:

  1. Is your sdk_lib_dir in build.conf specified correctly? It might be
    lib64 or lib based on your OS
  2. Is your cuda_sdk specified correctly?
  3. Is your LD_LIBRARY_PATH pointing to the correct location of the new
    libafcuda.so ?
  4. Is there a libadcuda.so in arrayfire/build/package/lib ?


Reply to this email directly or view it on GitHub
#42 (comment)
.

@9prady9 9prady9 self-assigned this Oct 30, 2015
@9prady9 9prady9 added this to the 3.2 milestone Oct 30, 2015
9prady9 added a commit that referenced this pull request Oct 30, 2015
Add unified API support and fix the build mechanism appropriately.
@9prady9 9prady9 merged commit 39f9632 into master Oct 30, 2015
@9prady9 9prady9 deleted the feature/unified branch October 30, 2015 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the unified API and switch backends at runtime

3 participants