mtchamengo / aparapi

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

Error !!!!!!! clCreateBuffer failed invalid buffer size , how to increase buffer size #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I  am doing some image processing. my code having width and height. when i 
used Width=3832  and  Hieght = 3832 it working fine in GPU mode. but when i 
used Width=12000   Hieght = 12000 its given error " !!!!!!! clCreateBuffer 
failed invalid buffer size " . and try to convert in JTP mode . but b'cz ogf my 
kernal logic it will not work in JTP mode. how can i increase buffer size.

2.  How i can increase bufferSize.

3.

What is the expected output? What do you see instead?

it will return int array after execute on GPU .
What version of the product are you using? On what operating system?
Platform Version: OpenCL 1.2 AMD-APP (938.1)
Board name:AMD FireStream 9350

OS - CentOS 5.4

Please provide any additional information below.

same size (width and height) is working in java thread code separately written 
with different logic.

Original issue reported on code.google.com by kri22go...@gmail.com on 28 Aug 2012 at 12:03

GoogleCodeExporter commented 9 years ago
Do you know how much ram your graphics card has?

If you execute clinfo (shipped with AMD's OpenCL implementation for determining 
OpenCL characteristics) it should report the max amount of available GPU 
memory. 

This will be the limit for allocation size.

For my APU this is around 200 MB total bytes
  Max memory allocation:                         199753728

Note that this does not mean my program gets all of this.  My experience is 
that OpenCL will only allow your program to allocate 25%-40% of this.

A 12000 * 12000 image of int's (for RGBA style pixel info) would require 576Mb 
(assuming that this is the only memory you are accessing from your kernel). 

How much memory does your GPU card have?

Gary

Original comment by frost.g...@gmail.com on 29 Aug 2012 at 4:28

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thnx gray...
My card  Max memory allocation:  268435456 ( near abt 256 MB)
and  Global memory size:    1073741824     (near about 1024MB or 1GB).
i am using two int array of size 12000 * 12000 in my kernel, but image property 
show its 14.1 MB JPEG image with 12000 * 12000 pixel .
is it any way  break the array and  do computation on GPU when calling kernel ( 
Kernel.execute()).

Same progam is running on CPU having large memory as compare to GPU card .
 Max memory allocation:7369785344  (near about 6 GB)
 Global memory size:   29479141376 (near about 27 GB)
...

Original comment by kri22go...@gmail.com on 30 Aug 2012 at 6:57

GoogleCodeExporter commented 9 years ago
So two int arrays of 12000 x 12000 would be 12000*12000*2*sizeof(int) = 
144000000*2*4 = 288000000*4 =  1.152 Gb

Sadly you don't have enough memory to process this image in you graphics card 
memory. 

Maybe you can process it in 9 chunks (top left, top middle, top right, middle 
left, middle etc)?

What kind of processing are you doing? Is it a convolution?

The 14.1 MB JPEG file is highly compresssed. 

Gary

Original comment by frost.g...@gmail.com on 30 Aug 2012 at 1:00

GoogleCodeExporter commented 9 years ago
thnx gary..
i am doing sobel edge detection algorithm....

Original comment by kri22go...@gmail.com on 31 Aug 2012 at 11:51

GoogleCodeExporter commented 9 years ago
So you should be able to work on the image in chunks.  

Let me know how it works. 

I will close this issue. 

Maybe I should add an example convolution for large images.... 

Gary 

Original comment by frost.g...@gmail.com on 31 Aug 2012 at 12:22

GoogleCodeExporter commented 9 years ago
i read image using imageIo api and got an int array of RGBA. i transfer that 
array to GPU card  and use convolution for that but not in chunks... 
using globalId i calculated  X and Y and  neighbour pixel and apply convolution 
to each pixel  and store out put in another array,,

Original comment by kri22go...@gmail.com on 31 Aug 2012 at 1:05

GoogleCodeExporter commented 9 years ago

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