cudaGraphicsResourceGetMappedPointer in parallel There is a way to get various resource pointer at t

Hi everyone,

I’m working in an application that works with hundreds of graphics resources. Mapping then at the same time is easy with cudaGraphicsMapResources.

Does anyone know if it is possible to get the pointer to the resources at the same time?

I need this because in my application, get all the pointer individually is consuming too much time.

you can get the pointers once, and store it somewhere, since they actually don’t change. At least i have never experienced that.

maybe you can help me,

i am using a pbo as a cudagraphicsresource
to display a 8bit grayscale image calculated by a cuda kernel.
I copy the result to the pbo with a mapped pointer.

Everything works fine, except that the mapping, and getting the mapped pointer takes 2-3ms!

i am doing it like that:
launch my kernel with the mapped pointer passed to it

The sdk samples are much faster, total performance is around 1000fps,
so i guess somehow mapping the pbo there takes much less time.

I am using visual studio 2008, cuda toolkit 3.2, my computer: MSI fx700, geforce 425m gpu.

What can cause the slow mapping of the graphics resource?

Thanks for anyone who helps.

Actually they may change every time cudaGraphicsMapResources is called. Take a look at the documentation of cudaGraphicsGetMappedPointer

That’s why I’m thinking that should be a way to get various pointers at the same time.

The time depends on the size of your resource. What is the size of the image you’re mapping?

1024*768, unsigned char

Did you set any hint flag for the type of mapping you’re making?

cudaGraphicsMapFlagsNone 	 //Default; Assume resource can be read/written.

cudaGraphicsMapFlagsReadOnly 	 //CUDA will not write to this resource.

cudaGraphicsMapFlagsWriteDiscard 	 //CUDA will only write to and will not read from this resource.

This may help a little

i am calling cudaGraphicsGLRegisterBuffer(…) with cudaGraphicsMapFlagsWriteDiscard flag

as i see i am doing everything as it is done in the cuda boxfilter example.

i am afraid that there is some configuration properties in my visual studio project which casues the difference.

Setting up a project is very messy… (i found no documentation how to treat library linking for example)

Thank you for your help,