jordan30001 / aparapi

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

Kernel.execute(_range, _passes) used much host memory when _passes > 1 #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Attached Main.Java used much host memory

What is the expected output? What do you see instead?
LINE 14: kernel.execute(Range.create(512, 64), 2); // <- used huge memory and 
throw OutOfMemoryError
but...
LINE 14: kernel.execute(Range.create(512, 64), 1); // <- not huge
why happened?

What version of the product are you using? On what operating system?
aparapi-2012-05-06, Windows7 SP1 64bit, NVIDIA GeForce GTX 680 as GPU.
(can GTX680 write clinfo?)

Please provide any additional information below.
I think Main class used huge memory only when 
-Dcom.amd.aparapi.executionMode=gpu...

Original issue reported on code.google.com by anonym...@gmail.com on 12 Sep 2012 at 10:22

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. 

Do you have the capability of building Aparapi from the trunk?

If so then there is a cltest target in the com.amd.aparapi.jni tree which will 
report opencl information regarding your runtime and device.  

Just cd to trunk/com.amd.aparapi.jni and issue 'ant cltest' 

This will create a 64 bit or 32 bit executable which can be run to determine 
opencl runtime info. 

If you can't build it. Then I can send you a binary version which should work 
(send me an email to frost.gary@gmail.com and I will send you a copy)

I have not been able to recreate this with the trunk version. 

Of course I am also using AMD's runtime ;)

Gary

Original comment by frost.g...@gmail.com on 12 Sep 2012 at 3:20

GoogleCodeExporter commented 9 years ago
This is my cltest output. Thanks.

(Please ignore my poor mail..)

Original comment by anonym...@gmail.com on 13 Sep 2012 at 9:22

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like you were able to build from the trunk.

I have one of these cards somewhere so should be able to quickly verify. 

Now you have the trunk, and can build.  Can you build the whole of aparapi and 
try the latest trunk version.  Just to see if the problem still exists for you 
from the trunk.  

I plan to test from the trunk, and would prefer to know that you still see the 
issue when using the trunk. 

Thanks

Gary  

Original comment by frost.g...@gmail.com on 13 Sep 2012 at 1:14

GoogleCodeExporter commented 9 years ago
Thanks. but I had a trouble and I can't try trunk version...

Ant said BUILD SUCCESSFUL in build.xml of root directory.
I copied new aparapi.jar, aparapi_x86_64.dll into "aparapi-2012-05-06" 
directory.
running "life" sample, I got error...

C:\Users\***\lib\aparapi-2012-05-06\samples\life>java  -Djava.library.path=..
/..  -Dcom.amd.aparapi.executionMode=  -Dcom.amd.aparapi.enableProfiling=true  -
classpath ../../aparapi.jar;life.jar  com.amd.aparapi.sample.life.Main
Check your environment. Failed to load aparapi native library aparapi_x86_64 or
possibly failed to locate opencl native library (opencl.dll/opencl.so). Ensure t
hat both are in your PATH (windows) or in LD_LIBRARY_PATH (linux).
range = global:1179648 local:256

And after this, copied old backup (aparapi.jar, aparapi_x86_64.dll) to 
"aparapi-2012-05-06",
I got great speed with GPU and no error.

So I think I don't make a mistake about PATH... what should i do?

Original comment by anonym...@gmail.com on 13 Sep 2012 at 5:25

GoogleCodeExporter commented 9 years ago
So I assume after the build you had a new aparapi.jar in com.amd.aparapi\dist 
and a new aparapi_x86_64.dll in com.amd.aparapi.jni\dist

After a successful build from the 'trunk' dir. The life.bat in 
trunk/samples/life should just work.  It will point to 
..\..\com.amd.aparapi\dist for aparapi.jar and ..\..\com.amd.aparapi.jni\dist 
for the dll.  

You should not have to move/copy anything

When we build the 'dist' target we automatically 'hack' the bat files and 
change the paths... 

Try running from the trunk\samples\life dir.

Gary 

Original comment by frost.g...@gmail.com on 13 Sep 2012 at 10:11

GoogleCodeExporter commented 9 years ago
I how noob.. ;(

I tried it. But the same error occurs..
Of course I checked paths in life.bat. I think those are right.

and I wonder whether there are differences in the jar and dll that is built by 
the environment.
Could you send me trunk ver jar and dll you build ..?

Original comment by anonym...@gmail.com on 14 Sep 2012 at 4:40

GoogleCodeExporter commented 9 years ago
I attached a copy of my dist build (for Win 64 bit only!) 

Let me know if this works.

Original comment by frost.g...@gmail.com on 14 Sep 2012 at 2:32

Attachments:

GoogleCodeExporter commented 9 years ago
Very Thanks!
I download your zip and run "life.bat". But yours also says ...

Check your environment. Failed to load aparapi native library aparapi_x86_64 or
possibly failed to locate opencl native library (opencl.dll/opencl.so). Ensure t
hat both are in your PATH (windows) or in LD_LIBRARY_PATH (linux).

I redownload aparapi-2012-05-06 and retry "life" of 2012-05-06 now .. and of 
course it goes fine.

Original comment by anonym...@gmail.com on 14 Sep 2012 at 3:30

GoogleCodeExporter commented 9 years ago
Hmm this looks like an OpenCL runtime incompatibility. 

Lets do this the other way around ;) 

Can you rebuild from the trunk (recreating the dll issue for you) and then send 
me (or attache here) a zip of *your*  aparapi.jar and aparapi_x86_64.dll.

I will then a) Test your dll/jar on my system b) look at symbols to see if 
there are any weird dependencies. 

BTW did you download AMD APP SDK in order to build cltest?

What version did you install?

My suspicion is that the APPSDK is for OpenCL 1.2 and although you have (or 
should have) AMD OpenCL 1.2, your NVIDIA driver is probably 1.1

Previous builds of Aparapi were built on OpenCL 1.1.

Yeah I know this is confusing.  

Oh wait.  You posted your cltest output, we should be able to verify this 
assumption  

Yes, so look here 

platform 0{
   CL_PLATFORM_VENDOR.."NVIDIA Corporation"
   CL_PLATFORM_VERSION."OpenCL 1.1 CUDA 4.2.1"
... 
platform 1{
   CL_PLATFORM_VENDOR.."Advanced Micro Devices, Inc."
   CL_PLATFORM_VERSION."OpenCL 1.2 AMD-APP (923.1)"
...

So when you or I compile Aparapi it builds for OpenCL 1.2 (you have the latest 
AMD APP SDK I think - I *know* I do) the aparapi_x86_64 dll has symbols 
expected to be resolved by an OpenCL 1.2 runtime.  

At runtime the only GPU device that you have is for the NVIDIA device which 
only has a 1.1 runtime available. So can't resolve the 1.2 symbols. 

If I am right.  I should be able to run your jar and dll on my machine. 

Send me (or attach) the files to confirm. Thanks for helping me debug this. 

Gary

Original comment by frost.g...@gmail.com on 14 Sep 2012 at 6:50

GoogleCodeExporter commented 9 years ago
Yes! I installed AMD APP SDK v2.7 (for OpenCL 1.2).
But are there older version of appsdk?

Please test my jar and dll.

Original comment by anonym...@gmail.com on 15 Sep 2012 at 2:10

Attachments: