Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
feval works but gather fails

Subject: feval works but gather fails

From: AL_math

Date: 11 Feb, 2013 10:19:12

Message: 1 of 2

Hi,
I am processing an image, by using CUDA kernels.
I am calling GPUoutput = feval(........ ), and everything is fine, no error messages appear.
But when I call: "output = gather(GPUoutput);" then I get an error messagse:

" Error using parallel.gpu.GPUArray/gather
  An unexpected error occurred during CUDA execution. The CUDA error was: CUDA_ERROR_UNKNOWN. "

The more strange fact, is that when I am calling less blocks of threads to process only part of the image, but still need to gather back an image of the same size (which is simply partially black) the problem is gone.

I would really like to understand what is going on.

thanks in advance

Subject: feval works but gather fails

From: Edric M Ellis

Date: 18 Feb, 2013 09:14:01

Message: 2 of 2

"AL_math " <anatlibman1@gmail.com> writes:

> I am processing an image, by using CUDA kernels. I am calling
> GPUoutput = feval(........ ), and everything is fine, no error
> messages appear. But when I call: "output = gather(GPUoutput);" then
> I get an error messagse:
>
> " Error using parallel.gpu.GPUArray/gather
> An unexpected error occurred during CUDA execution. The CUDA error was:
> CUDA_ERROR_UNKNOWN. "

All CUDA kernel invocations return before the actual computation is
complete, so problems in your kernel can show up later when you try and
access the resulting data. I suspect that is what is happening here.

> The more strange fact, is that when I am calling less blocks of
> threads to process only part of the image, but still need to gather
> back an image of the same size (which is simply partially black) the
> problem is gone.

It sounds like when you try to work on the whole image, you may be
reading or writing beyond the bounds of the image.

Cheers,

Edric.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us