rzel / aparapi

Automatically exported from code.google.com/p/aparapi
Other
0 stars 0 forks source link

Aparapi can't find OpenCL #158

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have been having some trouble getting aparapi to work on my desktop.
I'm running Windows 7 64 bit with an AMD graphics card and all appropriate 
drivers installed.
output from clinfo: http://pastebin.com/fA0Pke8Y

from latest release on code google 
(https://code.google.com/p/aparapi/downloads/list)
output from info sample: http://pastebin.com/wiYGEcGP
output from add sample: http://pastebin.com/GEXMR70r

from latest release on Github (https://github.com/aparapi/aparapi/releases)
output from info sample: http://pastebin.com/mbQWMybd
output from add sample: http://pastebin.com/KeWp6XnM

The aparapi.jar and opencl.dll files are both in locations in the windows path.
I can only imagine that I don't have something set up correctly, but would 
appreciate any help getting this to work.
Thanks,
Jeff

Original issue reported on code.google.com by the...@vt.edu on 14 Jan 2015 at 12:12

Attachments:

GoogleCodeExporter commented 8 years ago
Can you try running your Aparapi app with 

-Dcom.amd.aparapi.enableVerboseJNI=true

It should dump out a bunch of logging messages, including info on whether it 
located OpenCL libs.

If you have the dev tree out (of git or svn) you can also try to build cltest 
which is a pure C++ app (no java) which can help

$ cd com.amd.aparapi.jni 
$ ant cltest

Then run cltest

Gary

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 12:21

GoogleCodeExporter commented 8 years ago
running it with -Dcom.amd.aparapi.enableVerboseJNI=true generates the exact 
same output
without: http://pastebin.com/EHRHkq5k
with: http://pastebin.com/5K2e0QGQ
let me know if I'm completely missing something

Original comment by the...@vt.edu on 14 Jan 2015 at 12:53

GoogleCodeExporter commented 8 years ago
My bad.  Been away from the code too long. 

That should have been

-Dcom.amd.aparapi.showEnableVerboseJNI=true

-Dcom.amd.aparapi.dumpFlags=true should describe all properties that you can 
use. 

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 12:58

GoogleCodeExporter commented 8 years ago
still pretty much the same output
http://pastebin.com/eXgS5BrE

I enabled other stuff too, but that didn't make any difference
http://pastebin.com/XDE0qFie

Original comment by the...@vt.edu on 14 Jan 2015 at 1:18

GoogleCodeExporter commented 8 years ago
OK if this is amd's opencl you should be able to run clinfo from the command 
line. Does this work for you?

Do you have any other OpenCL apps working?

Sorry for brevity I am on my phone on the bus.

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 1:26

GoogleCodeExporter commented 8 years ago
output from clinfo: http://pastebin.com/fA0Pke8Y
also see screen caps in initial post

Original comment by the...@vt.edu on 14 Jan 2015 at 1:31

GoogleCodeExporter commented 8 years ago
there is a clear difference in speed from running the opencl demos in the 
geeks3d program on the gpu versus the cpu, so I'm taking that as confirmation 
that it is successfully using OpenCL on the gpu, but aside from that, no, I 
don't have anything else working with OpenCL

Original comment by the...@vt.edu on 14 Jan 2015 at 1:37

GoogleCodeExporter commented 8 years ago

Your original screen images suggested you were using opencl 1.2 but your driver 
is 2.0. 

Sadly Aparapi doors not seem to be able to load the driver. Maybe the path is 
incorrect?

 Did you upgrade a driver recently?

There was an issue with Aparapi not detecting opencl 2.0 but I think this is 
fixed in the github repository. 

Until recentky the c++ code was hard cided to check for the string opencl 1.1 
or 1.2 just changing this to accept opencl 2.0 was all that was needed. But as 
I said I think your issue is more to do with an issue loading the dll.

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 1:45

GoogleCodeExporter commented 8 years ago
I do have both the 3.0 beta as well as the 2.9-1 versions of the AMD APP SDK 
installed, 3.0 corresponding to OpenCL 2.0 and 2.9 to OpenCL 1.2. The AMD APP 
SDK 2.9 bin comes first in my path, so it should be checking there first. Would 
I need to uninstall 3.0? or is there something else I should try?

Original comment by the...@vt.edu on 14 Jan 2015 at 1:50

GoogleCodeExporter commented 8 years ago
tried uninstalling 3.0, didn't make a difference, it was still running OpenCL 
2.0

finally got cltest working from a copy of the git repo (I think...)
here's the output: http://pastebin.com/MXzhaN1X

thanks for all your help, I really appreciate it

Original comment by the...@vt.edu on 14 Jan 2015 at 8:17

GoogleCodeExporter commented 8 years ago
So what did you have to do to get cltest to run?

Did you have to tweak your path?

The reason I like cltest is if 'it' runs, then Aparapi should assuming the 
paths are the same. cltest uses the same API's that the JNI code uses. 

So try copying cltest executable to the directory where you are trying to run 
from and run it from the same shell/cmd window

Gary

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 8:21

GoogleCodeExporter commented 8 years ago
Also...

If you managed to build cltest from the got repo did you also manage to rebuild 
com.amd.aparapi.jni?

Gary 

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 8:23

GoogleCodeExporter commented 8 years ago
yeah, still doesn't work...
http://pastebin.com/NXJ1z9e3

getting it to work was just arguing with ant, nothing to do with actually 
cltest itself not working

Original comment by the...@vt.edu on 14 Jan 2015 at 8:34

GoogleCodeExporter commented 8 years ago
attempting to build com.amd.aparapi.jni: http://pastebin.com/Ek1aaF7A

I feel like I'm missing something really obvious...

Original comment by the...@vt.edu on 14 Jan 2015 at 9:22

GoogleCodeExporter commented 8 years ago
OK, still puzzling. 

Is this just one of the demo apps and you are trying to run with the bat files?

Or is this your own app?  In which case what is your command line?

Gary

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 9:23

GoogleCodeExporter commented 8 years ago
Oh your jni errors are because jni stuff depends on the java stuff.  Sorry I 
should have been more explicit..

$ cd <whereever you aparapi root is>
$ cd com.amd.aparapi
$ ant
$ cd ../com.amd.aparapi.jni
$ ant

Gary

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 9:25

GoogleCodeExporter commented 8 years ago
it's the add sample given with the download, run from the add.bat file

Original comment by the...@vt.edu on 14 Jan 2015 at 9:26

GoogleCodeExporter commented 8 years ago
rebuilt everything successfully, and at any stage if I try to run anything I 
get the same
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
com.amd.aparapi.internal.jni.OpenCLJNI.getPlatforms()Ljava/util/List;
        at com.amd.aparapi.internal.jni.OpenCLJNI.getPlatforms(Native Method)
        etc...

Original comment by the...@vt.edu on 14 Jan 2015 at 9:55

GoogleCodeExporter commented 8 years ago
So edit the bat file for add and make sure that the paths are pointing to the 
.dll's which you just built.  

The bat files by default point to the result of a 'release' build.  So just 
edit the paths so that they reference your newly built dll under 
com.amd.aparapi.jni....

Gary

Original comment by frost.g...@gmail.com on 14 Jan 2015 at 10:28

GoogleCodeExporter commented 8 years ago
still nothing, same result.
I'm really thinking it's something to do with the path, because the cltest 
works...
how does it determine its path(s)?

Original comment by the...@vt.edu on 15 Jan 2015 at 4:28

GoogleCodeExporter commented 8 years ago
Hi,
After installation of aparapi .so file will be placed inside 
com.amd.aparapi.jni folder.
you can override above error by adding com.amd.aparapi.jni folder path to 
-Djava.library.path while runtime.

Execution will be like.....

java -Djava.library.path=<path to com.amd.aparapi.jni> 
-Dcom.amd.aparapi.enableVerboseJNI=true <followed by remaing options for 
execution mode> <application>

Original comment by eswar07...@gmail.com on 29 Apr 2015 at 5:33