RoshanGerard / aparapi

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

Aparapi will only run in JTP mode #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I'm trying to use aparapi in one of my projects. When running the example apps 
I get the error:

Apr 04, 2012 5:41:12 PM com.amd.aparapi.KernelRunner warnFallBackAndExecute
WARNING: Reverting to Java Thread Pool (JTP) for class com.amd.aparapi.sample.sq
uares.Main$1: Range workgroup size 256 > device 128
com.amd.aparapi.RangeException: Range workgroup size 256 > device 128
        at com.amd.aparapi.KernelRunner.executeOpenCL(KernelRunner.java:1239)
        at com.amd.aparapi.KernelRunner.execute(KernelRunner.java:1513)
        at com.amd.aparapi.Kernel.execute(Kernel.java:1682)
        at com.amd.aparapi.Kernel.execute(Kernel.java:1613)
        at com.amd.aparapi.Kernel.execute(Kernel.java:1583)
        at com.amd.aparapi.sample.squares.Main.main(Main.java:82)
Execution mode=JTP

After creating a project in Eclipse I added the aparapi.jar to the build path, 
added the aparapi_x86.dll and opencl.dll to the PATH, installed the newest 
version of OpenCL 1.1 still when trying to recreate the square example I get:

com.amd.aparapi.Kernel$EXECUTION_MODE <clinit>
WARNING: Check your environment. Failed to load aparapi native library 
aparapi_x86 or possibly failed to locate opencl native library 
(opencl.dll/opencl.so). Ensure that both are in your PATH (windows) or in 
LD_LIBRARY_PATH (linux).

Where am I going wrong? Both java and system are 32-bit

Original issue reported on code.google.com by M.M.Sate...@gmail.com on 4 Apr 2012 at 4:45

GoogleCodeExporter commented 9 years ago
Almost forgot, attached is a print out of what you get when you run clinfo.exe

Original comment by M.M.Sate...@gmail.com on 4 Apr 2012 at 4:48

Attachments:

GoogleCodeExporter commented 9 years ago
I had never run with this device.  The problem is that the default range 
created by Aparapi will try to suggest a local size (or group size) of 256 and 
your hardware device will only allow  a maximum of 128. You can see this in the 
output from clinfo (thanks for including it)

If you are using the kernel.execute(int globalSize) such as...

int globalSize = somelarge power of two ; 
myKernel.execute(globalSize);

Consider using a range which allows you to pick the group size rather than the 
default.

Range range = Range.create(somelarge power of two, 128); // pick a group size 
of 128 
myKernel.execute(range);

What we really need (and I am toying with this in the extensions branch) is a 
way to allocated a range based on the device we intend to use.  At present the 
default Range  sizing is chosen based on newer GPU's.....

Try the above change. 

For the second part of your question (eclipse) make sure that the you set the 
java.library.path JVM arg in the run configuration to include the directory 
containing the aparapi_x86.dll file. 

So open the run configuration for the application you want to run. Look in the 
'arguments' tab.  You need to add something like

-Djava.library.path=c:\AparapiInstall

To the lower JVM arguments section

noting of course that aparapi_x86.dll is in dir c:\AparapiInstall for me ;) you 
will need to set it to point to your installed dll.

Gary

Original comment by frost.g...@gmail.com on 4 Apr 2012 at 7:48

GoogleCodeExporter commented 9 years ago
I just added a unit test WideInc to replicate/track this. I will tackle the 
wide inc/dec code path first to see how hard this is.

Original comment by frost.g...@gmail.com on 11 Apr 2012 at 1:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Kinda the same thing with my Asus laptop with Core i7 and Radeon HD5730 :

C:\Users\User\Folder\aparapi-2012-02-15\aparapi-2012-02-15\samples\mandel>jav
a  -Djava.library.path=../..  -Dcom.amd.aparapi.executionMode=  -classpath ../..
/aparapi.jar;mandel.jar  com.amd.aparapi.sample.mandel.Main2D
range= 2D(global:768x768 local:(derived)16x16)
6/05/2012 01:02:34 AM com.amd.aparapi.KernelRunner warnFallBackAndExecute
ADVERTENCIA: Reverting to Java Thread Pool (JTP) for class com.amd.aparapi.sampl
e.mandel.Main2D$MandelKernel: initJNI failed to return a valid handle
Execution mode=JTP

Original comment by yur...@gmail.com on 6 May 2012 at 6:08

GoogleCodeExporter commented 9 years ago
Yuriha, 

I think you have encountered issue #46 
(http://code.google.com/p/aparapi/issues/detail?id=46) which is related to 
OpenCL 1.2.  I am planning to build a binary distribution today.  

Original comment by frost.g...@gmail.com on 6 May 2012 at 4:04

GoogleCodeExporter commented 9 years ago
I see

I'll check it out and post the results.

Thank you for your time !

Original comment by yur...@gmail.com on 6 May 2012 at 7:01

GoogleCodeExporter commented 9 years ago
stored aparapi_x86_64.dll at :
C:\Program Files\Java\jdk1.6.0_23\jre\bin

and the new aparapi.jar at :
lib/ext/

had to recompile the samples with NetBeans and worked fine !

Original comment by yur...@gmail.com on 7 May 2012 at 6:45

GoogleCodeExporter commented 9 years ago
Can this issue be closed?

Original comment by ryan.lam...@gmail.com on 19 Nov 2012 at 8:12

GoogleCodeExporter commented 9 years ago

Original comment by ryan.lam...@gmail.com on 22 Apr 2013 at 5:03