Re: SOCLES

42 views
Skip to first unread message

Michael Zucchi

unread,
Aug 22, 2012, 6:07:11 PM8/22/12
to Lorenzo, socles-...@googlegroups.com

Hi Lorenzo,

In the code i'm looking at (hessionDet_kernel.cl), responses and
laplacians are both write_only image2d_t types (line 49, 55). It might
have something to do with the opencl support level of that graphics
card/driver - check the nvidia documentation.

socles doesn't use OpenCV or CUDA. You should also use the mailing list
for socles questions.

Regards,
Michael

On 23/08/12 06:15, Lorenzo wrote:
> Hi,
> i'am a student, and i'am working with image management. I've
> downloaded SOCLES, but when i'm trying to run the demo of SURF i get
> this error:
> Exception in thread "AWT-EventQueue-0"
> com.jogamp.opencl.CLException$CLBuildProgramFailureException:
> CLDevice [id: 139893393831168 name: GeForce 8600 GT type: GPU profile:
> FULL_PROFILE] build log:
> :155:17: error: write_imagef not permitted on image marked __read_only
> write_imagef(responses, (int2)(idx,idy), determinant);
> ^
> :156:17: error: write_imagei not permitted on image marked __read_only
> write_imagei(laplacians, (int2)(idx,idy), laplacian);
>
> do you have any idea of how to solve it?
> I'm running the code in linux 64bit with OpenCV 2.4.2 compiled whit
> CUDA support.
> Thankyou very much!
> Lorenzo
>

Lorenzo Lodi Rizzini

unread,
Sep 14, 2012, 4:02:00 PM9/14/12
to socles-...@googlegroups.com, Lorenzo
I tried to find some solution without success, anyone have some idea? I can´t really understand why it reads __read_only when the image type is __write_only..

Michael Zucchi

unread,
Sep 15, 2012, 7:36:03 PM9/15/12
to socles-...@googlegroups.com

Hi Again,

About all I can suggest is trying a different opencl implementation,
e.g. the amd or intel cpu driver. Obviously it wont give gpu
performance, but it might rule out the code itself as the issue.

Michael

Lorenzo

unread,
Sep 17, 2012, 4:27:30 PM9/17/12
to socles-...@googlegroups.com
Hi, thank you again!
I tried with CPU. On my notebook with intel core2 everything run just
fine and i had this output:
run-single:
Loading hessianDet_kernel.cl with -DIMAGES_SUPPORTED -DIMAGES_INTEGER
Loading nonMaxSuppression_kernel.cl with -DIMAGES_SUPPORTED -DIMAGES_INTEGER
Loading integralImage_kernels.cl with -DIMAGES_SUPPORTED -DIMAGES_INTEGER
Loading getOrientation_kernels.cl with -DIMAGES_SUPPORTED -DIMAGES_INTEGER
Loading createDescriptors_kernel.cl with -DIMAGES_SUPPORTED -DIMAGES_INTEGER
Loading normaliseDescriptors_kernel.cl with -DIMAGES_SUPPORTED -DIMAGES_INTEGER
Loading utils.cl with
Loading generated integral image with
Not enough space for Ipoints had 3431 needed 3072 reallocating and running again
Found 3431 features in 5.054888s
done
BUILD SUCCESSFUL (total time: 2 minutes 39 seconds)

But when i tried with another pc with intel core i5 i had a problem
with this output:

Exception in thread "AWT-EventQueue-0"
com.jogamp.opencl.CLException$CLImageFormatNotSupportedException: can
not create 2d image [error: CL_IMAGE_FORMAT_NOT_SUPPORTED]
at com.jogamp.opencl.CLException.checkForError(CLException.java:67)
at com.jogamp.opencl.CLImage2d.createImage(CLImage2d.java:62)
at com.jogamp.opencl.CLContext.createImage2d(CLContext.java:399)
at com.jogamp.opencl.CLContext.createImage2d(CLContext.java:378)
at au.notzed.socle.feature.surf.ResponseLayer.<init>(ResponseLayer.java:58)
at au.notzed.socle.feature.surf.FastHessian.createResponseMap(FastHessian.java:122)
at au.notzed.socle.feature.surf.FastHessian.<init>(FastHessian.java:112)
at au.notzed.socle.feature.surf.SURFDetector.<init>(SURFDetector.java:126)
at au.notzed.socle.feature.surf.SURFDetector.<init>(SURFDetector.java:102)
at soclesdemo.feature.SURFeatures$1.run(SURFeatures.java:77)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:711)
at java.awt.EventQueue.access$000(EventQueue.java:104)
at java.awt.EventQueue$3.run(EventQueue.java:672)
at java.awt.EventQueue$3.run(EventQueue.java:670)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:681)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

So i tried to change the image type to R_Type to RGBA_type and in this
way i did not have this error anymore but i have a new error:
Exception in thread "AWT-EventQueue-0" java.nio.BufferOverflowException
at java.nio.DirectIntBufferU.put(DirectIntBufferU.java:357)
at java.nio.IntBuffer.put(IntBuffer.java:832)
at au.notzed.socle.util.ImageLoader.putImage(ImageLoader.java:118)
at soclesdemo.feature.SURFeatures$1.run(SURFeatures.java:81)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:711)
at java.awt.EventQueue.access$000(EventQueue.java:104)
at java.awt.EventQueue$3.run(EventQueue.java:672)
at java.awt.EventQueue$3.run(EventQueue.java:670)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:681)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

any idea? Thank you again

Michael Zucchi

unread,
Sep 17, 2012, 7:33:45 PM9/17/12
to socles-...@googlegroups.com

Hi,

The code uses all sorts of image types, so without proper image support
it could be a hassle to convert it. Have you tried the AMD cpu driver?
It works fine on intel cpu's and supports images properly.

But that looks like it could be a bug with the image loader, what types
are the input buffered image and the target CLImage2d?

Michael

Lorenzo

unread,
Sep 18, 2012, 11:19:13 AM9/18/12
to socles-...@googlegroups.com
Hi,
now with AMD driver everything run just fine with my CPU! Thank you very much!
The target CLImage2d i was using in the putImage method was RGBA_UINT8
and the buffered image was the file read from a jpeg color image.
Thank you again!

Lorenzo

unread,
Oct 30, 2012, 2:31:04 PM10/30/12
to socles-...@googlegroups.com
Hi, 
i have another problem.. I´m using your library to try to find matching images. I choose an image and i try to run a ransac for each image in another folder trying to find the one with best inlier distribution to find matching images. The problem is that after trying matching various images I get a com.jogamp.opencl.CLException$CLOutOfResourcesException: can not enqueue 2DRange CLKernel.
I tried in many ways to deallocate the resources after each matching without success. Do you have any idea of how can i free resource in order to be able to run the algorithm multiple times? Thank you very much!
Lorenzo

Michael Zucchi

unread,
Oct 30, 2012, 6:13:12 PM10/30/12
to socles-...@googlegroups.com

Hi again,

Hmm, dunno, could just be a bug in the code. I haven't tested it much,
let alone on a cpu. Although I have run a version of it on live video
for at least a few minutes without troubles.

Do you have your stuff available somewhere online?

Michael

Lorenzo

unread,
Nov 1, 2012, 1:32:28 PM11/1/12
to socles-...@googlegroups.com
Hi, 
I edit your RANSACFeatures code to run multiple time on the same images and in this way i get the same error running many times the same thread on the same images 9MPixels images of 4MB in jpeg.
My video card is an AMD 6770. After 10 times i get the same exception i wrote you about. 
Please find attached the modified code.
Thank you
Lorenzo
RANSACFeatures.java

Michael Zucchi

unread,
Nov 1, 2012, 7:27:06 PM11/1/12
to socles-...@googlegroups.com

JOCL doesn't do garbage collection, resources must be de-allocated
manually, that loop is guaranteed to fail.

When I processed video i pre-allocated all the buffers and just re-used
them.
> com.jogamp.opencl.CLException$__CLOutOfResourcesException:

Lorenzo

unread,
Nov 5, 2012, 12:33:27 PM11/5/12
to socles-...@googlegroups.com
Thankyou I´ll try in this way! Do you know how manually deallocate resources in jocl? Thank you very much!
Reply all
Reply to author
Forward
0 new messages